FLTK 1.4.4: Fl_Sys_Menu_Bar_Driver.H Source File

FLTK 1.4.4

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