diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-11-25 22:51:41 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-11-25 22:52:00 +0100 |
| commit | 39a3212fc3160f268342068c2beb45b2dbc4107b (patch) | |
| tree | 75a2979abb82ea1c8681a18a32838e32e1edda4f /src/Fl_Text_Editor.cxx | |
| parent | b48ce8699eafc2e36675c74bb19aa61ff2626069 (diff) | |
Adds pulldown menu to Fl_Text_Display and ..._Editor
Diffstat (limited to 'src/Fl_Text_Editor.cxx')
| -rw-r--r-- | src/Fl_Text_Editor.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx index 29fb0d6e3..5e8f2c583 100644 --- a/src/Fl_Text_Editor.cxx +++ b/src/Fl_Text_Editor.cxx @@ -747,6 +747,25 @@ int Fl_Text_Editor::handle(int event) { if (when()&FL_WHEN_CHANGED) do_callback(FL_REASON_CHANGED); return 1; } + + if (Fl::event_button() == FL_RIGHT_MOUSE) { + if (active_r() && window()) { + if (Fl::event_inside(text_area.x, text_area.y, text_area.w, + text_area.h)) window()->cursor(FL_CURSOR_INSERT); + else window()->cursor(FL_CURSOR_DEFAULT); + } + if (Fl::focus() != this) { + Fl::focus(this); + handle(FL_FOCUS); + } + switch (handle_rmb(0)) { + case 1: kf_cut(0, this); break; + case 2: kf_copy(0, this); break; + case 3: kf_paste(0, this); break; + } + return 1; + } + break; case FL_SHORTCUT: |
