summaryrefslogtreecommitdiff
path: root/fluid/alignment_panel.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-05-01 19:17:24 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-05-01 19:17:24 +0000
commit683b32002be5230f9ad9eac6d0f484d28e51496a (patch)
tree2cac29c66058ef93e8180eb4f9eb0ff3ac939683 /fluid/alignment_panel.cxx
parent81e13dc96d75dccc7a7d4de64a33cc72eaff391f (diff)
Break grid and GUI settings into separate dialogs.
Use tabs on all of the settings windows, even when there is only one tab. Set the size_range() settings to use the grid values. Add accelerator keys in all of the menus. Rename alignment_window, etc. to project_window, etc. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2165 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/alignment_panel.cxx')
-rw-r--r--fluid/alignment_panel.cxx355
1 files changed, 189 insertions, 166 deletions
diff --git a/fluid/alignment_panel.cxx b/fluid/alignment_panel.cxx
index e4a9306e5..0f7c52b04 100644
--- a/fluid/alignment_panel.cxx
+++ b/fluid/alignment_panel.cxx
@@ -2,10 +2,10 @@
#include "alignment_panel.h"
-Fl_Window *alignment_window=(Fl_Window *)0;
+Fl_Window *project_window=(Fl_Window *)0;
static void cb_Close(Fl_Button*, void*) {
- alignment_window->hide();
+ project_window->hide();
}
Fl_Input *header_file_input=(Fl_Input *)0;
@@ -31,83 +31,79 @@ Fl_Input *i18n_set_input=(Fl_Input *)0;
Fl_Input *i18n_function_input=(Fl_Input *)0;
-Fl_Window* make_alignment_window() {
+Fl_Window* make_project_window() {
Fl_Window* w;
- { Fl_Window* o = alignment_window = new Fl_Window(365, 340, "Preferences");
+ { Fl_Window* o = project_window = new Fl_Window(365, 210, "Project Settings");
w = o;
- { Fl_Button* o = new Fl_Button(295, 305, 60, 25, "Close");
+ { Fl_Button* o = new Fl_Button(295, 175, 60, 25, "Close");
o->tooltip("Close this dialog.");
o->callback((Fl_Callback*)cb_Close);
}
- { Fl_Box* o = new Fl_Box(10, 175, 345, 120, "Output File Names:");
- o->box(FL_ENGRAVED_FRAME);
- o->labelsize(12);
- o->align(FL_ALIGN_TOP_LEFT);
- }
- { Fl_Box* o = new Fl_Box(20, 185, 325, 15, "Use \"name.ext\" to set name or just \".ext\" to set only extension.");
- o->labelsize(10);
- o->align(132|FL_ALIGN_INSIDE);
- }
- { Fl_Input* o = header_file_input = new Fl_Input(100, 205, 245, 20, "Header File:");
- o->tooltip("The name of the generated header file.");
- o->box(FL_THIN_DOWN_BOX);
- o->textfont(4);
- o->callback((Fl_Callback*)header_input_cb, (void*)(1));
- o->when(FL_WHEN_CHANGED);
- }
- { Fl_Input* o = code_file_input = new Fl_Input(100, 235, 245, 20, "Code File:");
- o->tooltip("The name of the generated code file.");
- o->box(FL_THIN_DOWN_BOX);
- o->textfont(4);
- o->callback((Fl_Callback*)code_input_cb, (void*)(1));
- o->when(FL_WHEN_CHANGED);
- }
- { Fl_Light_Button* o = include_H_from_C_button = new Fl_Light_Button(100, 265, 170, 20, "Include Header from Code");
- o->tooltip("Include the header file from the code file.");
- o->value(1);
- o->labelsize(12);
- o->callback((Fl_Callback*)include_H_from_C_button_cb);
- }
- { Fl_Box* o = new Fl_Box(10, 25, 345, 130, "Internationalization:");
- o->box(FL_ENGRAVED_FRAME);
- o->labelsize(12);
- o->align(FL_ALIGN_TOP_LEFT);
- }
- { Fl_Choice* o = i18n_type_chooser = new Fl_Choice(100, 35, 125, 20, "Use:");
- o->tooltip("Type of internationalization to use.");
- o->box(FL_THIN_UP_BOX);
- o->down_box(FL_BORDER_BOX);
- o->callback((Fl_Callback*)i18n_type_cb);
- o->menu(menu_i18n_type_chooser);
- }
- { Fl_Input* o = i18n_include_input = new Fl_Input(100, 65, 245, 20, "#include:");
- o->tooltip("The include file for internationalization.");
- o->box(FL_THIN_DOWN_BOX);
- o->textfont(4);
- o->callback((Fl_Callback*)i18n_text_cb);
- o->hide();
- }
- { Fl_Input* o = i18n_file_input = new Fl_Input(100, 95, 245, 20, "File:");
- o->tooltip("The name of the message catalog.");
- o->box(FL_THIN_DOWN_BOX);
- o->textfont(4);
- o->callback((Fl_Callback*)i18n_text_cb);
- o->hide();
- }
- { Fl_Input* o = i18n_set_input = new Fl_Input(100, 125, 245, 20, "Set:");
- o->tooltip("The message set number.");
- o->type(2);
- o->box(FL_THIN_DOWN_BOX);
- o->textfont(4);
- o->callback((Fl_Callback*)i18n_text_cb);
- o->hide();
- }
- { Fl_Input* o = i18n_function_input = new Fl_Input(100, 95, 245, 20, "Function:");
- o->tooltip("The function to call to internationalize the labels and tooltips.");
- o->box(FL_THIN_DOWN_BOX);
- o->textfont(4);
- o->callback((Fl_Callback*)i18n_text_cb);
- o->hide();
+ { Fl_Tabs* o = new Fl_Tabs(10, 10, 345, 155);
+ { Fl_Group* o = new Fl_Group(10, 35, 345, 130, "Output");
+ { Fl_Box* o = new Fl_Box(25, 45, 325, 15, "Use \"name.ext\" to set name or just \".ext\" to set only extension.");
+ o->labelsize(10);
+ o->align(132|FL_ALIGN_INSIDE);
+ }
+ { Fl_Input* o = header_file_input = new Fl_Input(105, 65, 245, 20, "Header File:");
+ o->tooltip("The name of the generated header file.");
+ o->box(FL_THIN_DOWN_BOX);
+ o->textfont(4);
+ o->callback((Fl_Callback*)header_input_cb, (void*)(1));
+ o->when(FL_WHEN_CHANGED);
+ }
+ { Fl_Input* o = code_file_input = new Fl_Input(105, 95, 245, 20, "Code File:");
+ o->tooltip("The name of the generated code file.");
+ o->box(FL_THIN_DOWN_BOX);
+ o->textfont(4);
+ o->callback((Fl_Callback*)code_input_cb, (void*)(1));
+ o->when(FL_WHEN_CHANGED);
+ }
+ { Fl_Light_Button* o = include_H_from_C_button = new Fl_Light_Button(105, 125, 170, 20, "Include Header from Code");
+ o->tooltip("Include the header file from the code file.");
+ o->value(1);
+ o->labelsize(12);
+ o->callback((Fl_Callback*)include_H_from_C_button_cb);
+ }
+ o->end();
+ }
+ { Fl_Group* o = new Fl_Group(10, 35, 345, 130, "Internationalization");
+ o->hide();
+ { Fl_Choice* o = i18n_type_chooser = new Fl_Choice(100, 45, 125, 20, "Use:");
+ o->tooltip("Type of internationalization to use.");
+ o->box(FL_THIN_UP_BOX);
+ o->down_box(FL_BORDER_BOX);
+ o->callback((Fl_Callback*)i18n_type_cb);
+ o->menu(menu_i18n_type_chooser);
+ }
+ { Fl_Input* o = i18n_include_input = new Fl_Input(100, 75, 245, 20, "#include:");
+ o->tooltip("The include file for internationalization.");
+ o->box(FL_THIN_DOWN_BOX);
+ o->textfont(4);
+ o->callback((Fl_Callback*)i18n_text_cb);
+ }
+ { Fl_Input* o = i18n_file_input = new Fl_Input(100, 105, 245, 20, "File:");
+ o->tooltip("The name of the message catalog.");
+ o->box(FL_THIN_DOWN_BOX);
+ o->textfont(4);
+ o->callback((Fl_Callback*)i18n_text_cb);
+ }
+ { Fl_Input* o = i18n_set_input = new Fl_Input(100, 135, 245, 20, "Set:");
+ o->tooltip("The message set number.");
+ o->type(2);
+ o->box(FL_THIN_DOWN_BOX);
+ o->textfont(4);
+ o->callback((Fl_Callback*)i18n_text_cb);
+ }
+ { Fl_Input* o = i18n_function_input = new Fl_Input(100, 105, 245, 20, "Function:");
+ o->tooltip("The function to call to internationalize the labels and tooltips.");
+ o->box(FL_THIN_DOWN_BOX);
+ o->textfont(4);
+ o->callback((Fl_Callback*)i18n_text_cb);
+ }
+ o->end();
+ }
+ o->end();
}
o->set_modal();
o->end();
@@ -121,12 +117,6 @@ static void cb_Close1(Fl_Button*, void*) {
settings_window->hide();
}
-Fl_Input *horizontal_input=(Fl_Input *)0;
-
-Fl_Input *vertical_input=(Fl_Input *)0;
-
-Fl_Input *snap_input=(Fl_Input *)0;
-
Fl_Check_Button *tooltips_button=(Fl_Check_Button *)0;
static void cb_tooltips_button(Fl_Check_Button*, void*) {
@@ -148,64 +138,40 @@ static void cb_openlast_button(Fl_Check_Button*, void*) {
Fl_Window* make_settings_window() {
Fl_Window* w;
- { Fl_Window* o = settings_window = new Fl_Window(400, 175, "Settings");
+ { Fl_Window* o = settings_window = new Fl_Window(255, 179, "GUI Settings");
w = o;
- { Fl_Button* o = new Fl_Button(330, 140, 60, 25, "Close");
+ { Fl_Button* o = new Fl_Button(185, 145, 60, 25, "Close");
o->tooltip("Close this dialog.");
o->callback((Fl_Callback*)cb_Close1);
}
- { Fl_Box* o = new Fl_Box(15, 30, 130, 100, "Grid:");
- o->box(FL_ENGRAVED_FRAME);
- o->labelsize(12);
- o->align(FL_ALIGN_TOP_LEFT);
- }
- { Fl_Input* o = horizontal_input = new Fl_Input(95, 40, 40, 20, "Horizontal:");
- o->tooltip("Horizontal grid spacing.");
- o->type(2);
- o->box(FL_THIN_DOWN_BOX);
- o->callback((Fl_Callback*)grid_cb, (void*)(1));
- o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
- }
- { Fl_Input* o = vertical_input = new Fl_Input(95, 70, 40, 20, "Vertical:");
- o->tooltip("Vertical grid spacing.");
- o->type(2);
- o->box(FL_THIN_DOWN_BOX);
- o->callback((Fl_Callback*)grid_cb, (void*)(2));
- o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
- }
- { Fl_Input* o = snap_input = new Fl_Input(95, 100, 40, 20, "Snap:");
- o->tooltip("Snap to grid within this many pixels.");
- o->type(2);
- o->box(FL_THIN_DOWN_BOX);
- o->callback((Fl_Callback*)grid_cb, (void*)(3));
- o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
- }
- { Fl_Box* o = new Fl_Box(155, 30, 235, 100, "GUI:");
- o->box(FL_ENGRAVED_FRAME);
- o->labelsize(12);
- o->align(FL_ALIGN_TOP_LEFT);
- }
- { Fl_Check_Button* o = tooltips_button = new Fl_Check_Button(165, 40, 215, 20, "Show Tooltips");
- o->down_box(FL_DOWN_BOX);
- o->callback((Fl_Callback*)cb_tooltips_button);
- char b;
- fluid_prefs.get("show_tooltips", b, 1);
- tooltips_button->value(b);
- Fl_Tooltip::enable(b);
- }
- { Fl_Check_Button* o = completion_button = new Fl_Check_Button(165, 70, 215, 20, "Show Completion Dialogs");
- o->down_box(FL_DOWN_BOX);
- o->callback((Fl_Callback*)cb_completion_button);
- char b;
- fluid_prefs.get("show_completion_dialogs", b, 1);
- completion_button->value(b);
- }
- { Fl_Check_Button* o = openlast_button = new Fl_Check_Button(165, 100, 215, 20, "Open Previous File on Startup");
- o->down_box(FL_DOWN_BOX);
- o->callback((Fl_Callback*)cb_openlast_button);
- char b;
- fluid_prefs.get("open_previous_file", b, 0);
- openlast_button->value(b);
+ { Fl_Tabs* o = new Fl_Tabs(10, 10, 235, 125);
+ { Fl_Group* o = new Fl_Group(10, 35, 235, 100, "GUI:");
+ o->align(FL_ALIGN_TOP_LEFT);
+ { Fl_Check_Button* o = tooltips_button = new Fl_Check_Button(20, 45, 215, 20, "Show Tooltips");
+ o->down_box(FL_DOWN_BOX);
+ o->callback((Fl_Callback*)cb_tooltips_button);
+ char b;
+ fluid_prefs.get("show_tooltips", b, 1);
+ tooltips_button->value(b);
+ Fl_Tooltip::enable(b);
+ }
+ { Fl_Check_Button* o = completion_button = new Fl_Check_Button(20, 75, 215, 20, "Show Completion Dialogs");
+ o->down_box(FL_DOWN_BOX);
+ o->callback((Fl_Callback*)cb_completion_button);
+ char b;
+ fluid_prefs.get("show_completion_dialogs", b, 1);
+ completion_button->value(b);
+ }
+ { Fl_Check_Button* o = openlast_button = new Fl_Check_Button(20, 105, 215, 20, "Open Previous File on Startup");
+ o->down_box(FL_DOWN_BOX);
+ o->callback((Fl_Callback*)cb_openlast_button);
+ char b;
+ fluid_prefs.get("open_previous_file", b, 0);
+ openlast_button->value(b);
+ }
+ o->end();
+ }
+ o->end();
}
o->end();
}
@@ -254,48 +220,51 @@ static void cb_shell_run_button(Fl_Return_Button*, void*) {
Fl_Window* make_shell_window() {
Fl_Window* w;
- { Fl_Window* o = shell_window = new Fl_Window(445, 104, "Shell Command");
+ { Fl_Window* o = shell_window = new Fl_Window(450, 145, "Shell Command");
w = o;
- { Fl_Input* o = shell_command_input = new Fl_Input(85, 10, 350, 20, "Command:");
- o->callback((Fl_Callback*)cb_shell_command_input);
- char buf[1024];
- fluid_prefs.get("shell_command", buf, "", sizeof(buf));
- shell_command_input->value(buf);
- }
- { Fl_Group* o = new Fl_Group(85, 40, 350, 20, "Options:");
- o->align(FL_ALIGN_LEFT);
- { Fl_Check_Button* o = shell_savefl_button = new Fl_Check_Button(85, 40, 110, 20, "Save .FL File");
- o->down_box(FL_DOWN_BOX);
- o->callback((Fl_Callback*)cb_shell_savefl_button);
- char b;
- fluid_prefs.get("shell_savefl", b, 1);
- shell_savefl_button->value(b);
- }
- { Fl_Check_Button* o = shell_writecode_button = new Fl_Check_Button(200, 40, 95, 20, "Write Code");
- o->down_box(FL_DOWN_BOX);
- o->callback((Fl_Callback*)cb_shell_writecode_button);
- char b;
- fluid_prefs.get("shell_writecode", b, 1);
- shell_writecode_button->value(b);
- }
- { Fl_Check_Button* o = shell_writemsgs_button = new Fl_Check_Button(300, 40, 125, 20, "Write Messages");
- o->down_box(FL_DOWN_BOX);
- o->callback((Fl_Callback*)cb_shell_writemsgs_button);
- char b;
- fluid_prefs.get("shell_writemsgs", b, 0);
- shell_writemsgs_button->value(b);
+ { Fl_Tabs* o = new Fl_Tabs(10, 10, 430, 90);
+ { Fl_Group* o = new Fl_Group(10, 30, 430, 70, "Shell Command");
+ o->align(FL_ALIGN_TOP_LEFT);
+ { Fl_Input* o = shell_command_input = new Fl_Input(20, 40, 410, 20);
+ o->callback((Fl_Callback*)cb_shell_command_input);
+ char buf[1024];
+ fluid_prefs.get("shell_command", buf, "", sizeof(buf));
+ shell_command_input->value(buf);
+ }
+ { Fl_Check_Button* o = shell_savefl_button = new Fl_Check_Button(20, 65, 110, 20, "Save .FL File");
+ o->down_box(FL_DOWN_BOX);
+ o->callback((Fl_Callback*)cb_shell_savefl_button);
+ char b;
+ fluid_prefs.get("shell_savefl", b, 1);
+ shell_savefl_button->value(b);
+ }
+ { Fl_Check_Button* o = shell_writecode_button = new Fl_Check_Button(140, 65, 95, 20, "Write Code");
+ o->down_box(FL_DOWN_BOX);
+ o->callback((Fl_Callback*)cb_shell_writecode_button);
+ char b;
+ fluid_prefs.get("shell_writecode", b, 1);
+ shell_writecode_button->value(b);
+ }
+ { Fl_Check_Button* o = shell_writemsgs_button = new Fl_Check_Button(245, 65, 130, 20, "Write Messages");
+ o->down_box(FL_DOWN_BOX);
+ o->callback((Fl_Callback*)cb_shell_writemsgs_button);
+ char b;
+ fluid_prefs.get("shell_writemsgs", b, 0);
+ shell_writemsgs_button->value(b);
+ }
+ o->end();
}
o->end();
}
- { Fl_Button* o = new Fl_Button(370, 70, 65, 25, "Cancel");
+ { Fl_Button* o = new Fl_Button(375, 110, 65, 25, "Cancel");
o->callback((Fl_Callback*)cb_Cancel);
}
- { Fl_Return_Button* o = new Fl_Return_Button(220, 70, 140, 25, "Run Command");
+ { Fl_Return_Button* o = new Fl_Return_Button(225, 110, 140, 25, "Run Command");
o->callback((Fl_Callback*)do_shell_command);
}
o->end();
}
- { Fl_Window* o = shell_run_window = new Fl_Window(553, 435, "Shell Command Output");
+ { Fl_Window* o = shell_run_window = new Fl_Window(555, 435, "Shell Command Output");
w = o;
{ Fl_Browser* o = shell_run_list = new Fl_Browser(10, 10, 535, 380);
o->textfont(4);
@@ -309,3 +278,57 @@ Fl_Window* make_shell_window() {
}
return w;
}
+
+Fl_Window *grid_window=(Fl_Window *)0;
+
+Fl_Input *horizontal_input=(Fl_Input *)0;
+
+Fl_Input *vertical_input=(Fl_Input *)0;
+
+Fl_Input *snap_input=(Fl_Input *)0;
+
+static void cb_Close2(Fl_Button*, void*) {
+ grid_window->hide();
+}
+
+Fl_Window* make_grid_window() {
+ Fl_Window* w;
+ { Fl_Window* o = grid_window = new Fl_Window(155, 175, "Grid");
+ w = o;
+ { Fl_Tabs* o = new Fl_Tabs(10, 10, 135, 120);
+ o->align(FL_ALIGN_TOP_LEFT);
+ { Fl_Group* o = new Fl_Group(10, 30, 135, 100, "Grid");
+ o->align(FL_ALIGN_TOP_LEFT);
+ { Fl_Input* o = horizontal_input = new Fl_Input(95, 40, 40, 20, "Horizontal:");
+ o->tooltip("Horizontal grid spacing.");
+ o->type(2);
+ o->box(FL_THIN_DOWN_BOX);
+ o->callback((Fl_Callback*)grid_cb, (void*)(1));
+ o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
+ }
+ { Fl_Input* o = vertical_input = new Fl_Input(95, 70, 40, 20, "Vertical:");
+ o->tooltip("Vertical grid spacing.");
+ o->type(2);
+ o->box(FL_THIN_DOWN_BOX);
+ o->callback((Fl_Callback*)grid_cb, (void*)(2));
+ o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
+ }
+ { Fl_Input* o = snap_input = new Fl_Input(95, 100, 40, 20, "Snap:");
+ o->tooltip("Snap to grid within this many pixels.");
+ o->type(2);
+ o->box(FL_THIN_DOWN_BOX);
+ o->callback((Fl_Callback*)grid_cb, (void*)(3));
+ o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
+ }
+ o->end();
+ }
+ o->end();
+ }
+ { Fl_Button* o = new Fl_Button(85, 140, 60, 25, "Close");
+ o->tooltip("Close this dialog.");
+ o->callback((Fl_Callback*)cb_Close2);
+ }
+ o->end();
+ }
+ return w;
+}