diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-12-28 15:43:21 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-12-28 15:43:21 +0100 |
| commit | a09c75e9bc8da17fe82fdba047e9bde2771093c1 (patch) | |
| tree | 0d2a5afd25e4dfd0c106bc6c10ac00a755c53e76 /src/Fl_Text_Display.cxx | |
| parent | 30f2ec8185788b6e9a260d77077a2ef2ebed53b2 (diff) | |
Adds Fl_Input RMB menu translation to test/preferences
This also updates the RMB menu labels before every popup so
that changing the labels after creating the widgets still reflects
that change correctly.
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 66a514f68..a7c96d689 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -196,10 +196,6 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l) set_flag(SHORTCUT_LABEL); clear_flag(NEEDS_KEYBOARD); - if (!rmb_menu[0].label()) rmb_menu[0].label(Fl_Input::cut_menu_text); - if (!rmb_menu[1].label()) rmb_menu[1].label(Fl_Input::copy_menu_text); - if (!rmb_menu[2].label()) rmb_menu[2].label(Fl_Input::paste_menu_text); - end(); } @@ -4104,7 +4100,12 @@ int Fl_Text_Display::handle_rmb(int readonly) { txtbuf->select(txtbuf->word_start(newpos), txtbuf->word_end(newpos)); } } - if (readonly) { // give only the menu options that make sense + // keep the menu labels current + rmb_menu[0].label(Fl_Input::cut_menu_text); + rmb_menu[1].label(Fl_Input::copy_menu_text); + rmb_menu[2].label(Fl_Input::paste_menu_text); + // give only the menu options that make sense + if (readonly) { rmb_menu[0].deactivate(); // cut rmb_menu[2].deactivate(); // paste } else { |
