diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2010-11-11 09:12:05 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2010-11-11 09:12:05 +0000 |
| commit | 2105f203f18ef44e4710fc07148f1a2e5376cc68 (patch) | |
| tree | b817a490852c964657aff73d9699ba1135943203 /FL/Fl_Menu_.H | |
| parent | 832c8787ab3769d6120b6b9c87581aae16cb3558 (diff) | |
Fixed menu and shortcut handling (STR #2243). This partly reverts the
fix for STR #2199 - for details see STR #2243.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7816 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Menu_.H')
| -rw-r--r-- | FL/Fl_Menu_.H | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/FL/Fl_Menu_.H b/FL/Fl_Menu_.H index 7cb4cd18e..4b4e4f30f 100644 --- a/FL/Fl_Menu_.H +++ b/FL/Fl_Menu_.H @@ -70,6 +70,17 @@ public: int find_index(const Fl_Menu_Item *item) const; int find_index(Fl_Callback *cb) const; + /** + 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. + + \return matched Fl_Menu_Item or NULL. + */ const Fl_Menu_Item* test_shortcut() {return picked(menu()->test_shortcut());} void global(); @@ -118,7 +129,7 @@ public: int value(int i) {return value(menu_+i);} /** Returns the title of the last item chosen. */ const char *text() const {return value_ ? value_->text : 0;} - /** Returns the title of the last item chosen, or of item i. */ + /** Returns the title of item i. */ const char *text(int i) const {return menu_[i].text;} /** Gets the current font of menu item labels. */ |
