diff options
| author | Greg Ercolano <erco@seriss.com> | 2013-10-25 22:03:47 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2013-10-25 22:03:47 +0000 |
| commit | f9470425359e8180ebe73f9585a4f27531f72839 (patch) | |
| tree | 2fbcf91f316c6b0b1379913462d86039dcd4b844 /fluid/function_panel.cxx | |
| parent | d2f83a42c27b6689e79173201624994d23ff1123 (diff) | |
STR #2997: Disable ESC from closing code window.
This drives VI users crazy; a comman 'save' pattern is:
(1) enter some code, (2) hit ESC, (3) type :w ENTER.
In VI these actions save the code entered.
in fluid it /dumps/ the code typed because ESC is a shortcut for the Cancel key.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10010 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/function_panel.cxx')
| -rw-r--r-- | fluid/function_panel.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fluid/function_panel.cxx b/fluid/function_panel.cxx index 249f4e347..21e610d34 100644 --- a/fluid/function_panel.cxx +++ b/fluid/function_panel.cxx @@ -113,7 +113,6 @@ Fl_Double_Window* make_function_panel() { } // Fl_Return_Button* f_panel_ok { f_panel_cancel = new Fl_Button(280, 200, 50, 20, "Cancel"); f_panel_cancel->tooltip("Cancel the changes."); - f_panel_cancel->shortcut(0xff1b); f_panel_cancel->labelsize(11); } // Fl_Button* f_panel_cancel { Fl_Box* o = new Fl_Box(10, 200, 205, 20); @@ -140,6 +139,12 @@ Fl_Double_Window* make_function_panel() { Fl_Double_Window *code_panel=(Fl_Double_Window *)0; +static void cb_code_panel(Fl_Double_Window*, void*) { + if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) + return; // ignore Escape +code_panel->hide(); // otherwise hide..; +} + CodeEditor *code_input=(CodeEditor *)0; Fl_Return_Button *code_panel_ok=(Fl_Return_Button *)0; @@ -149,6 +154,7 @@ Fl_Button *code_panel_cancel=(Fl_Button *)0; Fl_Double_Window* make_code_panel() { { Fl_Double_Window* o = code_panel = new Fl_Double_Window(540, 180, "Code Properties"); code_panel->labelsize(11); + code_panel->callback((Fl_Callback*)cb_code_panel); { CodeEditor* o = code_input = new CodeEditor(10, 10, 520, 130); code_input->box(FL_DOWN_BOX); code_input->color(FL_BACKGROUND2_COLOR); @@ -171,7 +177,6 @@ Fl_Double_Window* make_code_panel() { code_panel_ok->window()->hotspot(code_panel_ok); } // Fl_Return_Button* code_panel_ok { code_panel_cancel = new Fl_Button(470, 150, 60, 20, "Cancel"); - code_panel_cancel->shortcut(0xff1b); code_panel_cancel->labelsize(11); } // Fl_Button* code_panel_cancel { Fl_Box* o = new Fl_Box(10, 150, 380, 20); |
