diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-09-29 15:22:47 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-09-29 15:22:47 +0200 |
| commit | 144d7d3529d00ef3fae3850f87c1cba4aadc59b9 (patch) | |
| tree | 4ae62f6401a9d21965e9520164834c0fdf2781ee /FL | |
| parent | 25a9af2f06417552b9e38cb2191611233b866872 (diff) | |
Adds Fl_Menu_::prev_mvalue() (#685)
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Menu_.H | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/FL/Fl_Menu_.H b/FL/Fl_Menu_.H index a30c870ea..3e7461173 100644 --- a/FL/Fl_Menu_.H +++ b/FL/Fl_Menu_.H @@ -54,6 +54,7 @@ class FL_EXPORT Fl_Menu_ : public Fl_Widget { Fl_Menu_Item *menu_; const Fl_Menu_Item *value_; + const Fl_Menu_Item *prev_value_; protected: @@ -158,6 +159,10 @@ public: /** Returns a pointer to the last menu item that was picked. */ const Fl_Menu_Item *mvalue() const {return value_;} + /** Returns a pointer to the menu item that was picked before the current one was picked. + This call gives devs additional details how a user changed a choice in the Fl_Choice widget. + */ + const Fl_Menu_Item *prev_mvalue() const {return prev_value_;} /** Returns the index into menu() of the last item chosen by the user. It is zero initially. */ int value() const {return value_ ? (int)(value_-menu_) : -1;} int value(const Fl_Menu_Item*); |
