-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings_panel.fl
1883 lines (1848 loc) · 64.4 KB
/
settings_panel.fl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# data file for the Fltk User Interface Designer (fluid)
version 1.0401
header_name {.h}
code_name {.cxx}
snap {
ver 1
current_suite {FLUID (based on FLTK)}
current_preset 0
suite {
name {FLUID (based on FLTK)}
preset { 1
15 15 15 15 0 0
10 10 10 10 0 0
25 25
20 10 4 20 4 8
0 14 0 14
}
preset { 1
10 10 10 10 0 0
10 10 10 10 0 0
20 20
20 10 5 20 5 5
0 11 0 11
}
preset { 1
10 10 10 10 0 0
10 10 10 10 0 0
18 18
16 8 2 16 4 2
0 10 0 10
}
}
}
comment {//
// Setting and shell dialogs for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2023 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 "undo.h"} {private global
}
decl {\#include "widget_browser.h"} {public global
}
decl {\#include "Fd_Snap_Action.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 "fluid_filename.h"} {public local
}
decl {\#include <FL/fl_string_functions.h>} {public local
}
decl {\#include <FL/Fl_Scheme_Choice.H>} {public local
}
decl {\#include <FL/Fl_Preferences.H>} {private global
}
decl {\#include <FL/Fl_Tooltip.H>} {private global
}
decl {\#include <FL/fl_ask.H>} {private global
}
decl {\#include <string.h>} {private global
}
decl {\#include "../src/flstring.h"} {private global
}
decl {void init_scheme(void);} {
comment {// initialize the scheme from preferences} public global
}
decl {extern struct Fl_Menu_Item *dbmanager_item;} {public local
}
decl {extern void i18n_cb(Fl_Choice *,void *);} {public local
}
decl {void scheme_cb(Fl_Scheme_Choice *, void *);} {public local
}
decl {int w_settings_shell_list_selected;} {public local
}
Function {cb_Comments(Fl_Choice* o, void* v)} {open private return_type void
} {
code {Fl_Font *font = (Fl_Font*)o->user_data();
if (v == LOAD) {
o->value(*font);
} else {
*font = (int)o->value();
widget_browser->redraw();
widget_browser->save_prefs();
}} {}
}
Function {cb_Color_Chip(Fl_Button* o, void* v)} {open private return_type void
} {
code {Fl_Color *color = (Fl_Color*)o->user_data();
if (v == LOAD) {
o->color(*color);
o->redraw();
} else {
Fl_Color d = fl_show_colormap(*color);
*color = d;
o->color(d);
widget_browser->redraw();
widget_browser->save_prefs();
}} {}
}
Function {cb_Color_Choice(Fl_Menu_Button* o, void* v)} {open private return_type void
} {
code {if (v != LOAD) {
Fl_Color *color = (Fl_Color*)o->user_data();
Fl_Color d = (Fl_Color)(o->mvalue()->argument());
*color = d;
o->parent()->do_callback(o->parent(), LOAD);
widget_browser->redraw();
widget_browser->save_prefs();
}} {}
}
Function {make_script_panel()} {open
} {
Fl_Window script_panel {
label {Shell Script Editor}
callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape)
return; // ignore Escape
script_panel->hide(); // otherwise hide..} open
xywh {764 319 540 180} type Double labelsize 11 resizable
code0 {o->size_range(200, 150);} modal visible
} {
Fl_Text_Editor script_input {
xywh {10 10 520 130} box DOWN_BOX labelsize 11 when 13 textfont 4 textsize 11 resizable
code0 {script_input->buffer(new Fl_Text_Buffer);}
}
Fl_Group {} {
callback propagate_load open
xywh {10 150 520 20} labelsize 11
} {
Fl_Return_Button script_panel_ok {
label OK
xywh {400 150 60 20} labelsize 11 hotspot
}
Fl_Button script_panel_cancel {
label Cancel
xywh {470 150 60 20} labelsize 11
}
Fl_Box {} {
xywh {10 150 380 20} labelsize 11 resizable
}
}
}
code {// Enable line numbers
script_input->linenumber_width(60);
script_input->linenumber_size(script_input->Fl_Text_Display::textsize());} {}
}
Function {make_settings_window()} {open
} {
Fl_Window settings_window {
label {FLUID Settings} open
xywh {392 362 340 580} type Double align 80 resizable size_range {340 580 0 0} visible
} {
Fl_Tabs w_settings_tabs {
callback {propagate_load(o, v);} open
xywh {10 10 320 530} selection_color 12 labelsize 11 labelcolor 255 resizable
} {
Fl_Group w_settings_general_tab {
label General open selected
scale_image {36 24} image {icons/general_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 resizable
} {
Fl_Group {} {
callback {propagate_load(o, v);} open
xywh {120 78 130 25}
} {
Fl_Choice scheme_choice {
label {Scheme: }
callback scheme_cb open
xywh {120 78 120 25} down_box BORDER_BOX labelfont 1 labelsize 11
code0 {init_scheme();}
class Fl_Scheme_Choice
} {}
Fl_Box {} {
xywh {240 78 10 25} hide resizable
}
}
Fl_Box {} {
label {Options: }
xywh {120 115 0 20} labelfont 1 labelsize 11 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 {120 115 200 20} down_box DOWN_BOX labelsize 11
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 {120 135 200 20} down_box DOWN_BOX labelsize 11
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 {120 155 200 20} down_box DOWN_BOX labelsize 11
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 {120 175 200 20} down_box DOWN_BOX labelsize 11
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 {120 195 200 20} down_box DOWN_BOX labelsize 11
code1 {fluid_prefs.get("show_comments", show_comments, 1);}
code2 {show_comments_button->value(show_comments);}
}
Fl_Group {} {
callback {propagate_load(o, v);} open
xywh {120 225 50 20}
} {
Fl_Spinner recent_spinner {
label {\# Recent Files:}
callback {fluid_prefs.set("recent_files", recent_spinner->value());
load_history();}
xywh {120 225 40 20} labelfont 1 labelsize 11 when 1 maximum 10 textsize 11
code0 {int c;}
code1 {fluid_prefs.get("recent_files", c, 5);}
code2 {recent_spinner->maximum(10);}
code3 {recent_spinner->value(c);}
}
Fl_Box {} {
xywh {160 225 10 20} hide resizable
}
}
Fl_Check_Button use_external_editor_button {
label {Use for Code Nodes}
callback {G_use_external_editor = use_external_editor_button->value();
fluid_prefs.set("use_external_editor", G_use_external_editor);
redraw_browser();}
xywh {120 275 200 20} down_box DOWN_BOX labelsize 11
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 {External Editor:}
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 {120 255 200 20} labelfont 1 labelsize 11 when 1 textfont 4 textsize 11
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_Box {} {
label {Overlays: }
xywh {120 300 0 20} labelfont 1 labelsize 11 align 4
}
Fl_Check_Button guides_button {
label {Show Positioning Guides}
callback toggle_guides_cb
tooltip {show guides that help to position and resize widgets and enable snapping} xywh {120 300 200 20} down_box DOWN_BOX labelsize 11
code0 {o->value(show_guides);}
}
Fl_Check_Button restricted_button {
label {Show Restricted Areas}
callback toggle_restricted_cb
tooltip {show overlapping and out of bounds areas, show unfilled areas in Fl_Pack groups} xywh {120 320 200 20} down_box DOWN_BOX labelsize 11
code0 {o->value(show_restricted);}
}
Fl_Check_Button ghosted_outline_button {
label {Show Ghosted Group Outlines}
callback toggle_ghosted_outline_cb
tooltip {groups with no box type or flat boxtypes without contrast will be rendered with a dim outline in the editing window only} xywh {120 340 200 20} down_box DOWN_BOX labelsize 11
code0 {o->value(show_ghosted_outline);}
}
Fl_Box {} {
xywh {120 530 200 10} hide resizable
}
}
Fl_Group w_settings_project_tab {
label Project
callback {propagate_load(o, v);} open
scale_image {36 24} image {icons/document_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 hide
} {
Fl_Group {} {open
xywh {100 78 220 30}
} {
Fl_Box {} {
label {Use "name.ext" to set a file name
or just ".ext" to set extension.}
xywh {100 78 210 30} labelsize 11 align 148
}
Fl_Box {} {
xywh {310 78 10 30} hide resizable
}
}
Fl_Input header_file_input {
label {Header File:}
user_data 1 user_data_type {void*}
callback {if (v == LOAD) {
o->value(g_project.header_file_name.c_str());
} else {
if (strcmp(g_project.header_file_name.c_str(), o->value())) {
g_project.header_file_name = o->value();
set_modflag(1);
}
}}
tooltip {The name of the generated header file.} xywh {100 112 220 20} box THIN_DOWN_BOX labelfont 1 labelsize 11 when 1 textfont 4 textsize 11
}
Fl_Input code_file_input {
label {Code File:}
user_data 1 user_data_type {void*}
callback {if (v == LOAD) {
o->value(g_project.code_file_name.c_str());
} else {
if (strcmp(g_project.code_file_name.c_str(), o->value())) {
g_project.code_file_name = o->value();
set_modflag(1);
}
}}
tooltip {The name of the generated code file.} xywh {100 137 220 20} box THIN_DOWN_BOX labelfont 1 labelsize 11 when 1 textfont 4 textsize 11
}
Fl_Check_Button include_H_from_C_button {
label {Include Header from Code}
callback {if (v == LOAD) {
o->value(g_project.include_H_from_C);
} else {
if (g_project.include_H_from_C != o->value()) {
set_modflag(1);
g_project.include_H_from_C = o->value();
}
}}
tooltip {Include the header file from the code file.} xywh {100 162 220 20} down_box DOWN_BOX labelsize 11
}
Fl_Box {} {
label {Options: }
xywh {100 205 0 20} labelfont 1 labelsize 11 align 4
}
Fl_Check_Button use_FL_COMMAND_button {
label {Menu shortcuts use FL_COMMAND}
callback {if (v == LOAD) {
o->value(g_project.use_FL_COMMAND);
} else {
if (g_project.use_FL_COMMAND != o->value()) {
set_modflag(1);
g_project.use_FL_COMMAND = o->value();
}
}}
tooltip {Replace FL_CTRL and FL_META with FL_COMMAND when generating menu shortcuts} xywh {100 205 220 20} down_box DOWN_BOX labelsize 11
}
Fl_Check_Button utf8_in_src_button {
label {allow Unicode UTF-8 in source code}
callback {if (v == LOAD) {
o->value(g_project.utf8_in_src);
} else {
if (g_project.utf8_in_src != o->value()) {
set_modflag(1);
g_project.utf8_in_src = o->value();
}
}}
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 {100 230 220 20} down_box DOWN_BOX labelsize 11
}
Fl_Check_Button avoid_early_includes_button {
label {avoid early include of Fl.H}
callback {if (v == LOAD) {
o->value(g_project.avoid_early_includes);
} else {
if (g_project.avoid_early_includes != o->value()) {
set_modflag(1);
g_project.avoid_early_includes = o->value();
}
}}
tooltip {Do not emit \#include <FL//Fl.H> until it is needed by another include file.} xywh {100 255 220 20} down_box DOWN_BOX labelsize 11
}
Fl_Box {} {
label {Experimental: }
xywh {100 283 0 20} labelfont 1 labelsize 11 align 4 hide
}
Fl_Check_Button w_proj_mergeback {
label {generate MergeBack data}
callback {if (v == LOAD) {
o->value(g_project.write_mergeback_data);
} else {
if (g_project.write_mergeback_data != o->value()) {
set_modflag(1);
g_project.write_mergeback_data = o->value();
}
}}
comment {// Matt: disabled}
tooltip {MergeBack is a feature under construction that allows changes in code files to be merged back into the project file. Checking this option will generate additional data in code and project files.} xywh {100 283 220 20} down_box DOWN_BOX labelsize 11 hide
}
Fl_Box {} {
xywh {100 530 220 10} hide resizable
}
}
Fl_Group w_settings_layout_tab {
label Layout
callback {propagate_load(o, v);} open
scale_image {36 24} image {icons/layout_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 hide
} {
Fl_Box {} {
label {Layout:}
xywh {25 78 60 24} labelfont 1 labelsize 11 align 24
}
Fl_Choice layout_choice {
callback {if (v == LOAD) {
o->value(g_layout_list.current_suite());
} else {
int index = o->value();
g_layout_list.current_suite(index);
g_layout_list.update_dialogs();
}}
xywh {85 78 187 24} down_box BORDER_BOX
} {
MenuItem {} {
label FLTK
xywh {0 0 31 20}
}
MenuItem {} {
label Grid
xywh {0 0 31 20}
}
}
Fl_Button {} {
label {+}
callback {// Clone the current layout suite
if (v == LOAD) return;
Fl_String old_name = "Copy of ";
old_name.append(g_layout_list[g_layout_list.current_suite()].name_);
const char *new_name = fl_input("Enter a name for the new layout:", old_name.c_str());
if (new_name == NULL)
return;
g_layout_list.add(new_name);
g_layout_list.update_dialogs();}
xywh {272 78 24 24}
}
Fl_Menu_Button w_layout_menu {
callback {if (v == LOAD) {
Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
if (suite.storage_ == FD_STORE_INTERNAL) {
w_layout_menu_rename->deactivate();
for (int i=1; i<4; i++) w_layout_menu_storage[i]->deactivate();
w_layout_menu_delete->deactivate();
} else {
w_layout_menu_rename->activate();
for (int i=1; i<4; i++) w_layout_menu_storage[i]->activate();
w_layout_menu_delete->activate();
}
w_layout_menu_storage[suite.storage_]->setonly();
}} open
xywh {296 78 24 24}
} {
MenuItem w_layout_menu_rename {
label {Rename...}
callback {// Rename the current layout suite
Fl_String old_name = g_layout_list[g_layout_list.current_suite()].name_;
const char *new_name = fl_input("Enter a new name for the layout:", old_name.c_str());
if (new_name == NULL)
return;
g_layout_list.rename(new_name);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} divider
}
MenuItem {w_layout_menu_storage[0]} {
label {@fd_beaker FLUID Built-In}
callback {Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_INTERNAL);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio deactivate
}
MenuItem {w_layout_menu_storage[1]} {
label {@fd_user User Preference}
callback {Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_USER);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio
}
MenuItem {w_layout_menu_storage[2]} {
label {@fd_project Store in .fl Project File}
callback {Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_PROJECT);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio
}
MenuItem {w_layout_menu_storage[3]} {
label {@fd_file Store in External File}
callback {Fd_Layout_Suite &suite = g_layout_list[g_layout_list.current_suite()];
suite.storage(FD_STORE_FILE);
g_layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio divider
}
MenuItem w_layout_menu_load {
label {Load...}
callback {// Give the user a file chooser and load that file
Fl_Native_File_Chooser fnfc;
fnfc.title("Load Layout Settings:");
fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
fnfc.options(Fl_Native_File_Chooser::USE_FILTER_EXT);
fnfc.filter("FLUID Layouts\\t*.fll\\n");
if (fnfc.show() != 0) return;
const char *new_filename = fnfc.filename();
if (!new_filename) return;
g_layout_list.load(new_filename);
//g_layout_list.current_suite(n);
g_layout_list.update_dialogs();}
xywh {0 0 31 20}
}
MenuItem w_layout_menu_save {
label {Save...}
callback {// Give the user a file chooser with a suggested name
Fl_Native_File_Chooser fnfc;
fnfc.title("Save Layout Settings:");
fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE);
fnfc.options(Fl_Native_File_Chooser::SAVEAS_CONFIRM | Fl_Native_File_Chooser::USE_FILTER_EXT);
fnfc.filter("FLUID Layouts\\t*.fll\\n");
Fl_String filename = g_layout_list.filename_;
fnfc.directory(fl_filename_path(filename).c_str());
fnfc.preset_file(fl_filename_name(filename).c_str());
if (fnfc.show() != 0) return;
const char *new_filename = fnfc.filename();
if (!new_filename) return;
g_layout_list.filename_ = new_filename;
g_layout_list.save(new_filename);}
xywh {0 0 31 20} divider
code0 {\#include <FL/Fl_Native_File_Chooser.H>}
}
MenuItem w_layout_menu_delete {
label Delete
callback {// remove the current suite
g_layout_list.remove(g_layout_list.current_suite());
g_layout_list.update_dialogs();}
xywh {0 0 31 20}
}
}
Fl_Box {} {
label {Preset:}
xywh {25 107 60 20} labelfont 1 labelsize 11 align 24
}
Fl_Group {} {
callback propagate_load open
xywh {85 107 235 20} labelsize 11
} {
Fl_Button {preset_choice[0]} {
label Application
user_data 0 user_data_type long
callback edit_layout_preset_cb
xywh {85 107 78 20} type Radio value 1 selection_color 45 labelsize 11 compact 1
}
Fl_Button {preset_choice[1]} {
label Dialog
user_data 1 user_data_type long
callback edit_layout_preset_cb
xywh {163 107 79 20} type Radio selection_color 45 labelsize 11 compact 1
}
Fl_Button {preset_choice[2]} {
label Toolbox
user_data 2 user_data_type long
callback edit_layout_preset_cb
xywh {242 107 78 20} type Radio selection_color 45 labelsize 11 compact 1
}
}
Fl_Box {} {
label {---- Window ----}
xywh {85 132 235 20} labelfont 1 labelsize 11 align 20
}
Fl_Box {} {
label {Margins:}
xywh {25 167 60 20} labelsize 11 align 24
}
Fl_Value_Input {} {
label {Left:}
callback {if (v == LOAD) {
o->value((double)layout->left_window_margin);
} else {
layout->left_window_margin = (int)o->value();
}}
xywh {85 167 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Top:}
callback {if (v == LOAD) {
o->value((double)layout->top_window_margin);
} else {
layout->top_window_margin = (int)o->value();
}}
xywh {145 167 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Right:}
callback {if (v == LOAD) {
o->value((double)layout->right_window_margin);
} else {
layout->right_window_margin = (int)o->value();
}}
xywh {205 167 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Bottom:}
callback {if (v == LOAD) {
o->value((double)layout->bottom_window_margin);
} else {
layout->bottom_window_margin = (int)o->value();
}}
xywh {265 167 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Box {} {
label {Grid:}
xywh {32 201 53 20} labelsize 11 align 24
}
Fl_Value_Input {} {
label {Horizontal:}
callback {if (v == LOAD) {
o->value((double)layout->window_grid_x);
} else {
layout->window_grid_x = (int)o->value();
}}
xywh {85 201 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Vertical:}
callback {if (v == LOAD) {
o->value((double)layout->window_grid_y);
} else {
layout->window_grid_y = (int)o->value();
}}
xywh {145 201 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Box {} {
label {---- Group ----}
xywh {85 226 235 20} labelfont 1 labelsize 11 align 20
}
Fl_Box {} {
label {Margins:}
xywh {25 261 60 20} labelsize 11 align 24
}
Fl_Value_Input {} {
label {Left:}
callback {if (v == LOAD) {
o->value((double)layout->left_group_margin);
} else {
layout->left_group_margin = (int)o->value();
}}
xywh {85 261 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Top:}
callback {if (v == LOAD) {
o->value((double)layout->top_group_margin);
} else {
layout->top_group_margin = (int)o->value();
}}
xywh {145 261 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Right:}
callback {if (v == LOAD) {
o->value((double)layout->right_group_margin);
} else {
layout->right_group_margin = (int)o->value();
}}
xywh {205 261 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Bottom:}
callback {if (v == LOAD) {
o->value((double)layout->bottom_group_margin);
} else {
layout->bottom_group_margin = (int)o->value();
}}
xywh {265 261 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Box {} {
label {Grid:}
xywh {32 295 53 20} labelsize 11 align 24
}
Fl_Value_Input {} {
label {Horizontal:}
callback {if (v == LOAD) {
o->value((double)layout->group_grid_x);
} else {
layout->group_grid_x = (int)o->value();
}}
xywh {85 295 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Vertical:}
callback {if (v == LOAD) {
o->value((double)layout->group_grid_y);
} else {
layout->group_grid_y = (int)o->value();
}}
xywh {145 295 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Box {} {
label {---- Tabs ----}
xywh {85 320 235 20} labelfont 1 labelsize 11 align 20
}
Fl_Box {} {
label {Margins:}
xywh {25 355 60 20} labelsize 11 align 24
}
Fl_Value_Input {} {
label {Top:}
callback {if (v == LOAD) {
o->value((double)layout->top_tabs_margin);
} else {
layout->top_tabs_margin = (int)o->value();
}}
xywh {85 355 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Bottom:}
callback {if (v == LOAD) {
o->value((double)layout->bottom_tabs_margin);
} else {
layout->bottom_tabs_margin = (int)o->value();
}}
xywh {145 355 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Box {} {
label {---- Widget ----}
xywh {85 380 235 20} labelfont 1 labelsize 11 align 20
}
Fl_Box {} {
label {Horizontal:}
xywh {25 415 60 20} labelsize 11 align 24
}
Fl_Value_Input {} {
label {Minimum:}
callback {if (v == LOAD) {
o->value((double)layout->widget_min_w);
} else {
layout->widget_min_w = (int)o->value();
}}
xywh {85 414 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Increment:}
callback {if (v == LOAD) {
o->value((double)layout->widget_inc_w);
} else {
layout->widget_inc_w = (int)o->value();
}}
xywh {145 414 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
label {Gap:}
callback {if (v == LOAD) {
o->value((double)layout->widget_gap_x);
} else {
layout->widget_gap_x = (int)o->value();
}}
xywh {205 414 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Box {} {
label {Vertical:}
xywh {32 440 53 20} labelsize 11 align 24
}
Fl_Value_Input {} {
callback {if (v == LOAD) {
o->value((double)layout->widget_min_h);
} else {
layout->widget_min_h = (int)o->value();
}}
xywh {85 440 55 20} labelsize 11 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
callback {if (v == LOAD) {
o->value((double)layout->widget_inc_h);
} else {
layout->widget_inc_h = (int)o->value();
}}
xywh {145 440 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Value_Input {} {
callback {if (v == LOAD) {
o->value((double)layout->widget_gap_y);
} else {
layout->widget_gap_y = (int)o->value();
}}
xywh {205 440 55 20} labelsize 11 align 5 maximum 32767 step 1 textsize 11
}
Fl_Group {} {
label {Label Font:}
callback propagate_load open
xywh {85 465 201 20} labelsize 11 align 4
} {
Fl_Choice {} {
callback {if (v == LOAD) {
o->value(layout->labelfont+1);
} else {
layout->labelfont = (int)o->value()-1;
}} open
tooltip {The style of the label text.} xywh {85 465 150 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item fontmenu_w_default[];}
code1 {o->menu(fontmenu_w_default);}
} {}
Fl_Value_Input {} {
callback {if (v == LOAD) {
o->value(layout->labelsize);
} else {
layout->labelsize = (int)o->value();
}}
tooltip {The size of the label text.} xywh {235 465 50 20} labelsize 11 minimum 1 maximum 1000 step 1 value 14 textsize 11
}
}
Fl_Group {} {
label {Text Font:}
callback propagate_load open
xywh {85 490 200 20} labelsize 11 align 4
} {
Fl_Choice {} {
callback {if (v == LOAD) {
o->value(layout->textfont+1);
} else {
layout->textfont = (int)o->value()-1;
}} open
tooltip {The value text style.} xywh {85 490 150 20} box DOWN_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11
code0 {extern Fl_Menu_Item fontmenu_w_default[];}
code1 {o->menu(fontmenu_w_default);}
} {}
Fl_Value_Input {} {
callback {if (v == LOAD) {
o->value(layout->textsize);
} else {
layout->textsize = (int)o->value();
}}
tooltip {The value text size.} xywh {235 490 50 20} labelsize 11 maximum 1000 step 1 value 14 textsize 11
}
}
Fl_Box {} {
xywh {325 535 5 5} hide resizable
}
}
Fl_Group w_settings_shell_tab {
label Shell
callback propagate_load open
scale_image {36 24} image {icons/shell_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 hide
} {
Fl_Group {} {
callback propagate_load open
xywh {10 90 320 132}
} {
Fl_Browser w_settings_shell_list {
label {Shell
command
list:}
callback {if (v == LOAD) {
// load from g_shell_config
if (g_shell_config) {
o->clear();
w_settings_shell_list_selected = 0;
for (int i=0; i<g_shell_config->list_size; i++) {
Fd_Shell_Command *cmd = g_shell_config->list[i];
o->add(cmd->name.c_str());
if (cmd->storage == FD_STORE_USER)
o->icon(i+1, w_settings_shell_fd_user->image());
else if (cmd->storage == FD_STORE_PROJECT)
o->icon(i+1, w_settings_shell_fd_project->image());
}
}
} else {
// int prev_selected = w_settings_shell_list_selected;
w_settings_shell_list_selected = 0;
int selected = w_settings_shell_list->value();
if (selected) {
if (w_settings_shell_list->selected(selected))
w_settings_shell_list_selected = selected;
}
w_settings_shell_cmd->do_callback(w_settings_shell_cmd, LOAD);
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
}}
xywh {100 90 220 110} type Multi labelfont 1 labelsize 11 align 4 textsize 13 resizable
}
Fl_Group w_settings_shell_toolbox {
callback {if (v==LOAD) {
propagate_load(o, v);
}} open
xywh {100 200 220 22}
} {
Fl_Button {} {
label {+}
callback {if (v != LOAD) {
int selected = w_settings_shell_list_selected;
Fd_Shell_Command *cmd = new Fd_Shell_Command("new shell command");
g_shell_config->insert(selected, cmd);
w_settings_shell_list->insert(selected+1, cmd->name.c_str());
w_settings_shell_list->deselect();
w_settings_shell_list->value(selected+1);
if (cmd->storage == FD_STORE_USER) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_user->image());
} else if (cmd->storage == FD_STORE_PROJECT) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_project->image());
set_modflag(1);
}
w_settings_shell_list->do_callback();
w_settings_shell_cmd->do_callback(w_settings_shell_cmd, LOAD);
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
g_shell_config->rebuild_shell_menu();
}}
tooltip {insert a new shell command into the list after the selected command} xywh {100 200 24 22} labelfont 1 labelsize 11
}
Fl_Button w_settings_shell_dup {
label {++}
callback {int selected = w_settings_shell_list_selected;
if (v==LOAD) {
if (selected) {
o->activate();
} else {
o->deactivate();
}
} else {
if (!selected) return;
Fd_Shell_Command *cmd = new Fd_Shell_Command(g_shell_config->list[selected-1]);
g_shell_config->insert(selected, cmd);
w_settings_shell_list->insert(selected+1, cmd->name.c_str());
w_settings_shell_list->deselect();
w_settings_shell_list->value(selected+1);
if (cmd->storage == FD_STORE_USER) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_user->image());
} else if (cmd->storage == FD_STORE_PROJECT) {
w_settings_shell_list->icon(selected+1, w_settings_shell_fd_project->image());
set_modflag(1);
}
w_settings_shell_list->do_callback();
w_settings_shell_cmd->do_callback(w_settings_shell_cmd, LOAD);
w_settings_shell_toolbox->do_callback(w_settings_shell_toolbox, LOAD);
g_shell_config->rebuild_shell_menu();
}}
tooltip {duplicate the selected shell command and insert it into the list} xywh {124 200 24 22} labelfont 1 labelsize 11 deactivate
}
Fl_Button w_settings_shell_remove {
label DEL
callback {int selected = w_settings_shell_list_selected;
if (v==LOAD) {
if (selected) {
o->activate();
} else {
o->deactivate();
}
} else {
if (!selected) return;