summaryrefslogtreecommitdiffstats
path: root/lib/widget/buttonbar.h
blob: 9fc049a459af4e5f87d38c22b437bc2daf81afcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** \file buttonbar.h
 *  \brief Header: WButtonBar widget
 */

#ifndef MC__WIDGET_BUTTONBAR_H
#define MC__WIDGET_BUTTONBAR_H

/*** typedefs(not structures) and defined constants **********************************************/

#define BUTTONBAR(x) ((WButtonBar *)(x))

/* number of bttons in buttonbar */
#define BUTTONBAR_LABELS_NUM 10

#define buttonbar_clear_label(bb, idx, recv) buttonbar_set_label (bb, idx, "", NULL, recv)

/*** enums ***************************************************************************************/

/*** structures declarations (and typedefs of structures)*****************************************/

typedef struct WButtonBar
{
    Widget widget;

    struct
    {
        char *text;
        long command;
        Widget *receiver;
        int end_coord;          /* cumulative width of buttons so far */
    } labels[BUTTONBAR_LABELS_NUM];
} WButtonBar;

/*** global variables defined in .c file *********************************************************/

/*** declarations of public functions ************************************************************/

WButtonBar *buttonbar_new (void);
void buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
                          const global_keymap_t * keymap, Widget * receiver);
WButtonBar *find_buttonbar (const WDialog * h);

/*** inline functions ****************************************************************************/

#endif /* MC__WIDGET_BUTTONBAR_H */