mcfilemanager: use new quick dialog engine.
[midnight-commander.git] / lib / widget / button.h
blob39c7bf720f13218ce449ff7c8da5f80976fa4dab
2 /** \file button.h
3 * \brief Header: WButton widget
4 */
6 #ifndef MC__WIDGET_BUTTON_H
7 #define MC__WIDGET_BUTTON_H
9 /*** typedefs(not structures) and defined constants **********************************************/
12 struct WButton;
14 /* button callback */
15 typedef int (*bcback_fn) (struct WButton * button, int action);
17 /*** enums ***************************************************************************************/
19 typedef enum
21 HIDDEN_BUTTON = 0,
22 NARROW_BUTTON = 1,
23 NORMAL_BUTTON = 2,
24 DEFPUSH_BUTTON = 3
25 } button_flags_t;
27 /*** structures declarations (and typedefs of structures)*****************************************/
29 typedef struct WButton
31 Widget widget;
32 int action; /* what to do when pressed */
33 gboolean selected; /* button state */
35 button_flags_t flags; /* button flags */
36 hotkey_t text; /* text of button, contain hotkey too */
37 int hotpos; /* offset hot KEY char in text */
38 bcback_fn callback; /* callback function */
39 } WButton;
41 /*** global variables defined in .c file *********************************************************/
43 /*** declarations of public functions ************************************************************/
45 WButton *button_new (int y, int x, int action, button_flags_t flags, const char *text,
46 bcback_fn callback);
47 const char *button_get_text (const WButton * b);
48 void button_set_text (WButton * b, const char *text);
49 int button_get_len (const WButton * b);
51 /*** inline functions ****************************************************************************/
53 #endif /* MC__WIDGET_BUTTON_H */