|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
#include <Fl_Menu_.H>


Public Member Functions | |
| Fl_Menu_ (int, int, int, int, const char *=0) | |
| ~Fl_Menu_ () | |
| int | item_pathname (char *name, int namelen, const Fl_Menu_Item *finditem=0) const |
| const Fl_Menu_Item * | picked (const Fl_Menu_Item *) |
| const Fl_Menu_Item * | find_item (const char *name) |
| const Fl_Menu_Item * | find_item (Fl_Callback *) |
| int | find_index (const char *name) const |
| int | find_index (const Fl_Menu_Item *item) const |
| int | find_index (Fl_Callback *cb) const |
| const Fl_Menu_Item * | test_shortcut () |
| void | global () |
| const Fl_Menu_Item * | menu () const |
| void | menu (const Fl_Menu_Item *m) |
| void | copy (const Fl_Menu_Item *m, void *user_data=0) |
| int | insert (int index, const char *, int shortcut, Fl_Callback *, void *=0, int=0) |
| int | add (const char *, int shortcut, Fl_Callback *, void *=0, int=0) |
| int | add (const char *a, const char *b, Fl_Callback *c, void *d=0, int e=0) |
| int | insert (int index, const char *a, const char *b, Fl_Callback *c, void *d=0, int e=0) |
| int | add (const char *) |
| int | size () const |
| void | size (int W, int H) |
| void | clear () |
| int | clear_submenu (int index) |
| void | replace (int, const char *) |
| void | remove (int) |
| void | shortcut (int i, int s) |
| void | mode (int i, int fl) |
| int | mode (int i) const |
| const Fl_Menu_Item * | mvalue () const |
| int | value () const |
| int | value (const Fl_Menu_Item *) |
| int | value (int i) |
| const char * | text () const |
| const char * | text (int i) const |
| Fl_Font | textfont () const |
| void | textfont (Fl_Font c) |
| Fl_Fontsize | textsize () const |
| void | textsize (Fl_Fontsize c) |
| Fl_Color | textcolor () const |
| void | textcolor (Fl_Color c) |
| Fl_Boxtype | down_box () const |
| void | down_box (Fl_Boxtype b) |
| Fl_Color | down_color () const |
| void | down_color (unsigned c) |
Protected Attributes | |
| uchar | alloc |
| uchar | down_box_ |
| Fl_Font | textfont_ |
| Fl_Fontsize | textsize_ |
| Fl_Color | textcolor_ |
Base class of all widgets that have a menu in FLTK. Currently FLTK provides you with Fl_Menu_Button, Fl_Menu_Bar, and Fl_Choice.
The class contains a pointer to an array of structures of type Fl_Menu_Item. The array may either be supplied directly by the user program, or it may be "private": a dynamically allocated array managed by the Fl_Menu_.
Definition at line 48 of file Fl_Menu_.H.
| Fl_Menu_::Fl_Menu_ | ( | int | X, |
| int | Y, | ||
| int | W, | ||
| int | H, | ||
| const char * | l = 0 |
||
| ) |
Creates a new Fl_Menu_ widget using the given position, size, and label string. menu() is initialized to null.
Definition at line 307 of file Fl_Menu_.cxx.
References alloc, Fl_Widget::box(), down_box(), FL_FOREGROUND_COLOR, FL_HELVETICA, FL_NO_BOX, FL_NORMAL_SIZE, FL_SELECTION_COLOR, FL_UP_BOX, FL_WHEN_RELEASE_ALWAYS, Fl_Widget::selection_color(), Fl_Widget::set_flag(), Fl_Widget::SHORTCUT_LABEL, textcolor(), textfont(), textsize(), and Fl_Widget::when().
| Fl_Menu_::~Fl_Menu_ | ( | ) |
Definition at line 364 of file Fl_Menu_.cxx.
References clear().
| int Fl_Menu_::add | ( | const char * | label, |
| int | shortcut, | ||
| Fl_Callback * | callback, | ||
| void * | userdata = 0, |
||
| int | flags = 0 |
||
| ) |
Adds a new menu item.
| [in] | label | The text label for the menu item. |
| [in] | shortcut | Optional keyboard shortcut that can be an int or string; (FL_CTRL+'a') or "^a". Default 0 if none. |
| [in] | callback | Optional callback invoked when user clicks the item. Default 0 if none. |
| [in] | userdata | Optional user data passed as an argument to the callback. Default 0 if none. |
| [in] | flags | Optional flags that control the type of menu item; see below. Default is 0 for none. |
Detailed Description of Parameters
[#+^]<ascii_value> e.g. "97", "^97", "+97", "#97" [#+^]<ascii_char> e.g. "a", "^a", "+a", "#a"
# - Alt + - Shift ^ - Control
FL_MENU_INACTIVE // Deactivate menu item (gray out) FL_MENU_TOGGLE // Item is a checkbox toggle (shows checkbox for on/off state) FL_MENU_VALUE // The on/off state for checkbox/radio buttons (if set, state is 'on') FL_MENU_RADIO // Item is a radio button (one checkbox of many can be on) FL_MENU_INVISIBLE // Item will not show up (shortcut will work) FL_SUBMENU_POINTER // Indicates user_data() is a pointer to another menu array FL_SUBMENU // This item is a submenu to other items FL_MENU_DIVIDER // Creates divider line below this item. Also ends a group of radio buttons.
Definition at line 327 of file Fl_Menu_add.cxx.
References insert().
Referenced by add(), Fl_File_Chooser::filter(), Fl_Comment_Type::open(), print_load(), and Fl_File_Chooser::rescan_keep_filename().
| int Fl_Menu_::add | ( | const char * | str | ) |
This is a Forms (and SGI GL library) compatible add function, it adds many menu items, with '|' separating the menu items, and tab separating the menu item names from an optional shortcut string.
The passed string is split at any '|' characters and then add(s,0,0,0,0) is done with each section. This is often useful if you are just using the value, and is compatible with Forms and other GL programs. The section strings use the same special characters as described for the long version of add().
No items must be added to a menu during a callback to the same menu.
| str | string containing multiple menu labels as described above |
Definition at line 431 of file Fl_Menu_add.cxx.
References add(), buf, and fl_old_shortcut().
| int Fl_Menu_::add | ( | const char * | a, |
| const char * | b, | ||
| Fl_Callback * | c, | ||
| void * | d = 0, |
||
| int | e = 0 |
||
| ) | [inline] |
See int Fl_Menu_::add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0)
Definition at line 97 of file Fl_Menu_.H.
References fl_old_shortcut().
| void Fl_Menu_::clear | ( | ) |
Same as menu(NULL), set the array pointer to null, indicating a zero-length menu.
Menus must not be cleared during a callback to the same menu.
Definition at line 378 of file Fl_Menu_.cxx.
References alloc, i, size(), and text().
Referenced by Fl_File_Chooser::filter(), menu(), Fl_Comment_Type::open(), print_load(), Fl_File_Chooser::rescan_keep_filename(), and ~Fl_Menu_().
| int Fl_Menu_::clear_submenu | ( | int | index | ) |
Clears the specified submenu pointed to by index of all menu items.
This method is useful for clearing a submenu so that it can be re-populated with new items. Example: a "File/Recent Files/..." submenu that shows the last few files that have been opened.
The specified index must point to a submenu.
The submenu is cleared with remove(). If the menu array was directly set with menu(x), then copy() is done to make a private array.
Example:
int index = menubar->find_index("File/Recent"); // get index of "File/Recent" submenu if ( index != -1 ) menubar->clear_submenu(index); // clear the submenu menubar->add("File/Recent/Aaa"); menubar->add("File/Recent/Bbb"); [..]
| index | The index of the submenu to be cleared |
Definition at line 422 of file Fl_Menu_.cxx.
References FL_SUBMENU, Fl_Widget::flags(), size(), and text().
| void Fl_Menu_::copy | ( | const Fl_Menu_Item * | m, |
| void * | ud = 0 |
||
| ) |
Sets the menu array pointer with a copy of m that will be automatically deleted. If userdata ud is not NULL, then all user data pointers are changed in the menus as well. See void Fl_Menu_::menu(const Fl_Menu_Item* m).
Definition at line 351 of file Fl_Menu_.cxx.
References alloc, Fl_Menu_Item::callback_, menu(), Fl_Menu_Item::size(), and Fl_Menu_Item::user_data_.
| Fl_Boxtype Fl_Menu_::down_box | ( | ) | const [inline] |
This box type is used to surround the currently-selected items in the menus. If this is FL_NO_BOX then it acts like FL_THIN_UP_BOX and selection_color() acts like FL_WHITE, for back compatibility.
Definition at line 154 of file Fl_Menu_.H.
Referenced by Fl_Menu_Type::copy_properties(), Fl_Menu_Item::draw(), Fl_Choice::Fl_Choice(), Fl_File_Chooser::Fl_File_Chooser(), Fl_Menu_(), Fl_Menu_Button::Fl_Menu_Button(), make_data_panel(), make_decl_panel(), make_declblock_panel(), make_function_panel(), make_global_settings_window(), make_print_panel(), make_project_window(), make_settings_window(), make_widget_panel(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().
| void Fl_Menu_::down_box | ( | Fl_Boxtype | b | ) | [inline] |
| Fl_Color Fl_Menu_::down_color | ( | ) | const [inline] |
For back compatibility, same as selection_color()
Definition at line 159 of file Fl_Menu_.H.
References Fl_Widget::selection_color().
| void Fl_Menu_::down_color | ( | unsigned | c | ) | [inline] |
For back compatibility, same as selection_color()
Definition at line 161 of file Fl_Menu_.H.
References Fl_Widget::selection_color().
| int Fl_Menu_::find_index | ( | const Fl_Menu_Item * | item | ) | const |
Find the index the menu array for given item.
A way to convert a menu item pointer into an index.
Current implementation is fast and not expensive.
// Convert an index-to-item int index = 12; const Fl_Menu_Item *item = mymenu->menu() + index; // Convert an item-to-index int index = mymenu->find_index(item); if ( index == -1 ) { ..error.. }
| item | The *item to be found |
Definition at line 156 of file Fl_Menu_.cxx.
References size().
| int Fl_Menu_::find_index | ( | Fl_Callback * | cb | ) | const |
Find the index into the menu array for a given callback cb.
This method finds a menu item's index position, also traversing submenus, but not submenu pointers. This is useful if an application uses internationalisation and a menu item can not be found using its label. This search is also much faster.
| cb | Find the first item with this callback |
Definition at line 173 of file Fl_Menu_.cxx.
References size().
| int Fl_Menu_::find_index | ( | const char * | pathname | ) | const |
Find the menu item index for a given menu pathname, such as "Edit/Copy".
This method finds a menu item's index position for the given menu pathname, also traversing submenus, but not submenu pointers.
To get the menu item pointer for a pathname, use find_item()
| pathname | The path and name of the menu item index to find |
Definition at line 193 of file Fl_Menu_.cxx.
References FL_SUBMENU, Fl_Menu_Item::flags, Fl_Menu_Item::label(), m, size(), and strlcat.
Referenced by find_item().
| const Fl_Menu_Item * Fl_Menu_::find_item | ( | const char * | pathname | ) |
Find the menu item for a given menu pathname, such as "Edit/Copy".
This method finds a menu item in the menu array, also traversing submenus, but not submenu pointers.
To get the menu item's index, use find_index(const char*)
Example:
Fl_Menu_Bar *menubar = new Fl_Menu_Bar(..); menubar->add("File/&Open"); menubar->add("File/&Save"); menubar->add("Edit/&Copy"); // [..] Fl_Menu_Item *item; if ( ( item = (Fl_Menu_Item*)menubar->find_item("File/&Open") ) != NULL ) { item->labelcolor(FL_RED); } if ( ( item = (Fl_Menu_Item*)menubar->find_item("Edit/&Copy") ) != NULL ) { item->labelcolor(FL_GREEN); }
| pathname | The path and name of the menu item |
Definition at line 130 of file Fl_Menu_.cxx.
References find_index(), and i.
Referenced by make_main_window().
| const Fl_Menu_Item * Fl_Menu_::find_item | ( | Fl_Callback * | cb | ) |
Find the menu item for the given callback cb.
This method finds a menu item in a menu array, also traversing submenus, but not submenu pointers. This is useful if an application uses internationalisation and a menu item can not be found using its label. This search is also much faster.
| cb | find the first item with this callback |
Definition at line 234 of file Fl_Menu_.cxx.
References Fl_Menu_Item::callback_, m, and size().
| void Fl_Menu_::global | ( | ) |
Make the shortcuts for this menu work no matter what window has the focus when you type it. This is done by using Fl::add_handler(). This Fl_Menu_ widget does not have to be visible (ie the window it is in can be hidden, or it does not have to be put in a window at all).
Currently there can be only one global()menu. Setting a new one will replace the old one. There is no way to remove the global() setting (so don't destroy the widget!)
Definition at line 53 of file Fl_Menu_global.cxx.
References Fl::add_handler().
Referenced by make_main_window().
| int Fl_Menu_::insert | ( | int | index, |
| const char * | a, | ||
| const char * | b, | ||
| Fl_Callback * | c, | ||
| void * | d = 0, |
||
| int | e = 0 |
||
| ) | [inline] |
See int Fl_Menu_::insert(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0)
Definition at line 101 of file Fl_Menu_.H.
References fl_old_shortcut().
| int Fl_Menu_::insert | ( | int | index, |
| const char * | label, | ||
| int | shortcut, | ||
| Fl_Callback * | callback, | ||
| void * | userdata = 0, |
||
| int | flags = 0 |
||
| ) |
Inserts a new menu item at the specified index position.
If index is -1, the menu item is appended; same behavior as add().
To properly insert a menu item, label must be the name of the item (eg. "Quit"), and not a 'menu pathname' (eg. "File/Quit"). If a menu pathname is specified, the value of index is ignored, the new item's position defined by the pathname.
For more details, see add(). Except for the index parameter, add() has more detailed information on parameters and behavior, and is functionally equivalent.
| [in] | index | The menu array's index position where the new item is inserted. If -1, behavior is the same as add(). |
| [in] | label | The text label for the menu item. If the label is a menu pathname, index is ignored, and the pathname indicates the position of the new item. |
| [in] | shortcut | Optional keyboard shortcut. Can be an int (FL_CTRL+'a') or a string ("^a"). Default is 0. |
| [in] | callback | Optional callback invoked when user clicks the item. Default 0 if none. |
| [in] | userdata | Optional user data passed as an argument to the callback. Default 0 if none. |
| [in] | flags | Optional flags that control the type of menu item; see add() for more info. Default is 0 for none. |
Definition at line 364 of file Fl_Menu_add.cxx.
References alloc, copy(), fl_menu_array_owner, Fl_Menu_Item::insert(), and size().
Referenced by add().
| int Fl_Menu_::item_pathname | ( | char * | name, |
| int | namelen, | ||
| const Fl_Menu_Item * | finditem = 0 |
||
| ) | const |
Get the menu 'pathname' for the specified menuitem.
If finditem==NULL, mvalue() is used (the most recently picked menuitem).
Example:
Fl_Menu_Bar *menubar = 0; void my_menu_callback(Fl_Widget*,void*) { char name[80]; if ( menubar->item_pathname(name, sizeof(name)-1) == 0 ) { // recently picked item if ( strcmp(name, "File/&Open") == 0 ) { .. } // open invoked if ( strcmp(name, "File/&Save") == 0 ) { .. } // save invoked if ( strcmp(name, "Edit/&Copy") == 0 ) { .. } // copy invoked } } int main() { [..] menubar = new Fl_Menu_Bar(..); menubar->add("File/&Open", 0, my_menu_callback); menubar->add("File/&Save", 0, my_menu_callback); menubar->add("Edit/&Copy", 0, my_menu_callback); [..] }
Definition at line 73 of file Fl_Menu_.cxx.
References Fl_Menu_Item::label(), m, menu(), mvalue(), SAFE_STRCAT, size(), and Fl_Menu_Item::submenu().
Referenced by Fl_Comment_Type::open().
| const Fl_Menu_Item* Fl_Menu_::menu | ( | ) | const [inline] |
Returns a pointer to the array of Fl_Menu_Items. This will either be the value passed to menu(value) or the private copy.
Definition at line 91 of file Fl_Menu_.H.
References menu_.
Referenced by align_position_cb(), align_text_image_cb(), Fl_Menu_Type::build_menu(), copy(), Fl_Menu_Type::copy_properties(), Fl_Menu_Bar::draw(), Fl_Color_Chooser::Fl_Color_Chooser(), Fl_Menu_Button::handle(), Fl_Menu_Bar::handle(), Fl_Choice::handle(), item_pathname(), make_data_panel(), make_decl_panel(), make_declblock_panel(), make_function_panel(), make_global_settings_window(), make_main_window(), make_print_panel(), make_project_window(), make_settings_window(), make_widget_panel(), Fl_Comment_Type::open(), Fl_Menu_Button::popup(), print_cb(), print_load(), print_update_status(), Fl_File_Chooser::rescan_keep_filename(), Fl_PostScript_Printer::start_job(), subtype_cb(), and Fl_Choice_Type::widget().
| void Fl_Menu_::menu | ( | const Fl_Menu_Item * | m | ) |
Sets the menu array pointer directly. If the old menu is private it is deleted. NULL is allowed and acts the same as a zero-length menu. If you try to modify the array (with add(), replace(), or remove()) a private copy is automatically done.
Definition at line 339 of file Fl_Menu_.cxx.
References clear().
| void Fl_Menu_::mode | ( | int | i, |
| int | fl | ||
| ) | [inline] |
Sets the flags of item i. For a list of the flags, see Fl_Menu_Item.
Definition at line 114 of file Fl_Menu_.H.
References Fl_Menu_Item::flags, i, and menu_.
| int Fl_Menu_::mode | ( | int | i | ) | const [inline] |
Gets the flags of item i. For a list of the flags, see Fl_Menu_Item.
Definition at line 116 of file Fl_Menu_.H.
References Fl_Menu_Item::flags, i, and menu_.
| const Fl_Menu_Item* Fl_Menu_::mvalue | ( | ) | const [inline] |
Returns a pointer to the last menu item that was picked.
Definition at line 119 of file Fl_Menu_.H.
Referenced by Fl_Input_Choice_Type::click_test(), Fl_Menu_Type::click_test(), Fl_Choice::draw(), Fl_Choice::handle(), item_pathname(), Fl_Menu_Button::popup(), and subtype_cb().
| const Fl_Menu_Item * Fl_Menu_::picked | ( | const Fl_Menu_Item * | v | ) |
When user picks a menu item, call this. It will do the callback. Unfortunately this also casts away const for the checkboxes, but this was necessary so non-checkbox menus can really be declared const...
Definition at line 261 of file Fl_Menu_.cxx.
References Fl_Menu_Item::callback_, Fl_Widget::changed(), Fl_Widget::do_callback(), Fl_Menu_Item::do_callback(), FL_MENU_TOGGLE, FL_MENU_VALUE, FL_WHEN_CHANGED, FL_WHEN_NOT_CHANGED, FL_WHEN_RELEASE, Fl_Menu_Item::flags, Fl_Menu_Item::radio(), Fl_Widget::redraw(), Fl_Widget::set_changed(), Fl_Menu_Item::value(), and Fl_Widget::when().
Referenced by Fl_Menu_Bar::handle(), Fl_Choice::handle(), HandleMenu(), and Fl_Menu_Button::popup().
| void Fl_Menu_::remove | ( | int | i | ) |
Deletes item i from the menu. If the menu array was directly set with menu(x) then copy() is done to make a private array.
No items must be removed from a menu during a callback to the same menu.
| i | index into menu array |
Definition at line 478 of file Fl_Menu_add.cxx.
References alloc, copy(), i, Fl_Menu_Item::next(), size(), and Fl_Menu_Item::text.
Referenced by Fl_Comment_Type::open().
| void Fl_Menu_::replace | ( | int | i, |
| const char * | str | ||
| ) |
Changes the text of item i. This is the only way to get slash into an add()'ed menu item. If the menu array was directly set with menu(x) then copy() is done to make a private array.
| i | index into menu array |
| str | new label for menu item at index i |
Definition at line 458 of file Fl_Menu_add.cxx.
References alloc, copy(), i, size(), and Fl_Menu_Item::text.
| void Fl_Menu_::shortcut | ( | int | i, |
| int | s | ||
| ) | [inline] |
Changes the shortcut of item i to n.
Definition at line 112 of file Fl_Menu_.H.
References i, menu_, and Fl_Menu_Item::shortcut().
| int Fl_Menu_::size | ( | ) | const |
This returns the number of Fl_Menu_Item structures that make up the menu, correctly counting submenus. This includes the "terminator" item at the end. To copy a menu array you need to copy size()*sizeof(Fl_Menu_Item) bytes. If the menu is NULL this returns zero (an empty menu will return 1).
Definition at line 328 of file Fl_Menu_.cxx.
References Fl_Menu_Item::size().
Referenced by clear(), clear_submenu(), find_index(), find_item(), insert(), item_pathname(), Fl_Comment_Type::open(), print_load(), remove(), replace(), Fl_File_Chooser::rescan_keep_filename(), and Fl_Choice::value().
| void Fl_Menu_::size | ( | int | W, |
| int | H | ||
| ) | [inline] |
Changes the size of the widget.
size(W, H) is a shortcut for resize(x(), y(), W, H).
| [in] | W,H | new size |
Reimplemented from Fl_Widget.
Definition at line 106 of file Fl_Menu_.H.
References size.
| const Fl_Menu_Item* Fl_Menu_::test_shortcut | ( | ) | [inline] |
Returns the menu item with the entered shortcut (key value).
This searches the complete menu() for a shortcut that matches the entered key value. It must be called for a FL_KEYBOARD or FL_SHORTCUT event.
If a match is found, the menu's callback will be called.
Reimplemented from Fl_Widget.
Definition at line 84 of file Fl_Menu_.H.
References test_shortcut().
Referenced by Fl_Menu_Button::handle(), Fl_Menu_Bar::handle(), and test_shortcut().
| const char* Fl_Menu_::text | ( | int | i | ) | const [inline] |
Returns the title of item i.
Definition at line 133 of file Fl_Menu_.H.
References i, menu_, and Fl_Menu_Item::text.
| const char* Fl_Menu_::text | ( | ) | const [inline] |
Returns the title of the last item chosen.
Definition at line 131 of file Fl_Menu_.H.
Referenced by clear(), clear_submenu(), Fl_Menu_Bar::draw(), Fl_Menu_Button::handle(), Fl_Menu_Bar::handle(), Fl_Choice::handle(), print_cb(), print_load(), Fl_File_Chooser::rescan_keep_filename(), and Fl_PostScript_Printer::start_job().
| Fl_Color Fl_Menu_::textcolor | ( | ) | const [inline] |
Get the current color of menu item labels.
Definition at line 144 of file Fl_Menu_.H.
Referenced by Fl_Menu_Type::copy_properties(), Fl_Menu_Item::draw(), Fl_Choice::draw(), Fl_Menu_(), and Fl_Choice::handle().
| void Fl_Menu_::textcolor | ( | Fl_Color | c | ) | [inline] |
Sets the current color of menu item labels.
Definition at line 146 of file Fl_Menu_.H.
| Fl_Font Fl_Menu_::textfont | ( | ) | const [inline] |
Gets the current font of menu item labels.
Definition at line 136 of file Fl_Menu_.H.
Referenced by Fl_Menu_Type::copy_properties(), Fl_Menu_Item::draw(), Fl_Choice::draw(), Fl_Choice::Fl_Choice(), Fl_Color_Chooser::Fl_Color_Chooser(), Fl_Menu_(), and Fl_Menu_Item::measure().
| void Fl_Menu_::textfont | ( | Fl_Font | c | ) | [inline] |
Sets the current font of menu item labels.
Definition at line 138 of file Fl_Menu_.H.
| void Fl_Menu_::textsize | ( | Fl_Fontsize | c | ) | [inline] |
Sets the font size of menu item labels.
Definition at line 142 of file Fl_Menu_.H.
| Fl_Fontsize Fl_Menu_::textsize | ( | ) | const [inline] |
Gets the font size of menu item labels.
Definition at line 140 of file Fl_Menu_.H.
Referenced by Fl_Menu_Type::copy_properties(), Fl_Menu_Item::draw(), Fl_Choice::draw(), Fl_Menu_(), make_comment_panel(), make_data_panel(), make_decl_panel(), make_declblock_panel(), make_function_panel(), make_widget_panel(), and Fl_Menu_Item::measure().
| int Fl_Menu_::value | ( | int | i | ) | [inline] |
The value is the index into menu() of the last item chosen by the user. It is zero initially. You can set it as an integer, or set it with a pointer to a menu item. The set routines return non-zero if the new value is different than the old one.
Reimplemented in Fl_Choice.
Definition at line 129 of file Fl_Menu_.H.
References menu_, and value().
Referenced by value().
| int Fl_Menu_::value | ( | ) | const [inline] |
Returns the index into menu() of the last item chosen by the user. It is zero initially.
Reimplemented in Fl_Choice.
Definition at line 121 of file Fl_Menu_.H.
Referenced by Fl_Input_Choice_Type::click_test(), Fl_Menu_Type::click_test(), Fl_Comment_Type::open(), and Fl_Choice::value().
| int Fl_Menu_::value | ( | const Fl_Menu_Item * | m | ) |
The value is the index into menu() of the last item chosen by the user. It is zero initially. You can set it as an integer, or set it with a pointer to a menu item. The set routines return non-zero if the new value is different than the old one.
Reimplemented in Fl_Choice.
Definition at line 250 of file Fl_Menu_.cxx.
References Fl_Widget::clear_changed(), and m.
uchar Fl_Menu_::alloc [protected] |
Definition at line 55 of file Fl_Menu_.H.
Referenced by clear(), copy(), Fl_Menu_(), insert(), remove(), and replace().
uchar Fl_Menu_::down_box_ [protected] |
Definition at line 56 of file Fl_Menu_.H.
Fl_Color Fl_Menu_::textcolor_ [protected] |
Definition at line 59 of file Fl_Menu_.H.
Fl_Font Fl_Menu_::textfont_ [protected] |
Definition at line 57 of file Fl_Menu_.H.
Fl_Fontsize Fl_Menu_::textsize_ [protected] |
Definition at line 58 of file Fl_Menu_.H.