summaryrefslogtreecommitdiff
path: root/fluid/function_panel.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2015-04-02 14:08:18 +0000
committerMatthias Melcher <fltk@matthiasm.com>2015-04-02 14:08:18 +0000
commit552502d44afeb7214fefe0266bd9abe3d503f47e (patch)
tree09a8e39764d7df5fff3d61dbebcc7ab31cd680d4 /fluid/function_panel.cxx
parent61a7bf60f92c59092728fdbe6e9a08572a687ac5 (diff)
Fixed the Tab order in Fluid dialogs that contain a comment field. The comment field can no longer have tabs in it anymore (hey, it's either that or the other, right?). But I believe that this is a limitation that the user can easily live with. It's just comments, not code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10658 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/function_panel.cxx')
-rw-r--r--fluid/function_panel.cxx89
1 files changed, 50 insertions, 39 deletions
diff --git a/fluid/function_panel.cxx b/fluid/function_panel.cxx
index fcd4d599c..c72524b93 100644
--- a/fluid/function_panel.cxx
+++ b/fluid/function_panel.cxx
@@ -28,6 +28,13 @@ extern void select_only(Fl_Type*);
extern void exit_cb(Fl_Widget*, void*);
extern void toggle_widgetbin_cb(Fl_Widget*, void*);
+/**
+ Allow Windget navigation on Text fields with Tab.
+*/
+static int use_tab_navigation(int, Fl_Text_Editor*) {
+ return 0;
+}
+
Fl_Double_Window *function_panel=(Fl_Double_Window *)0;
Fl_Choice *f_public_member_choice=(Fl_Choice *)0;
@@ -53,12 +60,12 @@ Fl_Input *f_name_input=(Fl_Input *)0;
Fl_Input *f_return_type_input=(Fl_Input *)0;
+Fl_Text_Editor *f_comment_input=(Fl_Text_Editor *)0;
+
Fl_Return_Button *f_panel_ok=(Fl_Return_Button *)0;
Fl_Button *f_panel_cancel=(Fl_Button *)0;
-Fl_Text_Editor *f_comment_input=(Fl_Text_Editor *)0;
-
Fl_Double_Window* make_function_panel() {
{ function_panel = new Fl_Double_Window(343, 232, "Function/Method Properties");
{ Fl_Group* o = new Fl_Group(10, 10, 270, 20);
@@ -105,6 +112,18 @@ Fl_Double_Window* make_function_panel() {
f_return_type_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
f_return_type_input->when(FL_WHEN_NEVER);
} // Fl_Input* f_return_type_input
+ { f_comment_input = new Fl_Text_Editor(10, 125, 320, 65, "Comment:");
+ f_comment_input->tooltip("Function comment in Doxygen format");
+ f_comment_input->box(FL_DOWN_BOX);
+ f_comment_input->labelfont(1);
+ f_comment_input->labelsize(11);
+ f_comment_input->textfont(4);
+ f_comment_input->textsize(11);
+ f_comment_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ Fl_Group::current()->resizable(f_comment_input);
+ f_comment_input->buffer(new Fl_Text_Buffer());
+ f_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);
+ } // Fl_Text_Editor* f_comment_input
{ Fl_Group* o = new Fl_Group(10, 200, 320, 20);
{ f_panel_ok = new Fl_Return_Button(220, 200, 50, 20, "OK");
f_panel_ok->tooltip("Apply the changes.");
@@ -120,17 +139,6 @@ Fl_Double_Window* make_function_panel() {
} // Fl_Box* o
o->end();
} // Fl_Group* o
- { f_comment_input = new Fl_Text_Editor(10, 125, 320, 65, "Comment:");
- f_comment_input->tooltip("Function comment in Doxygen format");
- f_comment_input->box(FL_DOWN_BOX);
- f_comment_input->labelfont(1);
- f_comment_input->labelsize(11);
- f_comment_input->textfont(4);
- f_comment_input->textsize(11);
- f_comment_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- Fl_Group::current()->resizable(f_comment_input);
- f_comment_input->buffer(new Fl_Text_Buffer());
- } // Fl_Text_Editor* f_comment_input
function_panel->set_modal();
function_panel->end();
} // Fl_Double_Window* function_panel
@@ -347,12 +355,12 @@ Fl_Menu_Item menu_decl_class_choice[] = {
Fl_Input *decl_input=(Fl_Input *)0;
+Fl_Text_Editor *decl_comment_input=(Fl_Text_Editor *)0;
+
Fl_Return_Button *decl_panel_ok=(Fl_Return_Button *)0;
Fl_Button *decl_panel_cancel=(Fl_Button *)0;
-Fl_Text_Editor *decl_comment_input=(Fl_Text_Editor *)0;
-
Fl_Double_Window* make_decl_panel() {
{ decl_panel = new Fl_Double_Window(343, 237, "Declaration Properties");
decl_panel->align(Fl_Align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
@@ -385,6 +393,18 @@ n int foo();\", a #directive like \"#include <foo.h>\", a comment like \"//foo\
decl_input->align(Fl_Align(134));
decl_input->when(FL_WHEN_NEVER);
} // Fl_Input* decl_input
+ { decl_comment_input = new Fl_Text_Editor(10, 130, 320, 65, "Comment:");
+ decl_comment_input->tooltip("Declaration comment in Doxygen format");
+ decl_comment_input->box(FL_DOWN_BOX);
+ decl_comment_input->labelfont(1);
+ decl_comment_input->labelsize(11);
+ decl_comment_input->textfont(4);
+ decl_comment_input->textsize(11);
+ decl_comment_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ Fl_Group::current()->resizable(decl_comment_input);
+ decl_comment_input->buffer(new Fl_Text_Buffer());
+ decl_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);
+ } // Fl_Text_Editor* decl_comment_input
{ Fl_Group* o = new Fl_Group(10, 205, 320, 20);
{ decl_panel_ok = new Fl_Return_Button(200, 205, 60, 20, "OK");
decl_panel_ok->labelsize(11);
@@ -399,17 +419,6 @@ n int foo();\", a #directive like \"#include <foo.h>\", a comment like \"//foo\
} // Fl_Box* o
o->end();
} // Fl_Group* o
- { decl_comment_input = new Fl_Text_Editor(10, 130, 320, 65, "Comment:");
- decl_comment_input->tooltip("Declaration comment in Doxygen format");
- decl_comment_input->box(FL_DOWN_BOX);
- decl_comment_input->labelfont(1);
- decl_comment_input->labelsize(11);
- decl_comment_input->textfont(4);
- decl_comment_input->textsize(11);
- decl_comment_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- Fl_Group::current()->resizable(decl_comment_input);
- decl_comment_input->buffer(new Fl_Text_Buffer());
- } // Fl_Text_Editor* decl_comment_input
decl_panel->size_range(343, 237);
decl_panel->end();
} // Fl_Double_Window* decl_panel
@@ -443,12 +452,12 @@ Fl_Input *data_filename=(Fl_Input *)0;
Fl_Button *data_filebrowser=(Fl_Button *)0;
+Fl_Text_Editor *data_comment_input=(Fl_Text_Editor *)0;
+
Fl_Return_Button *data_panel_ok=(Fl_Return_Button *)0;
Fl_Button *data_panel_cancel=(Fl_Button *)0;
-Fl_Text_Editor *data_comment_input=(Fl_Text_Editor *)0;
-
Fl_Double_Window* make_data_panel() {
{ data_panel = new Fl_Double_Window(343, 237, "Binary Data Properties");
data_panel->align(Fl_Align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
@@ -491,6 +500,18 @@ Fl_Double_Window* make_data_panel() {
{ data_filebrowser = new Fl_Button(290, 90, 40, 20, "@fileopen");
data_filebrowser->labelcolor((Fl_Color)134);
} // Fl_Button* data_filebrowser
+ { data_comment_input = new Fl_Text_Editor(10, 130, 320, 65, "Comment:");
+ data_comment_input->tooltip("Declaration comment in Doxygen format");
+ data_comment_input->box(FL_DOWN_BOX);
+ data_comment_input->labelfont(1);
+ data_comment_input->labelsize(11);
+ data_comment_input->textfont(4);
+ data_comment_input->textsize(11);
+ data_comment_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ Fl_Group::current()->resizable(data_comment_input);
+ data_comment_input->buffer(new Fl_Text_Buffer());
+ data_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);
+ } // Fl_Text_Editor* data_comment_input
{ Fl_Group* o = new Fl_Group(10, 205, 320, 20);
{ data_panel_ok = new Fl_Return_Button(200, 205, 60, 20, "OK");
data_panel_ok->labelsize(11);
@@ -505,17 +526,6 @@ Fl_Double_Window* make_data_panel() {
} // Fl_Box* o
o->end();
} // Fl_Group* o
- { data_comment_input = new Fl_Text_Editor(10, 130, 320, 65, "Comment:");
- data_comment_input->tooltip("Declaration comment in Doxygen format");
- data_comment_input->box(FL_DOWN_BOX);
- data_comment_input->labelfont(1);
- data_comment_input->labelsize(11);
- data_comment_input->textfont(4);
- data_comment_input->textsize(11);
- data_comment_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- Fl_Group::current()->resizable(data_comment_input);
- data_comment_input->buffer(new Fl_Text_Buffer());
- } // Fl_Text_Editor* data_comment_input
data_panel->size_range(343, 237);
data_panel->end();
} // Fl_Double_Window* data_panel
@@ -580,6 +590,7 @@ Fl_Double_Window* make_class_panel() {
c_comment_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
Fl_Group::current()->resizable(c_comment_input);
c_comment_input->buffer(new Fl_Text_Buffer());
+ c_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);
} // Fl_Text_Editor* c_comment_input
{ Fl_Group* o = new Fl_Group(10, 165, 320, 20);
{ c_panel_ok = new Fl_Return_Button(200, 165, 60, 20, "OK");