FLTK 1.4.4: Fl_Sys_Menu_Bar.H Source File

FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Sys_Menu_Bar.H
Go to the documentation of this file.
1//
2// MacOS system menu bar header file 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
20
21
22#ifndef Fl_Sys_Menu_Bar_H
23#define Fl_Sys_Menu_Bar_H
24
25#include <FL/Fl_Menu_Bar.H>
26
27class Fl_Sys_Menu_Bar_Driver;
28
95 class FL_EXPORT Fl_Sys_Menu_Bar : public Fl_Menu_Bar {
96 static Fl_Sys_Menu_Bar_Driver *driver();
97protected:
98 void draw() FL_OVERRIDE;
99public:
101 typedef enum {
102 no_window_menu = 0,
103 tabbing_mode_none,
104 tabbing_mode_automatic,
105 tabbing_mode_preferred
106 } window_menu_style_enum;
107 Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l=0);
108 virtual ~Fl_Sys_Menu_Bar();
111 const Fl_Menu_Item *menu() const {return Fl_Menu_::menu();}
112 void menu(const Fl_Menu_Item *m);
113 void update() FL_OVERRIDE;
114 void play_menu(const Fl_Menu_Item *) FL_OVERRIDE;
115 int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0);
119 int add(const char* label, const char* shortcut, Fl_Callback* cb, void *user_data=0, int flags=0) {
120 return add(label, fl_old_shortcut(shortcut), cb, user_data, flags);
121 }
122 int add(const char* str);
123 int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data=0, int flags=0);
127 int insert(int index, const char* label, const char* shortcut, Fl_Callback *cb, void *user_data=0, int flags=0) {
128 return insert(index, label, fl_old_shortcut(shortcut), cb, user_data, flags);
129 }
130 void remove(int n);
131 void replace(int index, const char *name);
132 void clear();
133 int clear_submenu(int index);
134 void mode (int i, int fl);
137 int mode(int i) const { return Fl_Menu_::mode(i); }
138 void shortcut (int i, int s);
139 void setonly (Fl_Menu_Item *item);
140 static void about(Fl_Callback *cb, void *data);
141
142 static window_menu_style_enum window_menu_style();
143 static void window_menu_style(window_menu_style_enum style);
144 static void create_window_menu();
145};
146
149extern Fl_Sys_Menu_Bar *fl_sys_menu_bar;
150
151#endif // Fl_Sys_Menu_Bar_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
FL_OVERRIDE
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46