buttonbar.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /** \file buttonbar.h
  2. * \brief Header: WButtonBar widget
  3. */
  4. #ifndef MC__WIDGET_BUTTONBAR_H
  5. #define MC__WIDGET_BUTTONBAR_H
  6. /*** typedefs(not structures) and defined constants **********************************************/
  7. #define BUTTONBAR(x) ((WButtonBar *)(x))
  8. /* number of bttons in buttonbar */
  9. #define BUTTONBAR_LABELS_NUM 10
  10. #define buttonbar_clear_label(bb, idx, recv) buttonbar_set_label (bb, idx, "", NULL, recv)
  11. /*** enums ***************************************************************************************/
  12. /*** structures declarations (and typedefs of structures)*****************************************/
  13. typedef struct WButtonBar
  14. {
  15. Widget widget;
  16. struct
  17. {
  18. char *text;
  19. long command;
  20. Widget *receiver;
  21. int end_coord; /* cumulative width of buttons so far */
  22. } labels[BUTTONBAR_LABELS_NUM];
  23. } WButtonBar;
  24. /*** global variables defined in .c file *********************************************************/
  25. /*** declarations of public functions ************************************************************/
  26. WButtonBar *buttonbar_new (void);
  27. void buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
  28. const global_keymap_t * keymap, Widget * receiver);
  29. WButtonBar *buttonbar_find (const WDialog * h);
  30. /*** inline functions ****************************************************************************/
  31. #endif /* MC__WIDGET_BUTTONBAR_H */