2005-03-18 09:29:11 +03:00
|
|
|
//
|
|
|
|
// Setting and shell dialogs for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2020-04-06 21:04:16 +03:00
|
|
|
// Copyright 1998-2020 by Bill Spitzak and others.
|
2005-03-18 09:29:11 +03:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// 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:
|
|
|
|
//
|
2020-04-06 21:04:16 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
2005-03-18 09:29:11 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2005-03-18 09:29:11 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
2005-03-18 09:29:11 +03:00
|
|
|
//
|
|
|
|
|
2016-01-30 03:56:42 +03:00
|
|
|
// generated by Fast Light User Interface Designer (fluid) version 1.0400
|
1998-10-06 22:21:25 +04:00
|
|
|
|
1998-12-06 18:09:22 +03:00
|
|
|
#include "alignment_panel.h"
|
2010-12-21 01:19:24 +03:00
|
|
|
#include <FL/Fl_Preferences.H>
|
|
|
|
#include <FL/fl_ask.H>
|
2018-10-22 04:04:57 +03:00
|
|
|
#include <string.h>
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2005-02-26 23:27:19 +03:00
|
|
|
Fl_Double_Window *project_window=(Fl_Double_Window *)0;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
1999-01-27 00:59:41 +03:00
|
|
|
static void cb_Close(Fl_Button*, void*) {
|
2002-05-01 23:17:24 +04:00
|
|
|
project_window->hide();
|
2021-12-10 03:22:15 +03:00
|
|
|
set_modflag(-1, -1);
|
1998-10-06 22:21:25 +04:00
|
|
|
}
|
|
|
|
|
1999-01-27 00:59:41 +03:00
|
|
|
Fl_Input *header_file_input=(Fl_Input *)0;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
1999-01-27 00:59:41 +03:00
|
|
|
Fl_Input *code_file_input=(Fl_Input *)0;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2007-05-10 16:06:31 +04:00
|
|
|
Fl_Check_Button *include_H_from_C_button=(Fl_Check_Button *)0;
|
|
|
|
|
|
|
|
Fl_Check_Button *use_FL_COMMAND_button=(Fl_Check_Button *)0;
|
1998-10-15 18:19:34 +04:00
|
|
|
|
2021-12-17 23:15:04 +03:00
|
|
|
Fl_Check_Button *utf8_in_src_button=(Fl_Check_Button *)0;
|
|
|
|
|
2022-01-08 23:55:19 +03:00
|
|
|
Fl_Check_Button *avoid_early_includes_button=(Fl_Check_Button *)0;
|
|
|
|
|
2000-04-24 22:22:50 +04:00
|
|
|
Fl_Choice *i18n_type_chooser=(Fl_Choice *)0;
|
|
|
|
|
|
|
|
Fl_Menu_Item menu_i18n_type_chooser[] = {
|
2015-07-09 05:09:33 +03:00
|
|
|
{"None", 0, 0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
|
|
|
|
{"GNU gettext", 0, 0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
|
|
|
|
{"POSIX catgets", 0, 0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
|
2005-02-26 23:27:19 +03:00
|
|
|
{0,0,0,0,0,0,0,0,0}
|
2000-04-24 22:22:50 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
Fl_Input *i18n_include_input=(Fl_Input *)0;
|
|
|
|
|
2021-12-19 03:09:13 +03:00
|
|
|
Fl_Input *i18n_conditional_input=(Fl_Input *)0;
|
|
|
|
|
2000-04-24 22:22:50 +04:00
|
|
|
Fl_Input *i18n_file_input=(Fl_Input *)0;
|
|
|
|
|
2010-12-20 15:21:24 +03:00
|
|
|
Fl_Int_Input *i18n_set_input=(Fl_Int_Input *)0;
|
2000-04-24 22:22:50 +04:00
|
|
|
|
|
|
|
Fl_Input *i18n_function_input=(Fl_Input *)0;
|
|
|
|
|
2021-12-19 03:09:13 +03:00
|
|
|
Fl_Input *i18n_static_function_input=(Fl_Input *)0;
|
|
|
|
|
2005-02-26 23:27:19 +03:00
|
|
|
Fl_Double_Window* make_project_window() {
|
2022-01-08 23:55:19 +03:00
|
|
|
{ project_window = new Fl_Double_Window(399, 298, "Project Settings");
|
|
|
|
{ Fl_Button* o = new Fl_Button(328, 267, 60, 25, "Close");
|
2001-09-30 02:59:45 +04:00
|
|
|
o->tooltip("Close this dialog.");
|
1999-01-27 00:59:41 +03:00
|
|
|
o->callback((Fl_Callback*)cb_Close);
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Button* o
|
2022-01-08 23:55:19 +03:00
|
|
|
{ Fl_Tabs* o = new Fl_Tabs(10, 10, 379, 246);
|
2006-09-17 18:58:25 +04:00
|
|
|
o->selection_color((Fl_Color)12);
|
2021-12-19 03:09:13 +03:00
|
|
|
o->labelcolor(FL_BACKGROUND2_COLOR);
|
2022-01-08 23:55:19 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 36, 379, 220, "Output");
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(20, 49, 340, 49, "Use \"name.ext\" to set a file name or just \".ext\" to set extension.");
|
|
|
|
o->align(Fl_Align(132|FL_ALIGN_INSIDE));
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Box* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ header_file_input = new Fl_Input(119, 103, 252, 20, "Header File:");
|
2006-09-17 18:58:25 +04:00
|
|
|
header_file_input->tooltip("The name of the generated header file.");
|
|
|
|
header_file_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
header_file_input->labelfont(1);
|
|
|
|
header_file_input->textfont(4);
|
|
|
|
header_file_input->callback((Fl_Callback*)header_input_cb, (void*)(1));
|
|
|
|
header_file_input->when(FL_WHEN_CHANGED);
|
|
|
|
} // Fl_Input* header_file_input
|
2014-05-18 00:46:25 +04:00
|
|
|
{ code_file_input = new Fl_Input(119, 128, 252, 20, "Code File:");
|
2006-09-17 18:58:25 +04:00
|
|
|
code_file_input->tooltip("The name of the generated code file.");
|
|
|
|
code_file_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
code_file_input->labelfont(1);
|
|
|
|
code_file_input->textfont(4);
|
|
|
|
code_file_input->callback((Fl_Callback*)code_input_cb, (void*)(1));
|
|
|
|
code_file_input->when(FL_WHEN_CHANGED);
|
|
|
|
} // Fl_Input* code_file_input
|
2014-05-18 00:46:25 +04:00
|
|
|
{ include_H_from_C_button = new Fl_Check_Button(117, 153, 272, 20, "Include Header from Code");
|
2006-09-17 18:58:25 +04:00
|
|
|
include_H_from_C_button->tooltip("Include the header file from the code file.");
|
2007-05-10 16:06:31 +04:00
|
|
|
include_H_from_C_button->down_box(FL_DOWN_BOX);
|
2006-09-17 18:58:25 +04:00
|
|
|
include_H_from_C_button->callback((Fl_Callback*)include_H_from_C_button_cb);
|
2007-05-10 16:06:31 +04:00
|
|
|
} // Fl_Check_Button* include_H_from_C_button
|
2014-05-18 00:46:25 +04:00
|
|
|
{ use_FL_COMMAND_button = new Fl_Check_Button(117, 176, 272, 20, "Menu shortcuts use FL_COMMAND");
|
2021-12-19 03:09:13 +03:00
|
|
|
use_FL_COMMAND_button->tooltip("Replace FL_CTRL and FL_META with FL_COMMAND when generating menu shortcuts");
|
2007-05-10 16:06:31 +04:00
|
|
|
use_FL_COMMAND_button->down_box(FL_DOWN_BOX);
|
|
|
|
use_FL_COMMAND_button->callback((Fl_Callback*)use_FL_COMMAND_button_cb);
|
|
|
|
} // Fl_Check_Button* use_FL_COMMAND_button
|
2021-12-17 23:15:04 +03:00
|
|
|
{ utf8_in_src_button = new Fl_Check_Button(117, 199, 272, 20, "allow Unicode UTF-8 in source code");
|
|
|
|
utf8_in_src_button->tooltip("For older compilers, characters outside of the printable ASCII range are esca\
|
|
|
|
ped using octal notation `\\0123`. If this option is checked, Fluid will write\
|
2021-12-18 16:38:12 +03:00
|
|
|
UTF-8 characters unchanged.");
|
2021-12-17 23:15:04 +03:00
|
|
|
utf8_in_src_button->down_box(FL_DOWN_BOX);
|
|
|
|
utf8_in_src_button->callback((Fl_Callback*)utf8_in_src_cb);
|
|
|
|
} // Fl_Check_Button* utf8_in_src_button
|
2022-01-08 23:55:19 +03:00
|
|
|
{ avoid_early_includes_button = new Fl_Check_Button(117, 222, 272, 20, "avoid early include of Fl.H");
|
|
|
|
avoid_early_includes_button->tooltip("Do not emit #include <FL//Fl.H> until it is needed by another include file.");
|
|
|
|
avoid_early_includes_button->down_box(FL_DOWN_BOX);
|
|
|
|
avoid_early_includes_button->callback((Fl_Callback*)avoid_early_includes_cb);
|
|
|
|
} // Fl_Check_Button* avoid_early_includes_button
|
2002-05-01 23:17:24 +04:00
|
|
|
o->end();
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Group* o
|
2022-01-08 23:55:19 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 36, 378, 220, "Internationalization");
|
2021-12-10 03:22:15 +03:00
|
|
|
o->hide();
|
2021-12-19 03:09:13 +03:00
|
|
|
{ i18n_type_chooser = new Fl_Choice(128, 48, 136, 25, "Use:");
|
2006-09-17 18:58:25 +04:00
|
|
|
i18n_type_chooser->tooltip("Type of internationalization to use.");
|
|
|
|
i18n_type_chooser->box(FL_THIN_UP_BOX);
|
|
|
|
i18n_type_chooser->down_box(FL_BORDER_BOX);
|
|
|
|
i18n_type_chooser->labelfont(1);
|
|
|
|
i18n_type_chooser->callback((Fl_Callback*)i18n_type_cb);
|
|
|
|
i18n_type_chooser->menu(menu_i18n_type_chooser);
|
|
|
|
} // Fl_Choice* i18n_type_chooser
|
2021-12-19 03:09:13 +03:00
|
|
|
{ i18n_include_input = new Fl_Input(128, 78, 243, 20, "#include:");
|
2006-09-17 18:58:25 +04:00
|
|
|
i18n_include_input->tooltip("The include file for internationalization.");
|
|
|
|
i18n_include_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
i18n_include_input->labelfont(1);
|
|
|
|
i18n_include_input->textfont(4);
|
|
|
|
i18n_include_input->callback((Fl_Callback*)i18n_text_cb);
|
|
|
|
} // Fl_Input* i18n_include_input
|
2021-12-19 03:09:13 +03:00
|
|
|
{ i18n_conditional_input = new Fl_Input(128, 103, 243, 20, "Conditional:");
|
|
|
|
i18n_conditional_input->tooltip("only include the header file if this preprocessor macro is defined, for examp\
|
|
|
|
le FLTK_GETTEXT_FOUND");
|
|
|
|
i18n_conditional_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
i18n_conditional_input->labelfont(1);
|
|
|
|
i18n_conditional_input->textfont(4);
|
|
|
|
i18n_conditional_input->callback((Fl_Callback*)i18n_text_cb);
|
|
|
|
} // Fl_Input* i18n_conditional_input
|
|
|
|
{ i18n_file_input = new Fl_Input(128, 128, 243, 20, "File:");
|
2006-09-17 18:58:25 +04:00
|
|
|
i18n_file_input->tooltip("The name of the message catalog.");
|
|
|
|
i18n_file_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
i18n_file_input->labelfont(1);
|
|
|
|
i18n_file_input->textfont(4);
|
|
|
|
i18n_file_input->callback((Fl_Callback*)i18n_text_cb);
|
|
|
|
} // Fl_Input* i18n_file_input
|
2021-12-19 03:09:13 +03:00
|
|
|
{ i18n_set_input = new Fl_Int_Input(128, 153, 243, 20, "Set:");
|
2006-09-17 18:58:25 +04:00
|
|
|
i18n_set_input->tooltip("The message set number.");
|
|
|
|
i18n_set_input->type(2);
|
|
|
|
i18n_set_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
i18n_set_input->labelfont(1);
|
|
|
|
i18n_set_input->textfont(4);
|
2010-12-20 15:21:24 +03:00
|
|
|
i18n_set_input->callback((Fl_Callback*)i18n_int_cb);
|
|
|
|
} // Fl_Int_Input* i18n_set_input
|
2021-12-19 03:09:13 +03:00
|
|
|
{ i18n_function_input = new Fl_Input(128, 128, 243, 20, "Function:");
|
|
|
|
i18n_function_input->tooltip("The function to call to translate labels and tooltips, usually \"gettext\" or\
|
|
|
|
\"_\"");
|
2006-09-17 18:58:25 +04:00
|
|
|
i18n_function_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
i18n_function_input->labelfont(1);
|
|
|
|
i18n_function_input->textfont(4);
|
|
|
|
i18n_function_input->callback((Fl_Callback*)i18n_text_cb);
|
|
|
|
} // Fl_Input* i18n_function_input
|
2021-12-19 03:09:13 +03:00
|
|
|
{ i18n_static_function_input = new Fl_Input(128, 153, 243, 20, "Static Function:");
|
|
|
|
i18n_static_function_input->tooltip("function to call to translate static text, The function to call to internatio\
|
|
|
|
nalize labels and tooltips, usually \"gettext_noop\" or \"N_\"");
|
|
|
|
i18n_static_function_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
i18n_static_function_input->labelfont(1);
|
|
|
|
i18n_static_function_input->textfont(4);
|
|
|
|
i18n_static_function_input->callback((Fl_Callback*)i18n_text_cb);
|
|
|
|
} // Fl_Input* i18n_static_function_input
|
2002-05-01 23:17:24 +04:00
|
|
|
o->end();
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Group* o
|
2002-05-01 23:17:24 +04:00
|
|
|
o->end();
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Tabs* o
|
|
|
|
project_window->set_modal();
|
|
|
|
project_window->end();
|
|
|
|
} // Fl_Double_Window* project_window
|
|
|
|
return project_window;
|
1998-10-06 22:21:25 +04:00
|
|
|
}
|
2020-07-01 19:03:10 +03:00
|
|
|
void scheme_cb(Fl_Choice *, void *);
|
2002-04-30 22:11:49 +04:00
|
|
|
|
2005-02-26 23:27:19 +03:00
|
|
|
Fl_Double_Window *settings_window=(Fl_Double_Window *)0;
|
2002-04-30 22:11:49 +04:00
|
|
|
|
2005-03-20 03:51:02 +03:00
|
|
|
Fl_Choice *scheme_choice=(Fl_Choice *)0;
|
|
|
|
|
|
|
|
Fl_Menu_Item menu_scheme_choice[] = {
|
2015-07-09 05:09:33 +03:00
|
|
|
{"Default", 0, 0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
|
|
|
|
{"None", 0, 0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
|
|
|
|
{"Plastic", 0, 0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
|
|
|
|
{"GTK+", 0, 0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
|
|
|
|
{"Gleam", 0, 0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
|
2022-11-24 21:00:00 +03:00
|
|
|
{"Oxy", 0, 0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
|
2005-03-20 03:51:02 +03:00
|
|
|
{0,0,0,0,0,0,0,0,0}
|
|
|
|
};
|
|
|
|
|
2002-04-30 22:11:49 +04:00
|
|
|
Fl_Check_Button *tooltips_button=(Fl_Check_Button *)0;
|
|
|
|
|
|
|
|
static void cb_tooltips_button(Fl_Check_Button*, void*) {
|
|
|
|
Fl_Tooltip::enable(tooltips_button->value());
|
2021-12-10 03:22:15 +03:00
|
|
|
fluid_prefs.set("show_tooltips", tooltips_button->value());
|
2002-04-30 22:11:49 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Check_Button *completion_button=(Fl_Check_Button *)0;
|
|
|
|
|
|
|
|
static void cb_completion_button(Fl_Check_Button*, void*) {
|
|
|
|
fluid_prefs.set("show_completion_dialogs", completion_button->value());
|
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Check_Button *openlast_button=(Fl_Check_Button *)0;
|
|
|
|
|
|
|
|
static void cb_openlast_button(Fl_Check_Button*, void*) {
|
|
|
|
fluid_prefs.set("open_previous_file", openlast_button->value());
|
|
|
|
}
|
|
|
|
|
2002-10-31 21:49:05 +03:00
|
|
|
Fl_Check_Button *prevpos_button=(Fl_Check_Button *)0;
|
|
|
|
|
|
|
|
static void cb_prevpos_button(Fl_Check_Button*, void*) {
|
|
|
|
fluid_prefs.set("prev_window_pos", prevpos_button->value());
|
|
|
|
}
|
|
|
|
|
2008-09-19 01:11:28 +04:00
|
|
|
Fl_Check_Button *show_comments_button=(Fl_Check_Button *)0;
|
|
|
|
|
|
|
|
static void cb_show_comments_button(Fl_Check_Button*, void*) {
|
|
|
|
show_comments = show_comments_button->value();
|
2021-12-10 03:22:15 +03:00
|
|
|
fluid_prefs.set("show_comments", show_comments);
|
|
|
|
redraw_browser();
|
2005-03-19 11:38:21 +03:00
|
|
|
}
|
|
|
|
|
2005-03-24 20:45:50 +03:00
|
|
|
Fl_Spinner *recent_spinner=(Fl_Spinner *)0;
|
|
|
|
|
|
|
|
static void cb_recent_spinner(Fl_Spinner*, void*) {
|
|
|
|
fluid_prefs.set("recent_files", recent_spinner->value());
|
2021-12-10 03:22:15 +03:00
|
|
|
load_history();
|
2005-03-24 20:45:50 +03:00
|
|
|
}
|
|
|
|
|
2016-07-19 00:12:25 +03:00
|
|
|
Fl_Check_Button *use_external_editor_button=(Fl_Check_Button *)0;
|
|
|
|
|
|
|
|
static void cb_use_external_editor_button(Fl_Check_Button*, void*) {
|
|
|
|
G_use_external_editor = use_external_editor_button->value();
|
2021-12-10 03:22:15 +03:00
|
|
|
fluid_prefs.set("use_external_editor", G_use_external_editor);
|
|
|
|
redraw_browser();
|
2016-07-19 00:12:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Input *editor_command_input=(Fl_Input *)0;
|
|
|
|
|
|
|
|
static void cb_editor_command_input(Fl_Input*, void*) {
|
|
|
|
strncpy(G_external_editor_command, editor_command_input->value(), sizeof(G_external_editor_command)-1);
|
2021-12-10 03:22:15 +03:00
|
|
|
G_external_editor_command[sizeof(G_external_editor_command)-1] = 0;
|
|
|
|
fluid_prefs.set("external_editor_command", G_external_editor_command);
|
|
|
|
redraw_browser();
|
2016-07-19 00:12:25 +03:00
|
|
|
}
|
|
|
|
|
2008-09-19 01:11:28 +04:00
|
|
|
static void cb_Close1(Fl_Button*, void*) {
|
|
|
|
settings_window->hide();
|
|
|
|
}
|
|
|
|
|
2005-02-26 23:27:19 +03:00
|
|
|
Fl_Double_Window* make_settings_window() {
|
2016-07-19 00:12:25 +03:00
|
|
|
{ Fl_Double_Window* o = settings_window = new Fl_Double_Window(360, 355, "GUI Settings");
|
2014-05-18 00:46:25 +04:00
|
|
|
{ scheme_choice = new Fl_Choice(140, 10, 115, 25, "Scheme: ");
|
2006-09-17 18:58:25 +04:00
|
|
|
scheme_choice->down_box(FL_BORDER_BOX);
|
|
|
|
scheme_choice->labelfont(1);
|
|
|
|
scheme_choice->callback((Fl_Callback*)scheme_cb);
|
|
|
|
scheme_choice->menu(menu_scheme_choice);
|
2005-03-20 03:51:02 +03:00
|
|
|
int s;
|
|
|
|
fluid_prefs.get("scheme", s, 0);
|
|
|
|
scheme_choice->value(s);
|
|
|
|
scheme_cb(0, 0);
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Choice* scheme_choice
|
2016-07-19 00:12:25 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(20, 43, 330, 161);
|
2005-03-20 03:51:02 +03:00
|
|
|
o->labelfont(1);
|
2010-04-12 09:18:38 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_CENTER));
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(140, 43, 1, 25, "Options: ");
|
2010-02-28 01:38:25 +03:00
|
|
|
o->labelfont(1);
|
|
|
|
o->align(Fl_Align(FL_ALIGN_LEFT));
|
|
|
|
} // Fl_Box* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ tooltips_button = new Fl_Check_Button(138, 43, 113, 25, "Show Tooltips");
|
2006-09-17 18:58:25 +04:00
|
|
|
tooltips_button->down_box(FL_DOWN_BOX);
|
2014-05-18 00:46:25 +04:00
|
|
|
tooltips_button->labelsize(12);
|
2006-09-17 18:58:25 +04:00
|
|
|
tooltips_button->callback((Fl_Callback*)cb_tooltips_button);
|
2005-03-20 03:51:02 +03:00
|
|
|
int b;
|
|
|
|
fluid_prefs.get("show_tooltips", b, 1);
|
|
|
|
tooltips_button->value(b);
|
|
|
|
Fl_Tooltip::enable(b);
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Check_Button* tooltips_button
|
2014-05-18 00:46:25 +04:00
|
|
|
{ completion_button = new Fl_Check_Button(138, 68, 186, 25, "Show Completion Dialogs");
|
2006-09-17 18:58:25 +04:00
|
|
|
completion_button->down_box(FL_DOWN_BOX);
|
2014-05-18 00:46:25 +04:00
|
|
|
completion_button->labelsize(12);
|
2006-09-17 18:58:25 +04:00
|
|
|
completion_button->callback((Fl_Callback*)cb_completion_button);
|
2005-03-20 03:51:02 +03:00
|
|
|
int b;
|
|
|
|
fluid_prefs.get("show_completion_dialogs", b, 1);
|
|
|
|
completion_button->value(b);
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Check_Button* completion_button
|
2014-05-18 00:46:25 +04:00
|
|
|
{ openlast_button = new Fl_Check_Button(138, 93, 214, 25, "Open Previous File on Startup");
|
2006-09-17 18:58:25 +04:00
|
|
|
openlast_button->down_box(FL_DOWN_BOX);
|
2014-05-18 00:46:25 +04:00
|
|
|
openlast_button->labelsize(12);
|
2006-09-17 18:58:25 +04:00
|
|
|
openlast_button->callback((Fl_Callback*)cb_openlast_button);
|
2005-03-20 03:51:02 +03:00
|
|
|
int b;
|
|
|
|
fluid_prefs.get("open_previous_file", b, 0);
|
|
|
|
openlast_button->value(b);
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Check_Button* openlast_button
|
2014-05-18 00:46:25 +04:00
|
|
|
{ prevpos_button = new Fl_Check_Button(138, 118, 209, 25, "Remember Window Positions");
|
2006-09-17 18:58:25 +04:00
|
|
|
prevpos_button->down_box(FL_DOWN_BOX);
|
2014-05-18 00:46:25 +04:00
|
|
|
prevpos_button->labelsize(12);
|
2006-09-17 18:58:25 +04:00
|
|
|
prevpos_button->callback((Fl_Callback*)cb_prevpos_button);
|
2005-03-20 03:51:02 +03:00
|
|
|
int b;
|
|
|
|
fluid_prefs.get("prev_window_pos", b, 1);
|
|
|
|
prevpos_button->value(b);
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Check_Button* prevpos_button
|
2014-05-18 00:46:25 +04:00
|
|
|
{ show_comments_button = new Fl_Check_Button(138, 143, 209, 25, "Show Comments in Browser");
|
2008-09-19 01:11:28 +04:00
|
|
|
show_comments_button->down_box(FL_DOWN_BOX);
|
2014-05-18 00:46:25 +04:00
|
|
|
show_comments_button->labelsize(12);
|
2008-09-19 01:11:28 +04:00
|
|
|
show_comments_button->callback((Fl_Callback*)cb_show_comments_button);
|
|
|
|
fluid_prefs.get("show_comments", show_comments, 1);
|
|
|
|
show_comments_button->value(show_comments);
|
|
|
|
} // Fl_Check_Button* show_comments_button
|
2005-03-20 03:51:02 +03:00
|
|
|
o->end();
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Group* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ recent_spinner = new Fl_Spinner(140, 173, 40, 25, "# Recent Files: ");
|
2006-09-17 18:58:25 +04:00
|
|
|
recent_spinner->labelfont(1);
|
|
|
|
recent_spinner->callback((Fl_Callback*)cb_recent_spinner);
|
|
|
|
recent_spinner->when(FL_WHEN_CHANGED);
|
2005-03-24 20:45:50 +03:00
|
|
|
int c;
|
|
|
|
fluid_prefs.get("recent_files", c, 5);
|
|
|
|
recent_spinner->maximum(10);
|
|
|
|
recent_spinner->value(c);
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Spinner* recent_spinner
|
2016-07-19 00:12:25 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 210, 337, 95);
|
|
|
|
o->box(FL_THIN_UP_BOX);
|
|
|
|
o->color(FL_DARK1);
|
|
|
|
{ use_external_editor_button = new Fl_Check_Button(25, 218, 209, 22, "Use external editor?");
|
|
|
|
use_external_editor_button->down_box(FL_DOWN_BOX);
|
|
|
|
use_external_editor_button->labelsize(12);
|
|
|
|
use_external_editor_button->callback((Fl_Callback*)cb_use_external_editor_button);
|
|
|
|
fluid_prefs.get("use_external_editor", G_use_external_editor, 0);
|
|
|
|
use_external_editor_button->value(G_use_external_editor);
|
|
|
|
} // Fl_Check_Button* use_external_editor_button
|
|
|
|
{ editor_command_input = new Fl_Input(25, 264, 305, 21, "Editor Command");
|
|
|
|
editor_command_input->tooltip("The editor command to open your external text editor.\nInclude any necessary \
|
|
|
|
flags to ensure your editor does not background itself.\nExamples:\n gvim -\
|
|
|
|
f\n gedit\n emacs");
|
|
|
|
editor_command_input->labelsize(12);
|
|
|
|
editor_command_input->textsize(12);
|
|
|
|
editor_command_input->callback((Fl_Callback*)cb_editor_command_input);
|
|
|
|
editor_command_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
|
|
|
|
editor_command_input->when(FL_WHEN_CHANGED);
|
|
|
|
fluid_prefs.get("external_editor_command", G_external_editor_command, "", sizeof(G_external_editor_command)-1);
|
|
|
|
editor_command_input->value(G_external_editor_command);
|
|
|
|
} // Fl_Input* editor_command_input
|
|
|
|
o->end();
|
|
|
|
Fl_Group::current()->resizable(o);
|
|
|
|
} // Fl_Group* o
|
|
|
|
{ Fl_Button* o = new Fl_Button(285, 320, 64, 25, "Close");
|
2008-09-19 01:11:28 +04:00
|
|
|
o->tooltip("Close this dialog.");
|
|
|
|
o->callback((Fl_Callback*)cb_Close1);
|
|
|
|
} // Fl_Button* o
|
2016-07-19 00:12:25 +03:00
|
|
|
o->size_range(o->w(), o->h());
|
2006-09-17 18:58:25 +04:00
|
|
|
settings_window->set_non_modal();
|
|
|
|
settings_window->end();
|
|
|
|
} // Fl_Double_Window* settings_window
|
|
|
|
return settings_window;
|
2002-04-30 22:11:49 +04:00
|
|
|
}
|
2002-05-01 14:36:08 +04:00
|
|
|
|
2005-02-26 23:27:19 +03:00
|
|
|
Fl_Double_Window *shell_window=(Fl_Double_Window *)0;
|
2002-05-01 14:36:08 +04:00
|
|
|
|
|
|
|
Fl_Input *shell_command_input=(Fl_Input *)0;
|
|
|
|
|
2021-12-09 04:43:57 +03:00
|
|
|
Fl_Check_Button *shell_savefl_button=(Fl_Check_Button *)0;
|
2002-05-01 14:36:08 +04:00
|
|
|
|
|
|
|
Fl_Check_Button *shell_writecode_button=(Fl_Check_Button *)0;
|
|
|
|
|
|
|
|
Fl_Check_Button *shell_writemsgs_button=(Fl_Check_Button *)0;
|
|
|
|
|
2021-12-09 04:43:57 +03:00
|
|
|
Fl_Check_Button *shell_use_fl_button=(Fl_Check_Button *)0;
|
|
|
|
|
|
|
|
static void cb_shell_use_fl_button(Fl_Check_Button*, void*) {
|
|
|
|
g_shell_use_fl_settings = shell_use_fl_button->value();
|
2021-12-10 03:22:15 +03:00
|
|
|
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();
|
2002-05-01 14:36:08 +04:00
|
|
|
}
|
|
|
|
|
2021-12-09 04:43:57 +03:00
|
|
|
static void cb_save(Fl_Button*, void*) {
|
|
|
|
apply_shell_window();
|
2021-12-10 03:22:15 +03:00
|
|
|
shell_prefs_set();
|
2021-12-09 04:43:57 +03:00
|
|
|
}
|
2005-03-19 11:38:21 +03:00
|
|
|
|
2021-12-09 04:43:57 +03:00
|
|
|
static void cb_Run(Fl_Return_Button*, void*) {
|
|
|
|
apply_shell_window();
|
2021-12-10 03:22:15 +03:00
|
|
|
do_shell_command(NULL, NULL);
|
2005-03-19 11:38:21 +03:00
|
|
|
}
|
|
|
|
|
2002-05-01 14:36:08 +04:00
|
|
|
static void cb_Cancel(Fl_Button*, void*) {
|
2021-12-09 04:43:57 +03:00
|
|
|
shell_command_input->value(g_shell_command);
|
2021-12-10 03:22:15 +03:00
|
|
|
shell_window->hide();
|
2002-05-01 14:36:08 +04:00
|
|
|
}
|
|
|
|
|
2005-02-26 23:27:19 +03:00
|
|
|
Fl_Double_Window *shell_run_window=(Fl_Double_Window *)0;
|
2002-05-01 14:36:08 +04:00
|
|
|
|
2019-01-14 02:09:31 +03:00
|
|
|
Fl_Simple_Terminal *shell_run_terminal=(Fl_Simple_Terminal *)0;
|
2005-03-19 11:38:21 +03:00
|
|
|
|
2002-05-01 14:36:08 +04:00
|
|
|
Fl_Return_Button *shell_run_button=(Fl_Return_Button *)0;
|
|
|
|
|
|
|
|
static void cb_shell_run_button(Fl_Return_Button*, void*) {
|
2019-01-14 02:09:31 +03:00
|
|
|
Fl_Preferences pos(fluid_prefs, "shell_run_Window_pos");
|
2021-12-10 03:22:15 +03:00
|
|
|
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();
|
2002-05-01 14:36:08 +04:00
|
|
|
}
|
|
|
|
|
2005-02-26 23:27:19 +03:00
|
|
|
Fl_Double_Window* make_shell_window() {
|
2021-12-09 04:43:57 +03:00
|
|
|
{ shell_window = new Fl_Double_Window(365, 200, "Shell Command");
|
|
|
|
{ Fl_Group* o = new Fl_Group(0, 0, 365, 165);
|
|
|
|
{ shell_command_input = new Fl_Input(82, 14, 277, 20, "Command:");
|
|
|
|
shell_command_input->tooltip("external shell command");
|
|
|
|
shell_command_input->labelfont(1);
|
|
|
|
shell_command_input->labelsize(12);
|
|
|
|
shell_command_input->textfont(4);
|
|
|
|
shell_command_input->textsize(12);
|
|
|
|
Fl_Group::current()->resizable(shell_command_input);
|
|
|
|
} // Fl_Input* shell_command_input
|
|
|
|
{ shell_savefl_button = new Fl_Check_Button(82, 39, 136, 19, "save .fl design file");
|
|
|
|
shell_savefl_button->tooltip("save the design to the .fl file before running the command");
|
|
|
|
shell_savefl_button->down_box(FL_DOWN_BOX);
|
|
|
|
shell_savefl_button->labelsize(12);
|
|
|
|
} // Fl_Check_Button* shell_savefl_button
|
|
|
|
{ shell_writecode_button = new Fl_Check_Button(82, 59, 120, 19, "save source code");
|
|
|
|
shell_writecode_button->tooltip("generate the source code and header file before running the command");
|
|
|
|
shell_writecode_button->down_box(FL_DOWN_BOX);
|
|
|
|
shell_writecode_button->labelsize(12);
|
|
|
|
} // Fl_Check_Button* shell_writecode_button
|
|
|
|
{ shell_writemsgs_button = new Fl_Check_Button(82, 79, 126, 19, "save i18n strings");
|
|
|
|
shell_writemsgs_button->tooltip("save the internationalisation string before running the command");
|
|
|
|
shell_writemsgs_button->down_box(FL_DOWN_BOX);
|
|
|
|
shell_writemsgs_button->labelsize(12);
|
|
|
|
} // Fl_Check_Button* shell_writemsgs_button
|
|
|
|
{ shell_use_fl_button = new Fl_Check_Button(82, 110, 180, 19, "use settings in .fl design files");
|
|
|
|
shell_use_fl_button->tooltip("check to read and write shell command from and to .fl files");
|
|
|
|
shell_use_fl_button->down_box(FL_DOWN_BOX);
|
|
|
|
shell_use_fl_button->labelsize(12);
|
|
|
|
shell_use_fl_button->callback((Fl_Callback*)cb_shell_use_fl_button);
|
|
|
|
} // Fl_Check_Button* shell_use_fl_button
|
|
|
|
{ Fl_Box* o = new Fl_Box(82, 103, 275, 1);
|
|
|
|
o->box(FL_BORDER_FRAME);
|
|
|
|
o->color(FL_FOREGROUND_COLOR);
|
|
|
|
} // Fl_Box* o
|
|
|
|
{ Fl_Group* o = new Fl_Group(82, 134, 273, 20);
|
|
|
|
{ Fl_Button* o = new Fl_Button(82, 134, 104, 20, "save as default");
|
|
|
|
o->tooltip("update the Fluid app settings for external shell commands to the current sett\
|
|
|
|
ings");
|
|
|
|
o->labelsize(12);
|
|
|
|
o->callback((Fl_Callback*)cb_save);
|
|
|
|
} // Fl_Button* o
|
|
|
|
{ Fl_Box* o = new Fl_Box(186, 136, 169, 15);
|
|
|
|
Fl_Group::current()->resizable(o);
|
|
|
|
} // Fl_Box* o
|
|
|
|
o->end();
|
|
|
|
} // Fl_Group* o
|
|
|
|
o->end();
|
|
|
|
} // Fl_Group* o
|
|
|
|
{ Fl_Group* o = new Fl_Group(0, 160, 365, 40);
|
|
|
|
{ Fl_Box* o = new Fl_Box(10, 167, 135, 25);
|
|
|
|
Fl_Group::current()->resizable(o);
|
|
|
|
} // Fl_Box* o
|
|
|
|
{ Fl_Return_Button* o = new Fl_Return_Button(145, 167, 100, 25, "Run");
|
|
|
|
o->tooltip("save selected files and run the command");
|
|
|
|
o->labelsize(12);
|
|
|
|
o->callback((Fl_Callback*)cb_Run);
|
|
|
|
} // Fl_Return_Button* o
|
|
|
|
{ Fl_Button* o = new Fl_Button(255, 167, 100, 25, "Cancel");
|
|
|
|
o->labelsize(12);
|
|
|
|
o->callback((Fl_Callback*)cb_Cancel);
|
|
|
|
} // Fl_Button* o
|
|
|
|
o->end();
|
|
|
|
} // Fl_Group* o
|
|
|
|
shell_window->set_modal();
|
|
|
|
shell_window->size_range(365, 200, 365, 200);
|
2006-09-17 18:58:25 +04:00
|
|
|
shell_window->end();
|
|
|
|
} // Fl_Double_Window* shell_window
|
|
|
|
{ shell_run_window = new Fl_Double_Window(555, 430, "Shell Command Output");
|
2019-01-14 02:09:31 +03:00
|
|
|
{ shell_run_terminal = new Fl_Simple_Terminal(10, 10, 535, 375);
|
|
|
|
Fl_Group::current()->resizable(shell_run_terminal);
|
|
|
|
} // Fl_Simple_Terminal* shell_run_terminal
|
2006-09-17 18:58:25 +04:00
|
|
|
{ shell_run_button = new Fl_Return_Button(468, 395, 77, 25, "Close");
|
|
|
|
shell_run_button->callback((Fl_Callback*)cb_shell_run_button);
|
|
|
|
} // Fl_Return_Button* shell_run_button
|
|
|
|
shell_run_window->end();
|
|
|
|
} // Fl_Double_Window* shell_run_window
|
|
|
|
return shell_run_window;
|
2002-05-01 14:36:08 +04:00
|
|
|
}
|
2002-05-01 23:17:24 +04:00
|
|
|
|
2005-02-26 23:27:19 +03:00
|
|
|
Fl_Double_Window *grid_window=(Fl_Double_Window *)0;
|
2002-05-01 23:17:24 +04:00
|
|
|
|
2010-12-20 15:21:24 +03:00
|
|
|
Fl_Int_Input *horizontal_input=(Fl_Int_Input *)0;
|
2002-05-01 23:17:24 +04:00
|
|
|
|
2010-12-20 15:21:24 +03:00
|
|
|
Fl_Int_Input *vertical_input=(Fl_Int_Input *)0;
|
2002-05-01 23:17:24 +04:00
|
|
|
|
2010-12-20 15:21:24 +03:00
|
|
|
Fl_Int_Input *snap_input=(Fl_Int_Input *)0;
|
2002-05-01 23:17:24 +04:00
|
|
|
|
2005-02-26 23:27:19 +03:00
|
|
|
Fl_Check_Button *guides_toggle=(Fl_Check_Button *)0;
|
|
|
|
|
2002-05-01 23:17:24 +04:00
|
|
|
static void cb_Close2(Fl_Button*, void*) {
|
|
|
|
grid_window->hide();
|
|
|
|
}
|
|
|
|
|
2005-09-09 15:36:36 +04:00
|
|
|
Fl_Round_Button *def_widget_size[6]={(Fl_Round_Button *)0};
|
|
|
|
|
|
|
|
Fl_Double_Window* make_layout_window() {
|
2014-05-18 00:46:25 +04:00
|
|
|
{ grid_window = new Fl_Double_Window(310, 245, "Layout Settings");
|
|
|
|
{ Fl_Int_Input* o = horizontal_input = new Fl_Int_Input(116, 10, 50, 25, "x");
|
2006-09-17 18:58:25 +04:00
|
|
|
horizontal_input->tooltip("Horizontal grid spacing.");
|
|
|
|
horizontal_input->type(2);
|
|
|
|
horizontal_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
horizontal_input->callback((Fl_Callback*)grid_cb, (void*)(1));
|
2008-09-19 01:11:28 +04:00
|
|
|
horizontal_input->align(Fl_Align(FL_ALIGN_RIGHT));
|
2005-03-19 11:38:21 +03:00
|
|
|
o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
|
2010-12-20 15:21:24 +03:00
|
|
|
} // Fl_Int_Input* horizontal_input
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Int_Input* o = vertical_input = new Fl_Int_Input(179, 10, 50, 25, "pixels");
|
2006-09-17 18:58:25 +04:00
|
|
|
vertical_input->tooltip("Vertical grid spacing.");
|
|
|
|
vertical_input->type(2);
|
|
|
|
vertical_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
vertical_input->callback((Fl_Callback*)grid_cb, (void*)(2));
|
2008-09-19 01:11:28 +04:00
|
|
|
vertical_input->align(Fl_Align(FL_ALIGN_RIGHT));
|
2005-03-19 11:38:21 +03:00
|
|
|
o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
|
2010-12-20 15:21:24 +03:00
|
|
|
} // Fl_Int_Input* vertical_input
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Int_Input* o = snap_input = new Fl_Int_Input(116, 45, 50, 25, "pixel snap");
|
2006-09-17 18:58:25 +04:00
|
|
|
snap_input->tooltip("Snap to grid within this many pixels.");
|
|
|
|
snap_input->type(2);
|
|
|
|
snap_input->box(FL_THIN_DOWN_BOX);
|
|
|
|
snap_input->callback((Fl_Callback*)grid_cb, (void*)(3));
|
2008-09-19 01:11:28 +04:00
|
|
|
snap_input->align(Fl_Align(FL_ALIGN_RIGHT));
|
2005-03-19 11:38:21 +03:00
|
|
|
o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
|
2010-12-20 15:21:24 +03:00
|
|
|
} // Fl_Int_Input* snap_input
|
2014-05-18 00:46:25 +04:00
|
|
|
{ guides_toggle = new Fl_Check_Button(116, 80, 110, 25, "Show Guides");
|
2006-09-17 18:58:25 +04:00
|
|
|
guides_toggle->tooltip("Show distance and alignment guides in overlay");
|
|
|
|
guides_toggle->down_box(FL_DOWN_BOX);
|
|
|
|
guides_toggle->callback((Fl_Callback*)guides_cb, (void*)(4));
|
|
|
|
} // Fl_Check_Button* guides_toggle
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Button* o = new Fl_Button(240, 210, 60, 25, "Close");
|
2002-05-01 23:17:24 +04:00
|
|
|
o->tooltip("Close this dialog.");
|
|
|
|
o->callback((Fl_Callback*)cb_Close2);
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Button* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(47, 10, 70, 25, "Grid:");
|
2005-09-09 15:36:36 +04:00
|
|
|
o->labelfont(1);
|
2008-09-19 01:11:28 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE));
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Box* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(10, 115, 107, 25, "Widget Size:");
|
2005-09-09 15:36:36 +04:00
|
|
|
o->labelfont(1);
|
2008-09-19 01:11:28 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE));
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Box* o
|
2021-12-19 03:09:13 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(105, 115, 192, 75);
|
2014-05-18 00:46:25 +04:00
|
|
|
{ def_widget_size[0] = new Fl_Round_Button(115, 115, 70, 25);
|
2006-09-17 18:58:25 +04:00
|
|
|
def_widget_size[0]->type(102);
|
|
|
|
def_widget_size[0]->down_box(FL_ROUND_DOWN_BOX);
|
|
|
|
def_widget_size[0]->callback((Fl_Callback*)default_widget_size_cb, (void*)(8));
|
|
|
|
} // Fl_Round_Button* def_widget_size[0]
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(130, 115, 50, 25, "tiny");
|
2005-09-09 15:36:36 +04:00
|
|
|
o->labelsize(8);
|
2008-09-19 01:11:28 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE));
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Box* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ def_widget_size[1] = new Fl_Round_Button(202, 115, 70, 25);
|
2006-09-17 18:58:25 +04:00
|
|
|
def_widget_size[1]->type(102);
|
|
|
|
def_widget_size[1]->down_box(FL_ROUND_DOWN_BOX);
|
|
|
|
def_widget_size[1]->callback((Fl_Callback*)default_widget_size_cb, (void*)(11));
|
|
|
|
} // Fl_Round_Button* def_widget_size[1]
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(218, 115, 50, 25, "small");
|
2005-09-09 15:36:36 +04:00
|
|
|
o->labelsize(11);
|
2008-09-19 01:11:28 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE));
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Box* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ def_widget_size[2] = new Fl_Round_Button(115, 140, 70, 25);
|
2006-09-17 18:58:25 +04:00
|
|
|
def_widget_size[2]->type(102);
|
|
|
|
def_widget_size[2]->down_box(FL_ROUND_DOWN_BOX);
|
|
|
|
def_widget_size[2]->callback((Fl_Callback*)default_widget_size_cb, (void*)(14));
|
|
|
|
} // Fl_Round_Button* def_widget_size[2]
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(130, 140, 50, 25, "normal");
|
2008-09-19 01:11:28 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE));
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Box* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ def_widget_size[3] = new Fl_Round_Button(202, 140, 90, 25);
|
2006-09-17 18:58:25 +04:00
|
|
|
def_widget_size[3]->type(102);
|
|
|
|
def_widget_size[3]->down_box(FL_ROUND_DOWN_BOX);
|
|
|
|
def_widget_size[3]->callback((Fl_Callback*)default_widget_size_cb, (void*)(18));
|
|
|
|
} // Fl_Round_Button* def_widget_size[3]
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(218, 140, 68, 25, "medium");
|
2005-09-09 15:36:36 +04:00
|
|
|
o->labelsize(18);
|
2008-09-19 01:11:28 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE));
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Box* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ def_widget_size[4] = new Fl_Round_Button(115, 165, 75, 25);
|
2006-09-17 18:58:25 +04:00
|
|
|
def_widget_size[4]->type(102);
|
|
|
|
def_widget_size[4]->down_box(FL_ROUND_DOWN_BOX);
|
|
|
|
def_widget_size[4]->callback((Fl_Callback*)default_widget_size_cb, (void*)(24));
|
|
|
|
} // Fl_Round_Button* def_widget_size[4]
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(130, 165, 64, 25, "large");
|
2005-09-09 15:36:36 +04:00
|
|
|
o->labelsize(24);
|
2008-09-19 01:11:28 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE));
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Box* o
|
2014-05-18 00:46:25 +04:00
|
|
|
{ def_widget_size[5] = new Fl_Round_Button(202, 165, 95, 25);
|
2006-09-17 18:58:25 +04:00
|
|
|
def_widget_size[5]->type(102);
|
|
|
|
def_widget_size[5]->down_box(FL_ROUND_DOWN_BOX);
|
|
|
|
def_widget_size[5]->callback((Fl_Callback*)default_widget_size_cb, (void*)(32));
|
|
|
|
} // Fl_Round_Button* def_widget_size[5]
|
2014-05-18 00:46:25 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(218, 165, 76, 25, "huge");
|
2005-09-09 15:36:36 +04:00
|
|
|
o->labelsize(32);
|
2008-09-19 01:11:28 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE));
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Box* o
|
2005-09-09 15:36:36 +04:00
|
|
|
o->end();
|
2006-09-17 18:58:25 +04:00
|
|
|
} // Fl_Group* o
|
|
|
|
grid_window->set_non_modal();
|
|
|
|
grid_window->end();
|
|
|
|
} // Fl_Double_Window* grid_window
|
|
|
|
return grid_window;
|
2002-05-01 23:17:24 +04:00
|
|
|
}
|
2010-12-21 01:19:24 +03:00
|
|
|
/**
|
2015-07-09 05:09:33 +03:00
|
|
|
Copy of all options in user and system mode
|
2010-12-21 01:19:24 +03:00
|
|
|
*/
|
2020-07-01 19:03:10 +03:00
|
|
|
static int opt[10][2];
|
2010-12-21 01:19:24 +03:00
|
|
|
|
|
|
|
/**
|
2015-07-09 05:09:33 +03:00
|
|
|
Update the UI using the values in the opt array
|
2010-12-21 01:19:24 +03:00
|
|
|
*/
|
|
|
|
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]);
|
2014-09-30 17:06:35 +04:00
|
|
|
wGTKText->value(opt[Fl::OPTION_FNFC_USES_GTK][mode]);
|
2019-09-15 16:57:29 +03:00
|
|
|
wPrintGTKText->value(opt[Fl::OPTION_PRINTER_USES_GTK][mode]);
|
2020-09-27 11:02:28 +03:00
|
|
|
wShowZoomFactor->value(opt[Fl::OPTION_SHOW_SCALING][mode]);
|
2022-12-13 20:37:48 +03:00
|
|
|
wUseZenity->value(opt[Fl::OPTION_FNFC_USES_ZENITY][mode]);
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-07-09 05:09:33 +03:00
|
|
|
read all preferences and refresh the GUI
|
2010-12-21 01:19:24 +03:00
|
|
|
*/
|
|
|
|
static void readPrefs() {
|
|
|
|
// read all preferences and refresh the GUI
|
|
|
|
{
|
2022-03-03 19:20:24 +03:00
|
|
|
Fl_Preferences prefs(Fl_Preferences::SYSTEM_L, "fltk.org", "fltk");
|
2010-12-21 01:19:24 +03:00
|
|
|
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);
|
2014-09-30 17:06:35 +04:00
|
|
|
opt_prefs.get("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK ][1], 2);
|
2019-09-15 16:57:29 +03:00
|
|
|
opt_prefs.get("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK ][1], 2);
|
2020-09-27 11:02:28 +03:00
|
|
|
opt_prefs.get("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING ][1], 2);
|
2022-12-13 20:37:48 +03:00
|
|
|
opt_prefs.get("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY ][1], 2);
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
{
|
2022-03-03 19:20:24 +03:00
|
|
|
Fl_Preferences prefs(Fl_Preferences::USER_L, "fltk.org", "fltk");
|
2010-12-21 01:19:24 +03:00
|
|
|
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);
|
2014-09-30 17:06:35 +04:00
|
|
|
opt_prefs.get("FNFCUsesGTK", opt[Fl::OPTION_FNFC_USES_GTK ][0], 2);
|
2019-09-15 16:57:29 +03:00
|
|
|
opt_prefs.get("PrintUsesGTK", opt[Fl::OPTION_PRINTER_USES_GTK ][0], 2);
|
2020-09-27 11:02:28 +03:00
|
|
|
opt_prefs.get("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING ][0], 2);
|
2022-12-13 20:37:48 +03:00
|
|
|
opt_prefs.get("UseZenity", opt[Fl::OPTION_FNFC_USES_ZENITY ][0], 2);
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
refreshUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-07-09 05:09:33 +03:00
|
|
|
write all preferences using the array
|
2010-12-21 01:19:24 +03:00
|
|
|
*/
|
|
|
|
static void writePrefs() {
|
|
|
|
// write all preferences using the array
|
|
|
|
{
|
2022-03-03 19:20:24 +03:00
|
|
|
Fl_Preferences prefs(Fl_Preferences::SYSTEM_L, "fltk.org", "fltk");
|
2010-12-21 01:19:24 +03:00
|
|
|
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]);
|
2014-09-30 17:06:35 +04:00
|
|
|
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]);
|
2019-09-15 16:57:29 +03:00
|
|
|
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]);
|
2020-09-27 11:02:28 +03:00
|
|
|
if (opt[Fl::OPTION_SHOW_SCALING][1]==2) opt_prefs.deleteEntry("ShowZoomFactor");
|
|
|
|
else opt_prefs.set("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING][1]);
|
2022-12-13 20:37:48 +03:00
|
|
|
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]);
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
{
|
2022-03-03 19:20:24 +03:00
|
|
|
Fl_Preferences prefs(Fl_Preferences::USER_L, "fltk.org", "fltk");
|
2010-12-21 01:19:24 +03:00
|
|
|
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]);
|
2014-09-30 17:06:35 +04:00
|
|
|
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]);
|
2019-09-15 16:57:29 +03:00
|
|
|
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]);
|
2020-09-27 11:02:28 +03:00
|
|
|
if (opt[Fl::OPTION_SHOW_SCALING][0]==2) opt_prefs.deleteEntry("ShowZoomFactor");
|
|
|
|
else opt_prefs.set("ShowZoomFactor", opt[Fl::OPTION_SHOW_SCALING][0]);
|
2022-12-13 20:37:48 +03:00
|
|
|
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]);
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void show_global_settings_window() {
|
|
|
|
if (!global_settings_window)
|
|
|
|
make_global_settings_window();
|
|
|
|
readPrefs();
|
|
|
|
refreshUI();
|
|
|
|
fl_message(
|
2020-07-01 19:03:10 +03:00
|
|
|
"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\".");
|
2010-12-21 01:19:24 +03:00
|
|
|
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();
|
2021-12-10 03:22:15 +03:00
|
|
|
opt[Fl::OPTION_VISIBLE_FOCUS][mode] = wVisibleFocus->value();
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Menu_Item menu_wVisibleFocus[] = {
|
2015-07-09 05:09:33 +03:00
|
|
|
{"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},
|
2010-12-21 01:19:24 +03:00
|
|
|
{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();
|
2021-12-10 03:22:15 +03:00
|
|
|
opt[Fl::OPTION_ARROW_FOCUS][mode] = wArrowFocus->value();
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Menu_Item menu_wArrowFocus[] = {
|
2015-07-09 05:09:33 +03:00
|
|
|
{"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},
|
2010-12-21 01:19:24 +03:00
|
|
|
{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();
|
2021-12-10 03:22:15 +03:00
|
|
|
opt[Fl::OPTION_SHOW_TOOLTIPS][mode] = wShowTooltips->value();
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Menu_Item menu_wShowTooltips[] = {
|
2015-07-09 05:09:33 +03:00
|
|
|
{"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},
|
2010-12-21 01:19:24 +03:00
|
|
|
{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();
|
2021-12-10 03:22:15 +03:00
|
|
|
opt[Fl::OPTION_DND_TEXT][mode] = wDNDText->value();
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Menu_Item menu_wDNDText[] = {
|
2015-07-09 05:09:33 +03:00
|
|
|
{"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},
|
2010-12-21 01:19:24 +03:00
|
|
|
{0,0,0,0,0,0,0,0,0}
|
|
|
|
};
|
|
|
|
|
2014-09-30 17:06:35 +04:00
|
|
|
Fl_Choice *wGTKText=(Fl_Choice *)0;
|
|
|
|
|
|
|
|
static void cb_wGTKText(Fl_Choice*, void*) {
|
|
|
|
int mode = wUserOrSystem->value();
|
2021-12-10 03:22:15 +03:00
|
|
|
opt[Fl::OPTION_FNFC_USES_GTK ][mode] = wGTKText->value();
|
2014-09-30 17:06:35 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Menu_Item menu_wGTKText[] = {
|
2015-07-09 05:09:33 +03:00
|
|
|
{"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},
|
2014-09-30 17:06:35 +04:00
|
|
|
{0,0,0,0,0,0,0,0,0}
|
|
|
|
};
|
|
|
|
|
2022-12-13 20:37:48 +03:00
|
|
|
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}
|
|
|
|
};
|
|
|
|
|
2019-09-15 16:57:29 +03:00
|
|
|
Fl_Choice *wPrintGTKText=(Fl_Choice *)0;
|
|
|
|
|
|
|
|
static void cb_wPrintGTKText(Fl_Choice*, void*) {
|
|
|
|
int mode = wUserOrSystem->value();
|
2021-12-10 03:22:15 +03:00
|
|
|
opt[Fl::OPTION_PRINTER_USES_GTK ][mode] = wPrintGTKText->value();
|
2019-09-15 16:57:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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}
|
|
|
|
};
|
|
|
|
|
2020-09-27 11:02:28 +03:00
|
|
|
Fl_Choice *wShowZoomFactor=(Fl_Choice *)0;
|
|
|
|
|
|
|
|
static void cb_wShowZoomFactor(Fl_Choice*, void*) {
|
|
|
|
int mode = wUserOrSystem->value();
|
2021-12-10 03:22:15 +03:00
|
|
|
opt[Fl::OPTION_SHOW_SCALING ][mode] = wShowZoomFactor->value();
|
2020-09-27 11:02:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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}
|
|
|
|
};
|
|
|
|
|
2010-12-21 01:19:24 +03:00
|
|
|
Fl_Choice *wUserOrSystem=(Fl_Choice *)0;
|
|
|
|
|
|
|
|
static void cb_wUserOrSystem(Fl_Choice*, void*) {
|
|
|
|
refreshUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Menu_Item menu_wUserOrSystem[] = {
|
2015-07-09 05:09:33 +03:00
|
|
|
{"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},
|
2010-12-21 01:19:24 +03:00
|
|
|
{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();
|
2021-12-10 03:22:15 +03:00
|
|
|
global_settings_window->hide();
|
2010-12-21 01:19:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Fl_Double_Window* make_global_settings_window() {
|
2022-12-13 20:37:48 +03:00
|
|
|
{ global_settings_window = new Fl_Double_Window(400, 572, "FLTK Preferences");
|
2010-12-21 01:19:24 +03:00
|
|
|
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
|
2022-12-13 20:37:48 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 269, 380, 104, "Native File Chooser Options");
|
2014-09-30 17:06:35 +04:00
|
|
|
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:");
|
2020-07-01 19:03:10 +03:00
|
|
|
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.");
|
2014-09-30 17:06:35 +04:00
|
|
|
wGTKText->down_box(FL_BORDER_BOX);
|
|
|
|
wGTKText->callback((Fl_Callback*)cb_wGTKText);
|
|
|
|
wGTKText->menu(menu_wGTKText);
|
|
|
|
} // Fl_Choice* wGTKText
|
2022-12-13 20:37:48 +03:00
|
|
|
{ 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
|
2014-09-30 17:06:35 +04:00
|
|
|
o->end();
|
|
|
|
} // Fl_Group* o
|
2022-12-13 20:37:48 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 384, 380, 66, "Print dialog Options");
|
2019-09-15 16:57:29 +03:00
|
|
|
o->box(FL_GTK_DOWN_BOX);
|
|
|
|
o->labelfont(2);
|
|
|
|
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
|
2022-12-13 20:37:48 +03:00
|
|
|
{ wPrintGTKText = new Fl_Choice(245, 405, 100, 25, "Print dialog uses GTK:");
|
2019-09-15 16:57:29 +03:00
|
|
|
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
|
2022-12-13 20:37:48 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 459, 380, 66, "Scaling Factor Options");
|
2020-09-27 11:02:28 +03:00
|
|
|
o->box(FL_GTK_DOWN_BOX);
|
|
|
|
o->labelfont(2);
|
|
|
|
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
|
2022-12-13 20:37:48 +03:00
|
|
|
{ wShowZoomFactor = new Fl_Choice(245, 483, 100, 25, "Transiently show scaling factor:");
|
2020-09-27 11:02:28 +03:00
|
|
|
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
|
2022-12-13 20:37:48 +03:00
|
|
|
{ wUserOrSystem = new Fl_Choice(10, 535, 141, 25);
|
2010-12-21 01:19:24 +03:00
|
|
|
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
|
2022-12-13 20:37:48 +03:00
|
|
|
{ Fl_Button* o = new Fl_Button(230, 535, 75, 25, "Cancel");
|
2010-12-21 01:19:24 +03:00
|
|
|
o->callback((Fl_Callback*)cb_Cancel1);
|
|
|
|
} // Fl_Button* o
|
2022-12-13 20:37:48 +03:00
|
|
|
{ Fl_Button* o = new Fl_Button(315, 535, 75, 25, "OK");
|
2010-12-21 01:19:24 +03:00
|
|
|
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;
|
|
|
|
}
|