summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-01-21 17:14:41 +0100
committerGitHub <noreply@github.com>2023-01-21 17:14:41 +0100
commit1fc269b0d4c79b256cc57740d318f95dded8c340 (patch)
tree5df94f8cb7f4e8629dbce7a36f070ea5b513d5d7 /fluid
parent4ddcbc81de60faa0e9922db7df316f3d69cb8df7 (diff)
Move global FLTK options into new app fltk-admin (#560)
Diffstat (limited to 'fluid')
-rw-r--r--fluid/Fl_Window_Type.cxx5
-rw-r--r--fluid/Fl_Window_Type.h1
-rw-r--r--fluid/alignment_panel.cxx380
-rw-r--r--fluid/alignment_panel.fl392
-rw-r--r--fluid/alignment_panel.h21
-rw-r--r--fluid/fluid.cxx4
6 files changed, 3 insertions, 800 deletions
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx
index f070f31df..f21e3a210 100644
--- a/fluid/Fl_Window_Type.cxx
+++ b/fluid/Fl_Window_Type.cxx
@@ -257,11 +257,6 @@ void show_settings_cb(Fl_Widget *, void *) {
settings_window->show();
}
-void show_global_settings_cb(Fl_Widget *, void *) {
- global_settings_window->hotspot(global_settings_window);
- show_global_settings_window();
-}
-
void header_input_cb(Fl_Input* i, void*) {
if (strcmp(g_project.header_file_name, i->value()))
set_modflag(1);
diff --git a/fluid/Fl_Window_Type.h b/fluid/Fl_Window_Type.h
index 05af32dc1..4e4ac8a48 100644
--- a/fluid/Fl_Window_Type.h
+++ b/fluid/Fl_Window_Type.h
@@ -31,7 +31,6 @@ void toggle_overlays(Fl_Widget *,void *);
void show_project_cb(Fl_Widget *, void *);
void show_grid_cb(Fl_Widget *, void *);
void show_settings_cb(Fl_Widget *, void *);
-void show_global_settings_cb(Fl_Widget *, void *);
class Fl_Window_Type : public Fl_Widget_Type {
protected:
diff --git a/fluid/alignment_panel.cxx b/fluid/alignment_panel.cxx
index dfe69d114..81b2cc454 100644
--- a/fluid/alignment_panel.cxx
+++ b/fluid/alignment_panel.cxx
@@ -610,383 +610,3 @@ Fl_Double_Window* make_layout_window() {
} // Fl_Double_Window* grid_window
return grid_window;
}
-/**
- Copy of all options in user and system mode
-*/
-static int opt[10][2];
-
-/**
- Update the UI using the values in the opt array
-*/
-static void refreshUI() {
- int mode = wUserOrSystem->value();
- wVisibleFocus->value(opt[Fl::OPTION_VISIBLE_FOCUS][mode]);
- wArrowFocus->value(opt[Fl::OPTION_ARROW_FOCUS][mode]);
- wShowTooltips->value(opt[Fl::OPTION_SHOW_TOOLTIPS][mode]);
- wDNDText->value(opt[Fl::OPTION_DND_TEXT][mode]);
- wGTKText->value(opt[Fl::OPTION_FNFC_USES_GTK][mode]);
- wPrintGTKText->value(opt[Fl::OPTION_PRINTER_USES_GTK][mode]);
- wShowZoomFactor->value(opt[Fl::OPTION_SHOW_SCALING][mode]);
- wUseZenity->value(opt[Fl::OPTION_FNFC_USES_ZENITY][mode]);
-}
-
-/**
- read all preferences and refresh the GUI
-*/
-static void readPrefs() {
- // read all preferences and refresh the GUI
- {
- Fl_Preferences prefs(Fl_Preferences::SYSTEM_L, "fltk.org", "fltk");
- Fl_Preferences opt_prefs(prefs, "options");
- opt_prefs.get("ArrowFocus", opt[Fl::OPTION_ARROW_FOCUS][1], 2);
- opt_prefs.get("VisibleFocus", opt[Fl::OPTION_VISIBLE_FOCUS][1], 2);
- opt_prefs.get("DNDText", opt[Fl::OPTION_DND_TEXT][1], 2);
- opt_prefs.get("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][1], 2);
- opt_prefs.get("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK ][1], 2);
- opt_prefs.get("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK ][1], 2);
- opt_prefs.get("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING ][1], 2);
- opt_prefs.get("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY ][1], 2);
- }
- {
- Fl_Preferences prefs(Fl_Preferences::USER_L, "fltk.org", "fltk");
- Fl_Preferences opt_prefs(prefs, "options");
- opt_prefs.get("ArrowFocus", opt[Fl::OPTION_ARROW_FOCUS][0], 2);
- opt_prefs.get("VisibleFocus", opt[Fl::OPTION_VISIBLE_FOCUS][0], 2);
- opt_prefs.get("DNDText", opt[Fl::OPTION_DND_TEXT][0], 2);
- opt_prefs.get("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][0], 2);
- opt_prefs.get("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK ][0], 2);
- opt_prefs.get("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK ][0], 2);
- opt_prefs.get("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING ][0], 2);
- opt_prefs.get("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY ][0], 2);
- }
- refreshUI();
-}
-
-/**
- write all preferences using the array
-*/
-static void writePrefs() {
- // write all preferences using the array
- {
- Fl_Preferences prefs(Fl_Preferences::SYSTEM_L, "fltk.org", "fltk");
- Fl_Preferences opt_prefs(prefs, "options");
- if (opt[Fl::OPTION_ARROW_FOCUS][1]==2) opt_prefs.deleteEntry("ArrowFocus");
- else opt_prefs.set("ArrowFocus", opt[Fl::OPTION_ARROW_FOCUS][1]);
- if (opt[Fl::OPTION_VISIBLE_FOCUS][1]==2) opt_prefs.deleteEntry("VisibleFocus");
- else opt_prefs.set("VisibleFocus", opt[Fl::OPTION_VISIBLE_FOCUS][1]);
- if (opt[Fl::OPTION_DND_TEXT][1]==2) opt_prefs.deleteEntry("DNDText");
- else opt_prefs.set("DNDText", opt[Fl::OPTION_DND_TEXT][1]);
- if (opt[Fl::OPTION_SHOW_TOOLTIPS][1]==2) opt_prefs.deleteEntry("ShowTooltips");
- else opt_prefs.set("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][1]);
- if (opt[Fl::OPTION_FNFC_USES_GTK][1]==2) opt_prefs.deleteEntry("FNFCUsesGTK");
- else opt_prefs.set("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK][1]);
- if (opt[Fl::OPTION_PRINTER_USES_GTK][1]==2) opt_prefs.deleteEntry("PrintUsesGTK");
- else opt_prefs.set("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK][1]);
- if (opt[Fl::OPTION_SHOW_SCALING][1]==2) opt_prefs.deleteEntry("ShowZoomFactor");
- else opt_prefs.set("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING][1]);
- if (opt[Fl::OPTION_FNFC_USES_ZENITY][1]==2) opt_prefs.deleteEntry("UseZenity");
- else opt_prefs.set("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY][1]);
- }
- {
- Fl_Preferences prefs(Fl_Preferences::USER_L, "fltk.org", "fltk");
- Fl_Preferences opt_prefs(prefs, "options");
- if (opt[Fl::OPTION_ARROW_FOCUS][0]==2) opt_prefs.deleteEntry("ArrowFocus");
- else opt_prefs.set("ArrowFocus", opt[Fl::OPTION_ARROW_FOCUS][0]);
- if (opt[Fl::OPTION_VISIBLE_FOCUS][0]==2) opt_prefs.deleteEntry("VisibleFocus");
- else opt_prefs.set("VisibleFocus", opt[Fl::OPTION_VISIBLE_FOCUS][0]);
- if (opt[Fl::OPTION_DND_TEXT][0]==2) opt_prefs.deleteEntry("DNDText");
- else opt_prefs.set("DNDText", opt[Fl::OPTION_DND_TEXT][0]);
- if (opt[Fl::OPTION_SHOW_TOOLTIPS][0]==2) opt_prefs.deleteEntry("ShowTooltips");
- else opt_prefs.set("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][0]);
- if (opt[Fl::OPTION_FNFC_USES_GTK][0]==2) opt_prefs.deleteEntry("FNFCUsesGTK");
- else opt_prefs.set("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK][0]);
- if (opt[Fl::OPTION_PRINTER_USES_GTK][0]==2) opt_prefs.deleteEntry("PrintUsesGTK");
- else opt_prefs.set("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK][0]);
- if (opt[Fl::OPTION_SHOW_SCALING][0]==2) opt_prefs.deleteEntry("ShowZoomFactor");
- else opt_prefs.set("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING][0]);
- if (opt[Fl::OPTION_FNFC_USES_ZENITY][0]==2) opt_prefs.deleteEntry("UseZenity");
- else opt_prefs.set("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY][0]);
- }
-}
-
-void show_global_settings_window() {
- if (!global_settings_window)
- make_global_settings_window();
- readPrefs();
- refreshUI();
- fl_message(
- "WARNING!\n\n"
- "The following dialog changes the user interface behavior\n"
- "of ALL FLTK applications, for the current user, or for \n"
- "ALL users on this machine.\n\n"
- "Please choose these settings carefully, or reset\n"
- "user and system settings to \"default\".");
- global_settings_window->show();
-}
-
-Fl_Double_Window *global_settings_window=(Fl_Double_Window *)0;
-
-Fl_Choice *wVisibleFocus=(Fl_Choice *)0;
-
-static void cb_wVisibleFocus(Fl_Choice*, void*) {
- int mode = wUserOrSystem->value();
- opt[Fl::OPTION_VISIBLE_FOCUS][mode] = wVisibleFocus->value();
-}
-
-Fl_Menu_Item menu_wVisibleFocus[] = {
- {"off", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"on", 0, 0, (void*)(1), 128, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"default", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-Fl_Choice *wArrowFocus=(Fl_Choice *)0;
-
-static void cb_wArrowFocus(Fl_Choice*, void*) {
- int mode = wUserOrSystem->value();
- opt[Fl::OPTION_ARROW_FOCUS][mode] = wArrowFocus->value();
-}
-
-Fl_Menu_Item menu_wArrowFocus[] = {
- {"off", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"on", 0, 0, (void*)(1), 128, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"default", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-Fl_Choice *wShowTooltips=(Fl_Choice *)0;
-
-static void cb_wShowTooltips(Fl_Choice*, void*) {
- int mode = wUserOrSystem->value();
- opt[Fl::OPTION_SHOW_TOOLTIPS][mode] = wShowTooltips->value();
-}
-
-Fl_Menu_Item menu_wShowTooltips[] = {
- {"off", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"on", 0, 0, (void*)(1), 128, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"default", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-Fl_Choice *wDNDText=(Fl_Choice *)0;
-
-static void cb_wDNDText(Fl_Choice*, void*) {
- int mode = wUserOrSystem->value();
- opt[Fl::OPTION_DND_TEXT][mode] = wDNDText->value();
-}
-
-Fl_Menu_Item menu_wDNDText[] = {
- {"off", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"on", 0, 0, (void*)(1), 128, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"default", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-Fl_Choice *wGTKText=(Fl_Choice *)0;
-
-static void cb_wGTKText(Fl_Choice*, void*) {
- int mode = wUserOrSystem->value();
- opt[Fl::OPTION_FNFC_USES_GTK ][mode] = wGTKText->value();
-}
-
-Fl_Menu_Item menu_wGTKText[] = {
- {"off", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"on", 0, 0, (void*)(1), 128, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"default", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-Fl_Choice *wUseZenity=(Fl_Choice *)0;
-
-static void cb_wUseZenity(Fl_Choice*, void*) {
- int mode = wUserOrSystem->value();
- opt[Fl::OPTION_FNFC_USES_ZENITY ][mode] = wUseZenity->value();
-}
-
-Fl_Menu_Item menu_wUseZenity[] = {
- {"off", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"on", 0, 0, (void*)(1), 128, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"default", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-Fl_Choice *wPrintGTKText=(Fl_Choice *)0;
-
-static void cb_wPrintGTKText(Fl_Choice*, void*) {
- int mode = wUserOrSystem->value();
- opt[Fl::OPTION_PRINTER_USES_GTK ][mode] = wPrintGTKText->value();
-}
-
-Fl_Menu_Item menu_wPrintGTKText[] = {
- {"off", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"on", 0, 0, (void*)(1), 128, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"default", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-Fl_Choice *wShowZoomFactor=(Fl_Choice *)0;
-
-static void cb_wShowZoomFactor(Fl_Choice*, void*) {
- int mode = wUserOrSystem->value();
- opt[Fl::OPTION_SHOW_SCALING ][mode] = wShowZoomFactor->value();
-}
-
-Fl_Menu_Item menu_wShowZoomFactor[] = {
- {"off", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"on", 0, 0, (void*)(1), 128, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"default", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-Fl_Choice *wUserOrSystem=(Fl_Choice *)0;
-
-static void cb_wUserOrSystem(Fl_Choice*, void*) {
- refreshUI();
-}
-
-Fl_Menu_Item menu_wUserOrSystem[] = {
- {"User Settings", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {"System Settings", 0, 0, (void*)(1), 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-static void cb_Cancel1(Fl_Button*, void*) {
- global_settings_window->hide();
-}
-
-static void cb_OK(Fl_Button*, void*) {
- writePrefs();
- global_settings_window->hide();
-}
-
-Fl_Double_Window* make_global_settings_window() {
- { global_settings_window = new Fl_Double_Window(400, 572, "FLTK Preferences");
- global_settings_window->color(FL_LIGHT1);
- { Fl_Group* o = new Fl_Group(10, 10, 380, 100, "Keyboard Focus Options");
- o->box(FL_GTK_DOWN_BOX);
- o->labelfont(2);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
- { wVisibleFocus = new Fl_Choice(245, 40, 100, 25, "Visible Keyboard Focus:");
- wVisibleFocus->tooltip("OPTION_VISIBLE_FOCUS\n\nIf visible focus is switched on, FLTK will draw a dot\
-ted rectangle inside the widget that will receive the next keystroke. If switc\
-hed off, no such indicator will be drawn and keyboard navigation is disabled.\
-\n\nDefault is on.");
- wVisibleFocus->down_box(FL_BORDER_BOX);
- wVisibleFocus->callback((Fl_Callback*)cb_wVisibleFocus);
- wVisibleFocus->menu(menu_wVisibleFocus);
- } // Fl_Choice* wVisibleFocus
- { wArrowFocus = new Fl_Choice(245, 75, 100, 25, "Arrow Keys move Focus:");
- wArrowFocus->tooltip("OPTION_ARROW_FOCUS\n\nWhen switched on, moving the text cursor beyond the sta\
-rt or end of the text in a text widget will change focus to the next widget. W\
-hen switched off, the cursor will stop at the end of the text. Pressing Tab or\
- Ctrl-Tab will advance the keyboard focus. Switch this on, if you want the old\
- behavior of FLTK 1.1.\n\nDefault is off.");
- wArrowFocus->down_box(FL_BORDER_BOX);
- wArrowFocus->callback((Fl_Callback*)cb_wArrowFocus);
- wArrowFocus->menu(menu_wArrowFocus);
- } // Fl_Choice* wArrowFocus
- o->end();
- } // Fl_Group* o
- { Fl_Group* o = new Fl_Group(10, 120, 380, 65, "Tooltip Options");
- o->box(FL_GTK_DOWN_BOX);
- o->labelfont(2);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
- { wShowTooltips = new Fl_Choice(245, 150, 100, 25, "Show Tooltips:");
- wShowTooltips->tooltip("OPTION_SHOW_TOOLTIPS\n\nIf tooltips are enabled, hovering the mouse over a wi\
-dget with a tooltip text will open a little tooltip window until the mouse lea\
-ves the widget. If disabled, no tooltip is shown.\n\nDefault is on.");
- wShowTooltips->down_box(FL_BORDER_BOX);
- wShowTooltips->callback((Fl_Callback*)cb_wShowTooltips);
- wShowTooltips->menu(menu_wShowTooltips);
- } // Fl_Choice* wShowTooltips
- o->end();
- } // Fl_Group* o
- { Fl_Group* o = new Fl_Group(10, 194, 380, 66, "Drag And Drop Options");
- o->box(FL_GTK_DOWN_BOX);
- o->labelfont(2);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
- { wDNDText = new Fl_Choice(245, 225, 100, 25, "Allow dragging Text:");
- wDNDText->tooltip("OPTION_DND_TEXT\n\nIf text drag-and-drop is enabled, the user can select and \
-drag text from any text widget. If disabled, no dragging is possible, however \
-dropping text from other applications still works.\n\nDefault is on.");
- wDNDText->down_box(FL_BORDER_BOX);
- wDNDText->callback((Fl_Callback*)cb_wDNDText);
- wDNDText->menu(menu_wDNDText);
- } // Fl_Choice* wDNDText
- o->end();
- } // Fl_Group* o
- { Fl_Group* o = new Fl_Group(10, 269, 380, 104, "Native File Chooser Options");
- o->box(FL_GTK_DOWN_BOX);
- o->labelfont(2);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
- { wGTKText = new Fl_Choice(245, 300, 100, 25, "Native File Chooser uses GTK:");
- wGTKText->tooltip("OPTION_FNFC_USES_GTK\n\nIf \'Native File Chooser uses GTK\' is enabled, the F\
-l_Native_File_Chooser class\ncalls the GTK open/save file dialogs when they ar\
-e available on the platfom. If disabled, the Fl_Native_File_Chooser class\nalw\
-ays uses FLTK\'s own file dialog (i.e., Fl_File_Chooser) even if GTK is availa\
-ble.\n\nDefault is on.");
- wGTKText->down_box(FL_BORDER_BOX);
- wGTKText->callback((Fl_Callback*)cb_wGTKText);
- wGTKText->menu(menu_wGTKText);
- } // Fl_Choice* wGTKText
- { wUseZenity = new Fl_Choice(245, 334, 100, 26, "Native File Chooser uses Zenity:");
- wUseZenity->tooltip("OPTION_FNFC_USES_ZENITY\n\nIf \'Native File Chooser uses Zenity\' is enabled,\
- the library uses a Zenity-based file dialog to open/save files when possible.\
- If disabled, the GTK-based dialog is used. Default is on. Meaningful only wit\
-h Wayland/X11 platforms.");
- wUseZenity->down_box(FL_BORDER_BOX);
- wUseZenity->callback((Fl_Callback*)cb_wUseZenity);
- wUseZenity->menu(menu_wUseZenity);
- } // Fl_Choice* wUseZenity
- o->end();
- } // Fl_Group* o
- { Fl_Group* o = new Fl_Group(10, 384, 380, 66, "Print dialog Options");
- o->box(FL_GTK_DOWN_BOX);
- o->labelfont(2);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
- { wPrintGTKText = new Fl_Choice(245, 405, 100, 25, "Print dialog uses GTK:");
- wPrintGTKText->tooltip("OPTION_PRINTER_USES_GTK\n\nIf \'Print dialog uses GTK\' is enabled, the Fl_Pr\
-inter class\ncalls the GTK print dialog when it\'s available on the platfom. I\
-f disabled, the Fl_Printer class\nalways uses FLTK\'s own print dialog even if\
- GTK is available.\n\nDefault is on.");
- wPrintGTKText->down_box(FL_BORDER_BOX);
- wPrintGTKText->callback((Fl_Callback*)cb_wPrintGTKText);
- wPrintGTKText->menu(menu_wPrintGTKText);
- } // Fl_Choice* wPrintGTKText
- o->end();
- } // Fl_Group* o
- { Fl_Group* o = new Fl_Group(10, 459, 380, 66, "Scaling Factor Options");
- o->box(FL_GTK_DOWN_BOX);
- o->labelfont(2);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
- { wShowZoomFactor = new Fl_Choice(245, 483, 100, 25, "Transiently show scaling factor:");
- wShowZoomFactor->tooltip("OPTION_SHOW_SCALING\n\nIf \'Transiently show scaling factor\' is enabled, the\
- library shows in a transient yellow window the display\nscaling factor value \
-when it is changed. If disabled, no such transient window is used.\n\nDefault \
-is on.");
- wShowZoomFactor->down_box(FL_BORDER_BOX);
- wShowZoomFactor->callback((Fl_Callback*)cb_wShowZoomFactor);
- wShowZoomFactor->menu(menu_wShowZoomFactor);
- } // Fl_Choice* wShowZoomFactor
- o->end();
- } // Fl_Group* o
- { wUserOrSystem = new Fl_Choice(10, 535, 141, 25);
- wUserOrSystem->tooltip("Change settings for the current user, or default values for all users of this\
- computer. Individual users can override system options, if they set their opt\
-ions to specific values (not \'default\').");
- wUserOrSystem->down_box(FL_BORDER_BOX);
- wUserOrSystem->callback((Fl_Callback*)cb_wUserOrSystem);
- wUserOrSystem->menu(menu_wUserOrSystem);
- } // Fl_Choice* wUserOrSystem
- { Fl_Button* o = new Fl_Button(230, 535, 75, 25, "Cancel");
- o->callback((Fl_Callback*)cb_Cancel1);
- } // Fl_Button* o
- { Fl_Button* o = new Fl_Button(315, 535, 75, 25, "OK");
- o->callback((Fl_Callback*)cb_OK);
- } // Fl_Button* o
- global_settings_window->end();
- } // Fl_Double_Window* global_settings_window
- readPrefs();
- Fl::option(Fl::OPTION_SHOW_TOOLTIPS,1); // make sure tooltips are on !
- return global_settings_window;
-}
diff --git a/fluid/alignment_panel.fl b/fluid/alignment_panel.fl
index 4525704ed..96d37ddcf 100644
--- a/fluid/alignment_panel.fl
+++ b/fluid/alignment_panel.fl
@@ -59,7 +59,7 @@ decl {extern struct Fl_Menu_Item *dbmanager_item;} {public local
Function {make_project_window()} {} {
Fl_Window project_window {
- label {Project Settings} open
+ label {Project Settings}
xywh {472 246 399 298} type Double hide
code0 {\#include <FL/Fl_Preferences.H>}
code1 {\#include <FL/Fl_Tooltip.H>} modal
@@ -291,7 +291,7 @@ Examples:
Function {make_shell_window()} {open
} {
Fl_Window shell_window {
- label {Shell Command} open
+ label {Shell Command}
xywh {544 751 365 200} type Double hide modal size_range {365 200 365 200}
} {
Fl_Group {} {open
@@ -488,391 +488,3 @@ Function {make_layout_window()} {open
}
}
}
-
-decl {int opt[10][2];} {
- comment {Copy of all options in user and system mode} private local
-}
-
-Function {refreshUI()} {
- comment {Update the UI using the values in the opt array} private return_type void
-} {
- code {int mode = wUserOrSystem->value();
-wVisibleFocus->value(opt[Fl::OPTION_VISIBLE_FOCUS][mode]);
-wArrowFocus->value(opt[Fl::OPTION_ARROW_FOCUS][mode]);
-wShowTooltips->value(opt[Fl::OPTION_SHOW_TOOLTIPS][mode]);
-wDNDText->value(opt[Fl::OPTION_DND_TEXT][mode]);
-wGTKText->value(opt[Fl::OPTION_FNFC_USES_GTK][mode]);
-wPrintGTKText->value(opt[Fl::OPTION_PRINTER_USES_GTK][mode]);
-wShowZoomFactor->value(opt[Fl::OPTION_SHOW_SCALING][mode]);
-wUseZenity->value(opt[Fl::OPTION_FNFC_USES_ZENITY][mode]);} {}
-}
-
-Function {readPrefs()} {
- comment {read all preferences and refresh the GUI} open private return_type void
-} {
- code {// read all preferences and refresh the GUI
-{
- Fl_Preferences prefs(Fl_Preferences::SYSTEM_L, "fltk.org", "fltk");
- Fl_Preferences opt_prefs(prefs, "options");
- opt_prefs.get("ArrowFocus", opt[Fl::OPTION_ARROW_FOCUS][1], 2);
- opt_prefs.get("VisibleFocus", opt[Fl::OPTION_VISIBLE_FOCUS][1], 2);
- opt_prefs.get("DNDText", opt[Fl::OPTION_DND_TEXT][1], 2);
- opt_prefs.get("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][1], 2);
- opt_prefs.get("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK ][1], 2);
- opt_prefs.get("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK ][1], 2);
- opt_prefs.get("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING ][1], 2);
- opt_prefs.get("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY ][1], 2);
-}
-{
- Fl_Preferences prefs(Fl_Preferences::USER_L, "fltk.org", "fltk");
- Fl_Preferences opt_prefs(prefs, "options");
- opt_prefs.get("ArrowFocus", opt[Fl::OPTION_ARROW_FOCUS][0], 2);
- opt_prefs.get("VisibleFocus", opt[Fl::OPTION_VISIBLE_FOCUS][0], 2);
- opt_prefs.get("DNDText", opt[Fl::OPTION_DND_TEXT][0], 2);
- opt_prefs.get("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][0], 2);
- opt_prefs.get("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK ][0], 2);
- opt_prefs.get("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK ][0], 2);
- opt_prefs.get("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING ][0], 2);
- opt_prefs.get("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY ][0], 2);
-}
-refreshUI();} {}
-}
-
-Function {writePrefs()} {
- comment {write all preferences using the array} open private return_type void
-} {
- code {// write all preferences using the array
-{
- Fl_Preferences prefs(Fl_Preferences::SYSTEM_L, "fltk.org", "fltk");
- Fl_Preferences opt_prefs(prefs, "options");
- if (opt[Fl::OPTION_ARROW_FOCUS][1]==2) opt_prefs.deleteEntry("ArrowFocus");
- else opt_prefs.set("ArrowFocus", opt[Fl::OPTION_ARROW_FOCUS][1]);
- if (opt[Fl::OPTION_VISIBLE_FOCUS][1]==2) opt_prefs.deleteEntry("VisibleFocus");
- else opt_prefs.set("VisibleFocus", opt[Fl::OPTION_VISIBLE_FOCUS][1]);
- if (opt[Fl::OPTION_DND_TEXT][1]==2) opt_prefs.deleteEntry("DNDText");
- else opt_prefs.set("DNDText", opt[Fl::OPTION_DND_TEXT][1]);
- if (opt[Fl::OPTION_SHOW_TOOLTIPS][1]==2) opt_prefs.deleteEntry("ShowTooltips");
- else opt_prefs.set("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][1]);
- if (opt[Fl::OPTION_FNFC_USES_GTK][1]==2) opt_prefs.deleteEntry("FNFCUsesGTK");
- else opt_prefs.set("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK][1]);
- if (opt[Fl::OPTION_PRINTER_USES_GTK][1]==2) opt_prefs.deleteEntry("PrintUsesGTK");
- else opt_prefs.set("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK][1]);
- if (opt[Fl::OPTION_SHOW_SCALING][1]==2) opt_prefs.deleteEntry("ShowZoomFactor");
- else opt_prefs.set("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING][1]);
- if (opt[Fl::OPTION_FNFC_USES_ZENITY][1]==2) opt_prefs.deleteEntry("UseZenity");
- else opt_prefs.set("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY][1]);
-}
-{
- Fl_Preferences prefs(Fl_Preferences::USER_L, "fltk.org", "fltk");
- Fl_Preferences opt_prefs(prefs, "options");
- if (opt[Fl::OPTION_ARROW_FOCUS][0]==2) opt_prefs.deleteEntry("ArrowFocus");
- else opt_prefs.set("ArrowFocus", opt[Fl::OPTION_ARROW_FOCUS][0]);
- if (opt[Fl::OPTION_VISIBLE_FOCUS][0]==2) opt_prefs.deleteEntry("VisibleFocus");
- else opt_prefs.set("VisibleFocus", opt[Fl::OPTION_VISIBLE_FOCUS][0]);
- if (opt[Fl::OPTION_DND_TEXT][0]==2) opt_prefs.deleteEntry("DNDText");
- else opt_prefs.set("DNDText", opt[Fl::OPTION_DND_TEXT][0]);
- if (opt[Fl::OPTION_SHOW_TOOLTIPS][0]==2) opt_prefs.deleteEntry("ShowTooltips");
- else opt_prefs.set("ShowTooltips", opt[Fl::OPTION_SHOW_TOOLTIPS][0]);
- if (opt[Fl::OPTION_FNFC_USES_GTK][0]==2) opt_prefs.deleteEntry("FNFCUsesGTK");
- else opt_prefs.set("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK][0]);
- if (opt[Fl::OPTION_PRINTER_USES_GTK][0]==2) opt_prefs.deleteEntry("PrintUsesGTK");
- else opt_prefs.set("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK][0]);
- if (opt[Fl::OPTION_SHOW_SCALING][0]==2) opt_prefs.deleteEntry("ShowZoomFactor");
- else opt_prefs.set("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING][0]);
- if (opt[Fl::OPTION_FNFC_USES_ZENITY][0]==2) opt_prefs.deleteEntry("UseZenity");
- else opt_prefs.set("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY][0]);
-}} {}
-}
-
-Function {show_global_settings_window()} {open return_type void
-} {
- code {if (!global_settings_window)
- make_global_settings_window();
-readPrefs();
-refreshUI();
-fl_message(
- "WARNING!\\n\\n"
- "The following dialog changes the user interface behavior\\n"
- "of ALL FLTK applications, for the current user, or for \\n"
- "ALL users on this machine.\\n\\n"
- "Please choose these settings carefully, or reset\\n"
- "user and system settings to \\"default\\".");
-global_settings_window->show();} {}
-}
-
-Function {make_global_settings_window()} {} {
- Fl_Window global_settings_window {
- label {FLTK Preferences} open
- xywh {817 110 400 572} type Double color 50 hide
- } {
- Fl_Group {} {
- label {Keyboard Focus Options} open
- xywh {10 10 380 100} box GTK_DOWN_BOX labelfont 2 align 21
- } {
- Fl_Choice wVisibleFocus {
- label {Visible Keyboard Focus:}
- callback {int mode = wUserOrSystem->value();
-opt[Fl::OPTION_VISIBLE_FOCUS][mode] = wVisibleFocus->value();} open
- tooltip {OPTION_VISIBLE_FOCUS
-
-If visible focus is switched on, FLTK will draw a dotted rectangle inside the widget that will receive the next keystroke. If switched off, no such indicator will be drawn and keyboard navigation is disabled.
-
-Default is on.} xywh {245 40 100 25} down_box BORDER_BOX
- } {
- MenuItem {} {
- label off
- user_data 0 user_data_type long
- xywh {10 10 31 20}
- }
- MenuItem {} {
- label on
- user_data 1 user_data_type long
- xywh {10 10 31 20} divider
- }
- MenuItem {} {
- label default
- user_data 2 user_data_type long
- xywh {10 10 31 20}
- }
- }
- Fl_Choice wArrowFocus {
- label {Arrow Keys move Focus:}
- callback {int mode = wUserOrSystem->value();
-opt[Fl::OPTION_ARROW_FOCUS][mode] = wArrowFocus->value();} open
- tooltip {OPTION_ARROW_FOCUS
-
-When switched on, moving the text cursor beyond the start or end of the text in a text widget will change focus to the next widget. When switched off, the cursor will stop at the end of the text. Pressing Tab or Ctrl-Tab will advance the keyboard focus. Switch this on, if you want the old behavior of FLTK 1.1.
-
-Default is off.} xywh {245 75 100 25} down_box BORDER_BOX
- } {
- MenuItem {} {
- label off
- user_data 0 user_data_type long
- xywh {0 0 31 20}
- }
- MenuItem {} {
- label on
- user_data 1 user_data_type long
- xywh {0 0 31 20} divider
- }
- MenuItem {} {
- label default
- user_data 2 user_data_type long
- xywh {0 0 31 20}
- }
- }
- }
- Fl_Group {} {
- label {Tooltip Options} open
- xywh {10 120 380 65} box GTK_DOWN_BOX labelfont 2 align 21
- } {
- Fl_Choice wShowTooltips {
- label {Show Tooltips:}
- callback {int mode = wUserOrSystem->value();
-opt[Fl::OPTION_SHOW_TOOLTIPS][mode] = wShowTooltips->value();} open
- tooltip {OPTION_SHOW_TOOLTIPS
-
-If tooltips are enabled, hovering the mouse over a widget with a tooltip text will open a little tooltip window until the mouse leaves the widget. If disabled, no tooltip is shown.
-
-Default is on.} xywh {245 150 100 25} down_box BORDER_BOX
- } {
- MenuItem {} {
- label off
- user_data 0 user_data_type long
- xywh {10 10 31 20}
- }
- MenuItem {} {
- label on
- user_data 1 user_data_type long
- xywh {10 10 31 20} divider
- }
- MenuItem {} {
- label default
- user_data 2 user_data_type long
- xywh {10 10 31 20}
- }
- }
- }
- Fl_Group {} {
- label {Drag And Drop Options} open
- xywh {10 194 380 66} box GTK_DOWN_BOX labelfont 2 align 21
- } {
- Fl_Choice wDNDText {
- label {Allow dragging Text:}
- callback {int mode = wUserOrSystem->value();
-opt[Fl::OPTION_DND_TEXT][mode] = wDNDText->value();} open
- tooltip {OPTION_DND_TEXT
-
-If text drag-and-drop is enabled, the user can select and drag text from any text widget. If disabled, no dragging is possible, however dropping text from other applications still works.
-
-Default is on.} xywh {245 225 100 25} down_box BORDER_BOX
- } {
- MenuItem {} {
- label off
- user_data 0 user_data_type long
- xywh {30 30 31 20}
- }
- MenuItem {} {
- label on
- user_data 1 user_data_type long
- xywh {30 30 31 20} divider
- }
- MenuItem {} {
- label default
- user_data 2 user_data_type long
- xywh {30 30 31 20}
- }
- }
- }
- Fl_Group {} {
- label {Native File Chooser Options} open
- xywh {10 269 380 104} box GTK_DOWN_BOX labelfont 2 align 21
- } {
- Fl_Choice wGTKText {
- label {Native File Chooser uses GTK:}
- callback {int mode = wUserOrSystem->value();
-opt[Fl::OPTION_FNFC_USES_GTK ][mode] = wGTKText->value();} open
- tooltip {OPTION_FNFC_USES_GTK
-
-If 'Native File Chooser uses GTK' is enabled, the Fl_Native_File_Chooser class
-calls the GTK open/save file dialogs when they are available on the platfom. If disabled, the Fl_Native_File_Chooser class
-always uses FLTK's own file dialog (i.e., Fl_File_Chooser) even if GTK is available.
-
-Default is on.} xywh {245 300 100 25} down_box BORDER_BOX
- } {
- MenuItem {} {
- label off
- user_data 0 user_data_type long
- xywh {30 30 31 20}
- }
- MenuItem {} {
- label on
- user_data 1 user_data_type long
- xywh {30 30 31 20} divider
- }
- MenuItem {} {
- label default
- user_data 2 user_data_type long
- xywh {30 30 31 20}
- }
- }
- Fl_Choice wUseZenity {
- label {Native File Chooser uses Zenity:}
- callback {int mode = wUserOrSystem->value();
-opt[Fl::OPTION_FNFC_USES_ZENITY ][mode] = wUseZenity->value();}
- tooltip {OPTION_FNFC_USES_ZENITY
-
-If 'Native File Chooser uses Zenity' is enabled, the library uses a Zenity-based file dialog to open/save files when possible. If disabled, the GTK-based dialog is used. Default is on. Meaningful only with Wayland/X11 platforms.} xywh {245 334 100 26} down_box BORDER_BOX
- } {
- MenuItem {} {
- label off
- user_data 0 user_data_type long
- xywh {545 545 31 20}
- }
- MenuItem {} {
- label on
- user_data 1 user_data_type long
- xywh {545 545 31 20} divider
- }
- MenuItem {} {
- label default
- user_data 2 user_data_type long
- xywh {545 545 31 20}
- }
- }
- }
- Fl_Group {} {
- label {Print dialog Options} open
- xywh {10 384 380 66} box GTK_DOWN_BOX labelfont 2 align 21
- } {
- Fl_Choice wPrintGTKText {
- label {Print dialog uses GTK:}
- callback {int mode = wUserOrSystem->value();
-opt[Fl::OPTION_PRINTER_USES_GTK ][mode] = wPrintGTKText->value();} open
- tooltip {OPTION_PRINTER_USES_GTK
-
-If 'Print dialog uses GTK' is enabled, the Fl_Printer class
-calls the GTK print dialog when it's available on the platfom. If disabled, the Fl_Printer class
-always uses FLTK's own print dialog even if GTK is available.
-
-Default is on.} xywh {245 405 100 25} down_box BORDER_BOX
- } {
- MenuItem {} {
- label off
- user_data 0 user_data_type long
- xywh {30 30 31 20}
- }
- MenuItem {} {
- label on
- user_data 1 user_data_type long
- xywh {30 30 31 20} divider
- }
- MenuItem {} {
- label default
- user_data 2 user_data_type long
- xywh {30 30 31 20}
- }
- }
- }
- Fl_Group {} {
- label {Scaling Factor Options} open
- xywh {10 459 380 66} box GTK_DOWN_BOX labelfont 2 align 21
- } {
- Fl_Choice wShowZoomFactor {
- label {Transiently show scaling factor:}
- callback {int mode = wUserOrSystem->value();
-opt[Fl::OPTION_SHOW_SCALING ][mode] = wShowZoomFactor->value();} open
- tooltip {OPTION_SHOW_SCALING
-
-If 'Transiently show scaling factor' is enabled, the library shows in a transient yellow window the display
-scaling factor value when it is changed. If disabled, no such transient window is used.
-
-Default is on.} xywh {245 483 100 25} down_box BORDER_BOX
- } {
- MenuItem {} {
- label off
- user_data 0 user_data_type long
- xywh {30 30 31 20}
- }
- MenuItem {} {
- label on
- user_data 1 user_data_type long
- xywh {30 30 31 20} divider
- }
- MenuItem {} {
- label default
- user_data 2 user_data_type long
- xywh {30 30 31 20}
- }
- }
- }
- Fl_Choice wUserOrSystem {
- callback {refreshUI();} open
- tooltip {Change settings for the current user, or default values for all users of this computer. Individual users can override system options, if they set their options to specific values (not 'default').} xywh {10 535 141 25} down_box BORDER_BOX
- } {
- MenuItem {} {
- label {User Settings}
- user_data 0 user_data_type long
- xywh {0 0 31 20}
- }
- MenuItem {} {
- label {System Settings}
- user_data 1 user_data_type long
- xywh {0 0 31 20}
- }
- }
- Fl_Button {} {
- label Cancel
- callback {global_settings_window->hide();}
- xywh {230 535 75 25}
- }
- Fl_Button {} {
- label OK
- callback {writePrefs();
-global_settings_window->hide();}
- xywh {315 535 75 25}
- }
- }
- code {readPrefs();
- Fl::option(Fl::OPTION_SHOW_TOOLTIPS,1); // make sure tooltips are on !} {}
-}
diff --git a/fluid/alignment_panel.h b/fluid/alignment_panel.h
index 845260289..577648a94 100644
--- a/fluid/alignment_panel.h
+++ b/fluid/alignment_panel.h
@@ -105,25 +105,4 @@ extern Fl_Check_Button *guides_toggle;
extern void default_widget_size_cb(Fl_Round_Button*, long);
extern Fl_Round_Button *def_widget_size[6];
Fl_Double_Window* make_layout_window();
-void show_global_settings_window();
-extern Fl_Double_Window *global_settings_window;
-extern Fl_Choice *wVisibleFocus;
-extern Fl_Choice *wArrowFocus;
-extern Fl_Choice *wShowTooltips;
-extern Fl_Choice *wDNDText;
-extern Fl_Choice *wGTKText;
-extern Fl_Choice *wUseZenity;
-extern Fl_Choice *wPrintGTKText;
-extern Fl_Choice *wShowZoomFactor;
-extern Fl_Choice *wUserOrSystem;
-Fl_Double_Window* make_global_settings_window();
-extern Fl_Menu_Item menu_wVisibleFocus[];
-extern Fl_Menu_Item menu_wArrowFocus[];
-extern Fl_Menu_Item menu_wShowTooltips[];
-extern Fl_Menu_Item menu_wDNDText[];
-extern Fl_Menu_Item menu_wGTKText[];
-extern Fl_Menu_Item menu_wUseZenity[];
-extern Fl_Menu_Item menu_wPrintGTKText[];
-extern Fl_Menu_Item menu_wShowZoomFactor[];
-extern Fl_Menu_Item menu_wUserOrSystem[];
#endif
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index 47266b63f..fdd5b9941 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -1426,8 +1426,7 @@ Fl_Menu_Item Main_Menu[] = {
{"Show Widget &Bin...",FL_ALT+'b',toggle_widgetbin_cb},
{"Show Source Code...",FL_ALT+FL_SHIFT+'s', (Fl_Callback*)toggle_sourceview_cb, 0, FL_MENU_DIVIDER},
{"Pro&ject Settings...",FL_ALT+'p',show_project_cb},
- {"GU&I Settings...",FL_ALT+FL_SHIFT+'p',show_settings_cb,0,FL_MENU_DIVIDER},
- {"Global &FLTK Settings...",FL_ALT+FL_SHIFT+'g',show_global_settings_cb},
+ {"GU&I Settings...",FL_ALT+FL_SHIFT+'p',show_settings_cb},
{0},
{"&New", 0, 0, (void *)New_Menu, FL_SUBMENU_POINTER},
{"&Layout",0,0,0,FL_SUBMENU},
@@ -1650,7 +1649,6 @@ void make_main_window() {
if (!batch_mode) {
load_history();
make_settings_window();
- make_global_settings_window();
}
}