2010-11-12 11:03:57 +03:00
|
|
|
|
|
|
|
/** \file buttonbar.h
|
|
|
|
* \brief Header: WButtonBar widget
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MC__WIDGET_BUTTONBAR_H
|
|
|
|
#define MC__WIDGET_BUTTONBAR_H
|
|
|
|
|
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
|
|
|
|
2012-10-11 12:25:07 +04:00
|
|
|
#define BUTTONBAR(x) ((WButtonBar *)(x))
|
|
|
|
|
2010-11-12 11:03:57 +03:00
|
|
|
/* 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;
|
|
|
|
gboolean visible; /* Is it visible? */
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char *text;
|
2015-11-21 18:15:11 +03:00
|
|
|
long command;
|
2010-11-12 11:03:57 +03:00
|
|
|
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 (gboolean visible);
|
|
|
|
void buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
|
2016-03-03 22:51:40 +03:00
|
|
|
const global_keymap_t * keymap, const Widget * receiver);
|
2012-09-28 11:18:45 +04:00
|
|
|
WButtonBar *find_buttonbar (const WDialog * h);
|
2010-11-12 11:03:57 +03:00
|
|
|
|
|
|
|
/*** inline functions ****************************************************************************/
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
buttonbar_set_visible (WButtonBar * bb, gboolean visible)
|
|
|
|
{
|
|
|
|
bb->visible = visible;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* MC__WIDGET_BUTTONBAR_H */
|