Fl_Sys_Menu_Bar_Driver.H 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // "$Id: Fl_Sys_Menu_Bar_Driver.H 12596 2017-12-18 15:19:15Z manolo $"
  3. //
  4. // system menu bar widget for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2017 by Bill Spitzak and others.
  7. //
  8. // This library is free software. Distribution and use rights are outlined in
  9. // the file "COPYING" which should have been included with this file. If this
  10. // file is missing or damaged, see the license at:
  11. //
  12. // http://www.fltk.org/COPYING.php
  13. //
  14. // Please report all bugs and problems on the following page:
  15. //
  16. // http://www.fltk.org/str.php
  17. //
  18. #ifndef Fl_Sys_Menu_Bar_Driver_H
  19. #define Fl_Sys_Menu_Bar_Driver_H
  20. #if !defined(FL_DOXYGEN)
  21. #include <FL/Fl_Sys_Menu_Bar.H>
  22. class Fl_Sys_Menu_Bar_Driver {
  23. friend class Fl_Sys_Menu_Bar;
  24. public:
  25. static Fl_Sys_Menu_Bar::window_menu_style_enum window_menu_style_;
  26. static Fl_Sys_Menu_Bar_Driver *driver_; // to be assigned with a unique object of this class or of a derived class
  27. Fl_Sys_Menu_Bar *bar;
  28. Fl_Sys_Menu_Bar_Driver();
  29. virtual ~Fl_Sys_Menu_Bar_Driver();
  30. virtual void update() {}
  31. virtual void draw() { bar->Fl_Menu_Bar::draw();}
  32. virtual void about(Fl_Callback *cb, void *data) {}
  33. virtual int add(const char* label, int shortcut, Fl_Callback *cb, void *user_data, int flags) {
  34. return bar->Fl_Menu_Bar::add(label, shortcut, cb, user_data, flags);
  35. }
  36. virtual int add(const char* str) { return bar->Fl_Menu_Bar::add(str); }
  37. virtual int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data, int flags) {
  38. return bar->Fl_Menu_Bar::insert(index, label, shortcut, cb, user_data, flags);
  39. }
  40. virtual void menu(const Fl_Menu_Item *m) { bar->Fl_Menu_Bar::menu(m); }
  41. virtual void shortcut(int i, int s) { bar->Fl_Menu_Bar::shortcut(i, s); }
  42. virtual void setonly(Fl_Menu_Item *item) { bar->Fl_Menu_Bar::setonly(item); }
  43. virtual void clear() { bar->Fl_Menu_Bar::clear(); }
  44. virtual int clear_submenu(int index) { return bar->Fl_Menu_Bar::clear_submenu(index);}
  45. virtual void remove(int index) { bar->Fl_Menu_Bar::remove(index); }
  46. virtual void replace(int index, const char *name) { bar->Fl_Menu_Bar::replace(index, name); }
  47. virtual void mode(int i, int fl) { bar->Fl_Menu_Bar::mode(i, fl); }
  48. virtual void create_window_menu() {}
  49. static Fl_Sys_Menu_Bar::window_menu_style_enum window_menu_style() { return window_menu_style_; }
  50. static void window_menu_style(Fl_Sys_Menu_Bar::window_menu_style_enum style) { window_menu_style_ = style; }
  51. };
  52. #endif // !defined(FL_DOXYGEN)
  53. #endif // Fl_Sys_Menu_Bar_Driver_H
  54. //
  55. // End of "$Id: Fl_Sys_Menu_Bar_Driver.H 12596 2017-12-18 15:19:15Z manolo $".
  56. //