summaryrefslogtreecommitdiff
path: root/src/Fl_Input.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-12-28 15:43:21 +0100
committerMatthias Melcher <github@matthiasm.com>2023-12-28 15:43:21 +0100
commita09c75e9bc8da17fe82fdba047e9bde2771093c1 (patch)
tree0d2a5afd25e4dfd0c106bc6c10ac00a755c53e76 /src/Fl_Input.cxx
parent30f2ec8185788b6e9a260d77077a2ef2ebed53b2 (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_Input.cxx')
-rw-r--r--src/Fl_Input.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index 3fa2c707b..5a225a64e 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -524,7 +524,12 @@ int Fl_Input::handle_rmb() {
insert_position(word_start(newpos), 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 {
@@ -763,9 +768,6 @@ int Fl_Input::handle(int event) {
*/
Fl_Input::Fl_Input(int X, int Y, int W, int H, const char *l)
: Fl_Input_(X, Y, W, H, l) {
- 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);
}