9d18632c817b8f5e568d13ef0139abbaeaa25f83
[midnight-commander.git] / lib / widget / buttonbar.h
blob9d18632c817b8f5e568d13ef0139abbaeaa25f83
2 /** \file buttonbar.h
3 * \brief Header: WButtonBar widget
4 */
6 #ifndef MC__WIDGET_BUTTONBAR_H
7 #define MC__WIDGET_BUTTONBAR_H
9 /*** typedefs(not structures) and defined constants **********************************************/
11 /* number of bttons in buttonbar */
12 #define BUTTONBAR_LABELS_NUM 10
14 #define buttonbar_clear_label(bb, idx, recv) buttonbar_set_label (bb, idx, "", NULL, recv)
16 /*** enums ***************************************************************************************/
18 /*** structures declarations (and typedefs of structures)*****************************************/
20 struct global_keymap_t;
22 typedef struct WButtonBar
24 Widget widget;
25 gboolean visible; /* Is it visible? */
26 struct
28 char *text;
29 unsigned long command;
30 Widget *receiver;
31 int end_coord; /* cumulative width of buttons so far */
32 } labels[BUTTONBAR_LABELS_NUM];
33 } WButtonBar;
35 struct global_keymap_t;
37 /*** global variables defined in .c file *********************************************************/
39 /*** declarations of public functions ************************************************************/
41 WButtonBar *buttonbar_new (gboolean visible);
42 void buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
43 const struct global_keymap_t *keymap, const Widget * receiver);
44 WButtonBar *find_buttonbar (const WDialog * h);
46 /*** inline functions ****************************************************************************/
48 static inline void
49 buttonbar_redraw (WButtonBar * bb)
51 if (bb != NULL)
52 send_message (bb, NULL, MSG_DRAW, 0, NULL);
55 static inline void
56 buttonbar_set_visible (WButtonBar * bb, gboolean visible)
58 bb->visible = visible;
61 #endif /* MC__WIDGET_BUTTONBAR_H */