09eff7243a
* Added filename function to Fl_Preferences Static function to get filename before opening. Member to get filename after opening. Bug fixes for memory mapped preferences. * ERROR is a macro on Windows, don't use it * Added Fl_Preferences::dirty(). User can now check if the database will be written when flushed or destroyed. Flush returns a crude error code. * Fl_Preferences::get binary data returns # of bytes read. * Verified group deletion code * Fl_Preferences ignores locale. This will make .prefs files interchangeable between different computers. * Updating the Preferences Mode to ignore locale. * Fixes in docs.
870 lines
30 KiB
Plaintext
870 lines
30 KiB
Plaintext
# data file for the Fltk User Interface Designer (fluid)
|
|
version 1.0400
|
|
i18n_type 1
|
|
i18n_include {<libintl.h>}
|
|
i18n_conditional FLTK_GETTEXT_FOUND
|
|
i18n_function gettext
|
|
i18n_static_function gettext_noop
|
|
header_name {.h}
|
|
code_name {.cxx}
|
|
comment {//
|
|
// Setting and shell dialogs for the Fast Light Tool Kit (FLTK).
|
|
//
|
|
// Copyright 1998-2020 by Bill Spitzak and others.
|
|
//
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
// file is missing or damaged, see the license at:
|
|
//
|
|
// https://www.fltk.org/COPYING.php
|
|
//
|
|
// Please see the following page on how to report bugs and issues:
|
|
//
|
|
// https://www.fltk.org/bugs.php
|
|
//
|
|
} {in_source in_header
|
|
}
|
|
|
|
decl {\#include "fluid.h"} {public global
|
|
}
|
|
|
|
decl {\#include "widget_browser.h"} {public global
|
|
}
|
|
|
|
decl {\#include "shell_command.h"} {public global
|
|
}
|
|
|
|
decl {\#include <FL/Fl_Text_Buffer.H>} {public local
|
|
}
|
|
|
|
decl {\#include <FL/Fl_Text_Display.H>} {public local
|
|
}
|
|
|
|
decl {\#include <FL/filename.H>} {public local
|
|
}
|
|
|
|
decl {\#include <FL/Fl_Preferences.H>} {private global
|
|
}
|
|
|
|
decl {\#include <FL/fl_ask.H>} {private global
|
|
}
|
|
|
|
decl {\#include <string.h>} {private global
|
|
}
|
|
|
|
decl {extern struct Fl_Menu_Item *dbmanager_item;} {public local
|
|
}
|
|
|
|
Function {make_project_window()} {open
|
|
} {
|
|
Fl_Window project_window {
|
|
label {Project Settings} open
|
|
xywh {472 246 399 298} type Double hide
|
|
code0 {\#include <FL/Fl_Preferences.H>}
|
|
code1 {\#include <FL/Fl_Tooltip.H>} modal
|
|
} {
|
|
Fl_Button {} {
|
|
label Close
|
|
callback {project_window->hide();
|
|
set_modflag(-1, -1);}
|
|
tooltip {Close this dialog.} xywh {328 267 60 25}
|
|
}
|
|
Fl_Tabs {} {open
|
|
xywh {10 10 379 246} selection_color 12 labelcolor 7
|
|
} {
|
|
Fl_Group {} {
|
|
label Output open
|
|
xywh {10 36 379 220}
|
|
} {
|
|
Fl_Box {} {
|
|
label {Use "name.ext" to set a file name or just ".ext" to set extension.}
|
|
xywh {20 49 340 49} align 148
|
|
}
|
|
Fl_Input header_file_input {
|
|
label {Header File:}
|
|
user_data 1 user_data_type {void*}
|
|
callback header_input_cb
|
|
tooltip {The name of the generated header file.} xywh {119 103 252 20} box THIN_DOWN_BOX labelfont 1 when 1 textfont 4
|
|
}
|
|
Fl_Input code_file_input {
|
|
label {Code File:}
|
|
user_data 1 user_data_type {void*}
|
|
callback code_input_cb
|
|
tooltip {The name of the generated code file.} xywh {119 128 252 20} box THIN_DOWN_BOX labelfont 1 when 1 textfont 4
|
|
}
|
|
Fl_Check_Button include_H_from_C_button {
|
|
label {Include Header from Code}
|
|
callback include_H_from_C_button_cb
|
|
tooltip {Include the header file from the code file.} xywh {117 153 272 20} down_box DOWN_BOX
|
|
}
|
|
Fl_Check_Button use_FL_COMMAND_button {
|
|
label {Menu shortcuts use FL_COMMAND}
|
|
callback use_FL_COMMAND_button_cb
|
|
tooltip {Replace FL_CTRL and FL_META with FL_COMMAND when generating menu shortcuts} xywh {117 176 272 20} down_box DOWN_BOX
|
|
}
|
|
Fl_Check_Button utf8_in_src_button {
|
|
label {allow Unicode UTF-8 in source code}
|
|
callback utf8_in_src_cb
|
|
tooltip {For older compilers, characters outside of the printable ASCII range are escaped using octal notation `\\0123`. If this option is checked, Fluid will write UTF-8 characters unchanged.} xywh {117 199 272 20} down_box DOWN_BOX
|
|
}
|
|
Fl_Check_Button avoid_early_includes_button {
|
|
label {avoid early include of Fl.H}
|
|
callback avoid_early_includes_cb
|
|
tooltip {Do not emit \#include <FL//Fl.H> until it is needed by another include file.} xywh {117 222 272 20} down_box DOWN_BOX
|
|
}
|
|
}
|
|
Fl_Group {} {
|
|
label Internationalization open
|
|
xywh {10 36 378 220} hide
|
|
} {
|
|
Fl_Choice i18n_type_chooser {
|
|
label {Use:}
|
|
callback i18n_type_cb open
|
|
tooltip {Type of internationalization to use.} xywh {128 48 136 25} box THIN_UP_BOX down_box BORDER_BOX labelfont 1
|
|
} {
|
|
MenuItem {} {
|
|
label None
|
|
xywh {0 0 100 20}
|
|
}
|
|
MenuItem {} {
|
|
label {GNU gettext}
|
|
xywh {0 0 100 20}
|
|
}
|
|
MenuItem {} {
|
|
label {POSIX catgets}
|
|
xywh {0 0 100 20}
|
|
}
|
|
}
|
|
Fl_Input i18n_include_input {
|
|
label {\#include:}
|
|
callback i18n_text_cb
|
|
tooltip {The include file for internationalization.} xywh {128 78 243 20} box THIN_DOWN_BOX labelfont 1 textfont 4
|
|
}
|
|
Fl_Input i18n_conditional_input {
|
|
label {Conditional:}
|
|
callback i18n_text_cb
|
|
tooltip {only include the header file if this preprocessor macro is defined, for example FLTK_GETTEXT_FOUND} xywh {128 103 243 20} box THIN_DOWN_BOX labelfont 1 textfont 4
|
|
}
|
|
Fl_Input i18n_file_input {
|
|
label {File:}
|
|
callback i18n_text_cb
|
|
tooltip {The name of the message catalog.} xywh {128 128 243 20} box THIN_DOWN_BOX labelfont 1 textfont 4
|
|
}
|
|
Fl_Input i18n_set_input {
|
|
label {Set:}
|
|
callback i18n_int_cb
|
|
tooltip {The message set number.} xywh {128 153 243 20} type Int box THIN_DOWN_BOX labelfont 1 textfont 4
|
|
}
|
|
Fl_Input i18n_function_input {
|
|
label {Function:}
|
|
callback i18n_text_cb
|
|
tooltip {The function to call to translate labels and tooltips, usually "gettext" or "_"} xywh {128 128 243 20} box THIN_DOWN_BOX labelfont 1 textfont 4
|
|
}
|
|
Fl_Input i18n_static_function_input {
|
|
label {Static Function:}
|
|
callback i18n_text_cb
|
|
tooltip {function to call to translate static text, The function to call to internationalize labels and tooltips, usually "gettext_noop" or "N_"} xywh {128 153 243 20} box THIN_DOWN_BOX labelfont 1 textfont 4
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
decl {extern void i18n_cb(Fl_Choice *,void *);} {public local
|
|
}
|
|
|
|
decl {void scheme_cb(Fl_Choice *, void *);} {public local
|
|
}
|
|
|
|
Function {make_settings_window()} {open
|
|
} {
|
|
Fl_Window settings_window {
|
|
label {GUI Settings}
|
|
xywh {442 538 360 355} type Double hide resizable
|
|
code0 {o->size_range(o->w(), o->h());} non_modal
|
|
} {
|
|
Fl_Choice scheme_choice {
|
|
label {Scheme: }
|
|
callback scheme_cb open
|
|
xywh {140 10 115 25} down_box BORDER_BOX labelfont 1
|
|
code0 {int s;}
|
|
code1 {fluid_prefs.get("scheme", s, 0);}
|
|
code2 {scheme_choice->value(s);}
|
|
code3 {scheme_cb(0, 0);}
|
|
} {
|
|
MenuItem {} {
|
|
label Default
|
|
xywh {0 0 35 25}
|
|
}
|
|
MenuItem {} {
|
|
label None
|
|
xywh {0 0 35 25}
|
|
}
|
|
MenuItem {} {
|
|
label Plastic
|
|
xywh {0 0 35 25}
|
|
}
|
|
MenuItem {} {
|
|
label {GTK+}
|
|
xywh {10 10 35 25}
|
|
}
|
|
MenuItem {} {
|
|
label Gleam
|
|
xywh {20 20 35 25}
|
|
}
|
|
}
|
|
Fl_Group {} {open
|
|
xywh {20 43 330 161} labelfont 1 align 0
|
|
} {
|
|
Fl_Box {} {
|
|
label {Options: }
|
|
xywh {140 43 1 25} labelfont 1 align 4
|
|
}
|
|
Fl_Check_Button tooltips_button {
|
|
label {Show Tooltips}
|
|
callback {Fl_Tooltip::enable(tooltips_button->value());
|
|
fluid_prefs.set("show_tooltips", tooltips_button->value());}
|
|
xywh {138 43 113 25} down_box DOWN_BOX labelsize 12
|
|
code0 {int b;}
|
|
code1 {fluid_prefs.get("show_tooltips", b, 1);}
|
|
code2 {tooltips_button->value(b);}
|
|
code3 {Fl_Tooltip::enable(b);}
|
|
}
|
|
Fl_Check_Button completion_button {
|
|
label {Show Completion Dialogs}
|
|
callback {fluid_prefs.set("show_completion_dialogs", completion_button->value());}
|
|
xywh {138 68 186 25} down_box DOWN_BOX labelsize 12
|
|
code0 {int b;}
|
|
code1 {fluid_prefs.get("show_completion_dialogs", b, 1);}
|
|
code2 {completion_button->value(b);}
|
|
}
|
|
Fl_Check_Button openlast_button {
|
|
label {Open Previous File on Startup}
|
|
callback {fluid_prefs.set("open_previous_file", openlast_button->value());}
|
|
xywh {138 93 214 25} down_box DOWN_BOX labelsize 12
|
|
code0 {int b;}
|
|
code1 {fluid_prefs.get("open_previous_file", b, 0);}
|
|
code2 {openlast_button->value(b);}
|
|
}
|
|
Fl_Check_Button prevpos_button {
|
|
label {Remember Window Positions}
|
|
callback {fluid_prefs.set("prev_window_pos", prevpos_button->value());}
|
|
xywh {138 118 209 25} down_box DOWN_BOX labelsize 12
|
|
code0 {int b;}
|
|
code1 {fluid_prefs.get("prev_window_pos", b, 1);}
|
|
code2 {prevpos_button->value(b);}
|
|
}
|
|
Fl_Check_Button show_comments_button {
|
|
label {Show Comments in Browser}
|
|
callback {show_comments = show_comments_button->value();
|
|
fluid_prefs.set("show_comments", show_comments);
|
|
redraw_browser();}
|
|
xywh {138 143 209 25} down_box DOWN_BOX labelsize 12
|
|
code1 {fluid_prefs.get("show_comments", show_comments, 1);}
|
|
code2 {show_comments_button->value(show_comments);}
|
|
}
|
|
}
|
|
Fl_Spinner recent_spinner {
|
|
label {\# Recent Files: }
|
|
callback {fluid_prefs.set("recent_files", recent_spinner->value());
|
|
load_history();}
|
|
xywh {140 173 40 25} labelfont 1 when 1
|
|
code0 {int c;}
|
|
code1 {fluid_prefs.get("recent_files", c, 5);}
|
|
code2 {recent_spinner->maximum(10);}
|
|
code3 {recent_spinner->value(c);}
|
|
}
|
|
Fl_Group {} {open
|
|
xywh {10 210 337 95} box THIN_UP_BOX color 47 resizable
|
|
} {
|
|
Fl_Check_Button use_external_editor_button {
|
|
label {Use external editor?}
|
|
callback {G_use_external_editor = use_external_editor_button->value();
|
|
fluid_prefs.set("use_external_editor", G_use_external_editor);
|
|
redraw_browser();}
|
|
xywh {25 218 209 22} down_box DOWN_BOX labelsize 12
|
|
code1 {fluid_prefs.get("use_external_editor", G_use_external_editor, 0);}
|
|
code2 {use_external_editor_button->value(G_use_external_editor);}
|
|
}
|
|
Fl_Input editor_command_input {
|
|
label {Editor Command}
|
|
callback {strncpy(G_external_editor_command, editor_command_input->value(), sizeof(G_external_editor_command)-1);
|
|
G_external_editor_command[sizeof(G_external_editor_command)-1] = 0;
|
|
fluid_prefs.set("external_editor_command", G_external_editor_command);
|
|
redraw_browser();}
|
|
tooltip {The editor command to open your external text editor.
|
|
Include any necessary flags to ensure your editor does not background itself.
|
|
Examples:
|
|
gvim -f
|
|
gedit
|
|
emacs} xywh {25 264 305 21} labelsize 12 align 5 when 1 textsize 12
|
|
code1 {fluid_prefs.get("external_editor_command", G_external_editor_command, "", sizeof(G_external_editor_command)-1);}
|
|
code2 {editor_command_input->value(G_external_editor_command);}
|
|
}
|
|
}
|
|
Fl_Button {} {
|
|
label Close
|
|
callback {settings_window->hide();}
|
|
tooltip {Close this dialog.} xywh {285 320 64 25}
|
|
}
|
|
}
|
|
}
|
|
|
|
Function {make_shell_window()} {open
|
|
} {
|
|
Fl_Window shell_window {
|
|
label {Shell Command} open
|
|
xywh {544 751 365 200} type Double hide modal size_range {365 200 365 200}
|
|
} {
|
|
Fl_Group {} {open
|
|
xywh {0 0 365 165}
|
|
} {
|
|
Fl_Input shell_command_input {
|
|
label {Command:}
|
|
tooltip {external shell command} xywh {82 14 277 20} labelfont 1 labelsize 12 textfont 4 textsize 12 resizable
|
|
}
|
|
Fl_Check_Button shell_savefl_button {
|
|
label {save .fl design file}
|
|
tooltip {save the design to the .fl file before running the command} xywh {82 39 136 19} down_box DOWN_BOX labelsize 12
|
|
}
|
|
Fl_Check_Button shell_writecode_button {
|
|
label {save source code} selected
|
|
tooltip {generate the source code and header file before running the command} xywh {82 59 120 19} down_box DOWN_BOX labelsize 12
|
|
}
|
|
Fl_Check_Button shell_writemsgs_button {
|
|
label {save i18n strings}
|
|
tooltip {save the internationalisation string before running the command} xywh {82 79 126 19} down_box DOWN_BOX labelsize 12
|
|
}
|
|
Fl_Check_Button shell_use_fl_button {
|
|
label {use settings in .fl design files}
|
|
callback {g_shell_use_fl_settings = shell_use_fl_button->value();
|
|
fluid_prefs.set("shell_use_fl", g_shell_use_fl_settings);
|
|
if (g_shell_use_fl_settings) {
|
|
shell_settings_read();
|
|
} else {
|
|
shell_prefs_get();
|
|
}
|
|
update_shell_window();}
|
|
tooltip {check to read and write shell command from and to .fl files} xywh {82 110 180 19} down_box DOWN_BOX labelsize 12
|
|
}
|
|
Fl_Box {} {
|
|
xywh {82 103 275 1} box BORDER_FRAME color 0
|
|
}
|
|
Fl_Group {} {open
|
|
xywh {82 134 273 20}
|
|
} {
|
|
Fl_Button {} {
|
|
label {save as default}
|
|
callback {apply_shell_window();
|
|
shell_prefs_set();}
|
|
tooltip {update the Fluid app settings for external shell commands to the current settings} xywh {82 134 104 20} labelsize 12
|
|
}
|
|
Fl_Box {} {
|
|
xywh {186 136 169 15} resizable
|
|
}
|
|
}
|
|
}
|
|
Fl_Group {} {open
|
|
xywh {0 160 365 40}
|
|
} {
|
|
Fl_Box {} {
|
|
xywh {10 167 135 25} resizable
|
|
}
|
|
Fl_Return_Button {} {
|
|
label Run
|
|
callback {apply_shell_window();
|
|
do_shell_command(NULL, NULL);}
|
|
tooltip {save selected files and run the command} xywh {145 167 100 25} labelsize 12
|
|
}
|
|
Fl_Button {} {
|
|
label Cancel
|
|
callback {shell_command_input->value(g_shell_command);
|
|
shell_window->hide();}
|
|
xywh {255 167 100 25} labelsize 12
|
|
}
|
|
}
|
|
}
|
|
Fl_Window shell_run_window {
|
|
label {Shell Command Output}
|
|
xywh {887 409 555 430} type Double hide resizable
|
|
} {
|
|
Fl_Simple_Terminal shell_run_terminal {
|
|
xywh {10 10 535 375} resizable
|
|
}
|
|
Fl_Return_Button shell_run_button {
|
|
label Close
|
|
callback {Fl_Preferences pos(fluid_prefs, "shell_run_Window_pos");
|
|
pos.set("x", shell_run_window->x());
|
|
pos.set("y", shell_run_window->y());
|
|
pos.set("w", shell_run_window->w());
|
|
pos.set("h", shell_run_window->h());
|
|
shell_run_window->hide();}
|
|
xywh {468 395 77 25}
|
|
}
|
|
}
|
|
}
|
|
|
|
Function {make_layout_window()} {open
|
|
} {
|
|
Fl_Window grid_window {
|
|
label {Layout Settings}
|
|
xywh {745 303 310 245} type Double hide non_modal
|
|
} {
|
|
Fl_Input horizontal_input {
|
|
label x
|
|
user_data 1 user_data_type long
|
|
callback grid_cb
|
|
tooltip {Horizontal grid spacing.} xywh {116 10 50 25} type Int box THIN_DOWN_BOX align 8
|
|
code0 {o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);}
|
|
}
|
|
Fl_Input vertical_input {
|
|
label pixels
|
|
user_data 2 user_data_type long
|
|
callback grid_cb
|
|
tooltip {Vertical grid spacing.} xywh {179 10 50 25} type Int box THIN_DOWN_BOX align 8
|
|
code0 {o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);}
|
|
}
|
|
Fl_Input snap_input {
|
|
label {pixel snap}
|
|
user_data 3 user_data_type long
|
|
callback grid_cb
|
|
tooltip {Snap to grid within this many pixels.} xywh {116 45 50 25} type Int box THIN_DOWN_BOX align 8
|
|
code0 {o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);}
|
|
}
|
|
Fl_Check_Button guides_toggle {
|
|
label {Show Guides}
|
|
user_data 4 user_data_type long
|
|
callback guides_cb
|
|
tooltip {Show distance and alignment guides in overlay} xywh {116 80 110 25} down_box DOWN_BOX
|
|
}
|
|
Fl_Button {} {
|
|
label Close
|
|
callback {grid_window->hide();}
|
|
tooltip {Close this dialog.} xywh {240 210 60 25}
|
|
}
|
|
Fl_Box {} {
|
|
label {Grid:}
|
|
xywh {47 10 70 25} labelfont 1 align 24
|
|
}
|
|
Fl_Box {} {
|
|
label {Widget Size:}
|
|
xywh {10 115 107 25} labelfont 1 align 24
|
|
}
|
|
Fl_Group {} {open
|
|
xywh {105 115 192 75}
|
|
} {
|
|
Fl_Round_Button {def_widget_size[0]} {
|
|
user_data 8 user_data_type long
|
|
callback default_widget_size_cb
|
|
xywh {115 115 70 25} type Radio down_box ROUND_DOWN_BOX
|
|
}
|
|
Fl_Box {} {
|
|
label tiny
|
|
xywh {130 115 50 25} labelsize 8 align 20
|
|
}
|
|
Fl_Round_Button {def_widget_size[1]} {
|
|
user_data 11 user_data_type long
|
|
callback default_widget_size_cb
|
|
xywh {202 115 70 25} type Radio down_box ROUND_DOWN_BOX
|
|
}
|
|
Fl_Box {} {
|
|
label small
|
|
xywh {218 115 50 25} labelsize 11 align 20
|
|
}
|
|
Fl_Round_Button {def_widget_size[2]} {
|
|
user_data 14 user_data_type long
|
|
callback default_widget_size_cb
|
|
xywh {115 140 70 25} type Radio down_box ROUND_DOWN_BOX
|
|
}
|
|
Fl_Box {} {
|
|
label normal
|
|
xywh {130 140 50 25} align 20
|
|
}
|
|
Fl_Round_Button {def_widget_size[3]} {
|
|
user_data 18 user_data_type long
|
|
callback default_widget_size_cb
|
|
xywh {202 140 90 25} type Radio down_box ROUND_DOWN_BOX
|
|
}
|
|
Fl_Box {} {
|
|
label medium
|
|
xywh {218 140 68 25} labelsize 18 align 20
|
|
}
|
|
Fl_Round_Button {def_widget_size[4]} {
|
|
user_data 24 user_data_type long
|
|
callback default_widget_size_cb
|
|
xywh {115 165 75 25} type Radio down_box ROUND_DOWN_BOX
|
|
}
|
|
Fl_Box {} {
|
|
label large
|
|
xywh {130 165 64 25} labelsize 24 align 20
|
|
}
|
|
Fl_Round_Button {def_widget_size[5]} {
|
|
user_data 32 user_data_type long
|
|
callback default_widget_size_cb
|
|
xywh {202 165 95 25} type Radio down_box ROUND_DOWN_BOX
|
|
}
|
|
Fl_Box {} {
|
|
label huge
|
|
xywh {218 165 76 25} labelsize 32 align 20
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
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]);} {}
|
|
}
|
|
|
|
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);
|
|
}
|
|
{
|
|
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);
|
|
}
|
|
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]);
|
|
}
|
|
{
|
|
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]);
|
|
}} {}
|
|
}
|
|
|
|
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 {715 96 400 531} 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 66} 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_Group {} {
|
|
label {Print dialog Options} open
|
|
xywh {10 345 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 366 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 421 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 442 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 496 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 496 75 25}
|
|
}
|
|
Fl_Button {} {
|
|
label OK
|
|
callback {writePrefs();
|
|
global_settings_window->hide();}
|
|
xywh {315 496 75 25}
|
|
}
|
|
}
|
|
code {readPrefs();
|
|
Fl::option(Fl::OPTION_SHOW_TOOLTIPS,1); // make sure tooltips are on !} {}
|
|
}
|