FLTK 1.4.5
Toggle main menu visibility
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
27
class
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();
97
protected
:
98
void
draw
()
FL_OVERRIDE
;
99
public
:
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
149
extern
Fl_Sys_Menu_Bar
*
fl_sys_menu_bar
;
150
151
#endif
// Fl_Sys_Menu_Bar_H
fl_sys_menu_bar
Fl_Sys_Menu_Bar * fl_sys_menu_bar
The system menu bar.
Definition
Fl_Sys_Menu_Bar.cxx:24
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_Menu_Bar::Fl_Menu_Bar
Fl_Menu_Bar(int X, int Y, int W, int H, const char *l=0)
Creates a new Fl_Menu_Bar widget using the given position, size, and label string.
Definition
Fl_Menu_Bar.cxx:66
Fl_Menu_::mode
void mode(int i, int fl)
Set the flags of item i.
Definition
Fl_Menu_.H:157
Fl_Menu_::menu
const Fl_Menu_Item * menu() const
Returns a pointer to the array of Fl_Menu_Items.
Definition
Fl_Menu_.H:133
Fl_Sys_Menu_Bar
A class to create and modify menus that appear on macOS in the menu bar at the top of the screen.
Definition
Fl_Sys_Menu_Bar.H:95
Fl_Sys_Menu_Bar::insert
int insert(int index, const char *label, int shortcut, Fl_Callback *cb, void *user_data=0, int flags=0)
insert in the system menu bar a new menu item
Definition
Fl_Sys_Menu_Bar.cxx:133
Fl_Sys_Menu_Bar::mode
int mode(int i) const
Gets the flags of item i.
Definition
Fl_Sys_Menu_Bar.H:137
Fl_Sys_Menu_Bar::tabbing_mode_preferred
@ tabbing_mode_preferred
Windows are tabbed when created.
Definition
Fl_Sys_Menu_Bar.H:105
Fl_Sys_Menu_Bar::no_window_menu
@ no_window_menu
No Window menu in the system menu bar.
Definition
Fl_Sys_Menu_Bar.H:102
Fl_Sys_Menu_Bar::tabbing_mode_automatic
@ tabbing_mode_automatic
Windows are created by themselves but can be tabbed later.
Definition
Fl_Sys_Menu_Bar.H:104
Fl_Sys_Menu_Bar::tabbing_mode_none
@ tabbing_mode_none
No tabbed windows, but the system menu bar contains a Window menu.
Definition
Fl_Sys_Menu_Bar.H:103
Fl_Sys_Menu_Bar::shortcut
void shortcut(int i, int s)
Changes the shortcut of item i to n.
Definition
Fl_Sys_Menu_Bar.cxx:72
Fl_Sys_Menu_Bar::insert
int insert(int index, const char *label, const char *shortcut, Fl_Callback *cb, void *user_data=0, int flags=0)
Insert a new menu item.
Definition
Fl_Sys_Menu_Bar.H:127
Fl_Sys_Menu_Bar::draw
void draw() FL_OVERRIDE
Draws the widget.
Definition
Fl_Sys_Menu_Bar.cxx:193
Fl_Sys_Menu_Bar::add
int add(const char *label, int shortcut, Fl_Callback *, void *user_data=0, int flags=0)
Add a new menu item to the system menu bar.
Definition
Fl_Sys_Menu_Bar.cxx:107
Fl_Sys_Menu_Bar::menu
const Fl_Menu_Item * menu() const
Return the system menu's array of Fl_Menu_Item's.
Definition
Fl_Sys_Menu_Bar.H:111
Fl_Sys_Menu_Bar::Fl_Sys_Menu_Bar
Fl_Sys_Menu_Bar(int x, int y, int w, int h, const char *l=0)
The constructor.
Definition
Fl_Sys_Menu_Bar.cxx:30
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
Fl_Menu_Item
The Fl_Menu_Item structure defines a single menu item that is used by the Fl_Menu_ class.
Definition
Fl_Menu_Item.H:124
fltk-release-1.4.5
FL
Fl_Sys_Menu_Bar.H
Generated by
1.18.0