2002-05-01 19:55:07 +04:00
# data file for the Fltk User Interface Designer (fluid)
2010-11-12 14:55:10 +03:00
version 1.0300
2002-05-01 19:55:07 +04:00
header_name {.h}
2002-06-27 08:29:39 +04:00
code_name {.cxx}
2010-11-12 14:55:10 +03:00
decl {\#include <FL/Fl_Preferences.H>} {public local
2006-04-04 16:24:36 +04:00
}
2010-11-12 14:55:10 +03:00
decl {\#include <stdio.h>} {public local
2006-04-04 16:24:36 +04:00
}
2010-11-12 14:55:10 +03:00
decl {\#include <stdlib.h>} {private local
}
2006-04-04 16:24:36 +04:00
2010-11-12 14:55:10 +03:00
decl {\#include <FL/filename.H>} {private local
}
2006-04-04 16:24:36 +04:00
2010-11-12 14:55:10 +03:00
decl {\#include <FL/fl_ask.H>} {private local
}
2006-04-04 16:24:36 +04:00
2010-12-12 22:52:26 +03:00
decl {int opt[10][2];} {
comment {Copy of all options in user and system mode} private local
2006-04-04 16:24:36 +04:00
}
2010-12-12 22:52:26 +03:00
Function {refreshUI()} {
comment {Update the UI using the values in the opt array} 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]);} {}
2006-04-04 16:24:36 +04:00
}
2010-12-12 22:52:26 +03:00
Function {readPrefs()} {
comment {read all preferences and refresh the GUI} return_type void
2006-04-04 16:24:36 +04:00
} {
2010-12-12 22:52:26 +03:00
code {// read all preferences and refresh the GUI
{
Fl_Preferences prefs(Fl_Preferences::SYSTEM, "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);
}
{
Fl_Preferences prefs(Fl_Preferences::USER, "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);
}
refreshUI();} {}
2006-04-04 16:24:36 +04:00
}
2010-12-12 22:52:26 +03:00
Function {writePrefs()} {
comment {write all preferences using the array} return_type void
2002-05-01 19:55:07 +04:00
} {
2010-12-12 22:52:26 +03:00
code {// write all preferences using the array
{
Fl_Preferences prefs(Fl_Preferences::SYSTEM, "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]);
}
{
Fl_Preferences prefs(Fl_Preferences::USER, "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]);
}} {}
2006-04-04 16:24:36 +04:00
}
2010-12-12 22:52:26 +03:00
Function {} {
comment {create the user interface and launch} selected return_type int
2006-04-04 16:24:36 +04:00
} {
Fl_Window myWindow {
2010-12-12 22:52:26 +03:00
label {FLTK Preferences}
callback {Fl::delete_widget(myWindow);} open
xywh {424 200 403 317} type Double color 50 visible
2002-05-01 19:55:07 +04:00
} {
2006-04-04 16:24:36 +04:00
Fl_Group {} {
2010-12-12 22:52:26 +03:00
label {Keyboard Focus Options} open
xywh {10 10 380 100} box GTK_DOWN_BOX labelfont 2 align 21
2002-05-01 19:55:07 +04:00
} {
2010-12-12 22:52:26 +03:00
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.
On by default.} xywh {245 40 100 25} down_box BORDER_BOX
2006-04-04 16:24:36 +04:00
} {
MenuItem {} {
2010-12-12 22:52:26 +03:00
label off
user_data 0 user_data_type long
xywh {10 10 31 20}
2006-04-04 16:24:36 +04:00
}
MenuItem {} {
2010-12-12 22:52:26 +03:00
label on
user_data 1 user_data_type long
xywh {10 10 31 20} divider
2006-04-04 16:24:36 +04:00
}
MenuItem {} {
2010-12-12 22:52:26 +03:00
label default
user_data 2 user_data_type long
xywh {10 10 31 20}
2006-04-04 16:24:36 +04:00
}
2010-12-12 22:52:26 +03:00
}
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 a text in a text widget will change focus to the next text widgt. When switched off, the cursor will stop at the end of the text. Pressing Tab or Ctrl-Tab will advance the keyboard focus.
Default is off.} xywh {245 75 100 25} down_box BORDER_BOX
} {
2006-04-04 16:24:36 +04:00
MenuItem {} {
2010-12-12 22:52:26 +03:00
label off
user_data 0 user_data_type long
xywh {0 0 31 20}
2006-04-04 16:24:36 +04:00
}
MenuItem {} {
2010-12-12 22:52:26 +03:00
label on
user_data 1 user_data_type long
xywh {0 0 31 20} divider
2006-04-04 16:24:36 +04:00
}
MenuItem {} {
2010-12-12 22:52:26 +03:00
label default
user_data 2 user_data_type long
xywh {0 0 31 20}
2006-04-04 16:24:36 +04:00
}
}
}
Fl_Group {} {
2010-12-12 22:52:26 +03:00
label {Tooltip Options} open
xywh {10 120 380 65} box GTK_DOWN_BOX labelfont 2 align 21
2006-04-04 16:24:36 +04:00
} {
2010-12-12 22:52:26 +03:00
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 tootip 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
2006-04-04 16:24:36 +04:00
} {
MenuItem {} {
2010-12-12 22:52:26 +03:00
label off
user_data 0 user_data_type long
xywh {10 10 31 20}
2006-04-04 16:24:36 +04:00
}
MenuItem {} {
2010-12-12 22:52:26 +03:00
label on
user_data 1 user_data_type long
xywh {10 10 31 20} divider
2006-04-04 16:24:36 +04:00
}
MenuItem {} {
2010-12-12 22:52:26 +03:00
label default
user_data 2 user_data_type long
xywh {10 10 31 20}
2006-04-04 16:24:36 +04:00
}
}
2010-12-12 22:52:26 +03:00
}
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
2006-04-04 16:24:36 +04:00
} {
MenuItem {} {
2010-12-12 22:52:26 +03:00
label off
user_data 0 user_data_type long
xywh {30 30 31 20}
2006-04-04 16:24:36 +04:00
}
MenuItem {} {
2010-12-12 22:52:26 +03:00
label on
user_data 1 user_data_type long
xywh {30 30 31 20} divider
2006-04-04 16:24:36 +04:00
}
MenuItem {} {
2010-12-12 22:52:26 +03:00
label default
user_data 2 user_data_type long
xywh {30 30 31 20}
2006-04-04 16:24:36 +04:00
}
}
2010-12-12 22:52:26 +03:00
}
Fl_Choice wUserOrSystem {
callback {refreshUI();} open
tooltip {Change settings for the current user, or for all users of this computer.} xywh {14 275 141 25} down_box BORDER_BOX
} {
MenuItem {} {
label {User Settings}
user_data 0 user_data_type long
xywh {0 0 31 20}
2006-04-04 16:24:36 +04:00
}
2010-12-12 22:52:26 +03:00
MenuItem {} {
label {System Settings}
user_data 1 user_data_type long
xywh {0 0 31 20}
2002-05-01 19:55:07 +04:00
}
}
2010-12-12 22:52:26 +03:00
Fl_Button {} {
label Cancel
callback {Fl::delete_widget(myWindow);}
xywh {230 275 75 25}
}
Fl_Button {} {
label OK
callback {writePrefs();
Fl::delete_widget(myWindow);}
xywh {315 275 75 25}
}
2002-05-01 19:55:07 +04:00
}
2006-04-04 16:24:36 +04:00
code {readPrefs();} {}
2002-05-01 19:55:07 +04:00
}