-
Notifications
You must be signed in to change notification settings - Fork 66
/
Preferences.pb
5994 lines (5069 loc) · 252 KB
/
Preferences.pb
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
; --------------------------------------------------------------------------------------------
; Copyright (c) Fantaisie Software. All rights reserved.
; Dual licensed under the GPL and Fantaisie Software licenses.
; See LICENSE and LICENSE-FANTAISIE in the project root for license information.
; --------------------------------------------------------------------------------------------
Global SelectedLanguage, PreferenceFontName$, PreferenceFontSize, PreferenceFontStyle
Global PreferenceToolsPanelFrontColor, PreferenceToolsPanelBackColor, PreferenceToolsPanelFont$
Global PreferenceToolsPanelFontSize, PreferenceToolsPanelFontStyle
Global PreferenceDebugOutFont$, PreferenceDebugOutFontSize, PreferenceDebugOutFontStyle
Global PreferenceIssueColor
Global Preferences_ImportFile$, Preferences_ExportFile$
Global PreferenceCurrentPage, IsApplyPreferences
Global NewList PreferenceCompilers.Compiler()
Procedure LoadDialogPosition(*Position.DialogPosition, x=-1, y=-1, Width=0, Height=0, Prefix$="")
*Position\x = ReadPreferenceLong(Prefix$+"X", x)
*Position\y = ReadPreferenceLong(Prefix$+"Y", y)
*Position\Width = ReadPreferenceLong(Prefix$+"Width", Width)
*Position\Height = ReadPreferenceLong(Prefix$+"Height", Height)
*Position\IsMaximized = ReadPreferenceLong(Prefix$+"IsMaximized", 0)
EndProcedure
; SaveType: 0-save position only, 1-include width/height, 2-include maximize state
;
Procedure SaveDialogPosition(*Position.DialogPosition, SaveType=0, Prefix$="")
WritePreferenceLong(Prefix$+"X", *Position\x)
WritePreferenceLong(Prefix$+"Y", *Position\y)
If SaveType > 0
WritePreferenceLong(Prefix$+"Width", *Position\Width)
WritePreferenceLong(Prefix$+"Height", *Position\Height)
If SaveType > 1
WritePreferenceLong(Prefix$+"IsMaximized", *Position\IsMaximized)
EndIf
EndIf
EndProcedure
Procedure UpdateImageColorGadget(Gadget, Image, Color)
If StartDrawing(ImageOutput(Image))
Width = OutputWidth() ; Don't use hardcoded value to be DPI compliant
Height = OutputHeight()
Box(0, 0, Width, Height, $000000)
Box(1, 1, Width-2, Height-2, Color)
StopDrawing()
; Update the gadget containing this image
SetGadgetState(Gadget, ImageID(Image))
EndIf
EndProcedure
Procedure UpdatePreferenceSyntaxColor(ColorIndex, Color)
UpdateImageColorGadget(#GADGET_Preferences_FirstColor+ColorIndex, #IMAGE_Preferences_FirstColor+ColorIndex, Color)
EndProcedure
Procedure LoadPreferences()
OpenPreferences(PreferencesFile$)
;- - Global
PreferenceGroup("Global")
PrefsVersion = ReadPreferenceLong ("Version", 0)
AutoReload = ReadPreferenceLong ("AutoReload" , 1)
MemorizeWindow = ReadPreferenceLong ("MemorizeWindow" , 1)
CurrentLanguage$ = ReadPreferenceString("CurrentLanguage" , "English")
LanguageFile$ = ReadPreferenceString("LanguageFile" , "")
CurrentTheme$ = ReadPreferenceString("CurrentTheme" , "SilkTheme.zip")
EnableBraceMatch = ReadPreferenceLong ("EnableBraceMatch" , 1)
EnableKeywordMatch = ReadPreferenceLong ("EnableKeywordMatch", 1)
EnableKeywordBolding = ReadPreferenceLong ("EnableKeywordBolding", 1)
EnableCaseCorrection = ReadPreferenceLong ("EnableCaseCorrection", 1)
EnableLineNumbers = ReadPreferenceLong ("EnableLineNumbers" , 1)
EnableAccessibility = ReadPreferenceLong ("EnableAccessibility" , 0)
ShowWhiteSpace = ReadPreferenceLong ("ShowWhiteSpace" , 0)
ShowIndentGuides = ReadPreferenceLong ("ShowIndentGuides" , 0)
UseTabIndentForSplittedLines = ReadPreferenceLong ("UseTabIndentForSplittedLines", 0)
AutoSave = ReadPreferenceLong ("AutoSave" , 1)
AutoSaveAll = ReadPreferenceLong ("AutoSaveAll" , 1)
SaveProjectSettings = ReadPreferenceLong ("SaveSettingsMode" , #SAVESETTINGS_EndOfFile)
Editor_RunOnce = ReadPreferenceLong ("RunOnce" , 1)
ShowMainToolbar = ReadPreferenceLong ("ShowToolbar" , 1)
TabLength = ReadPreferenceLong ("TabLength" , 2)
RealTab = ReadPreferenceLong ("RealTab" , 0)
MemorizeCursor = ReadPreferenceLong ("MemorizeCursor" , 1)
MemorizeMarkers = ReadPreferenceLong ("MemorizeMarkers" , 1)
SelectedFilePattern = ReadPreferenceLong ("LastFilePattern" , 0)
DisplayFullPath = ReadPreferenceLong ("DisplayFullPath" , 0)
DisplayDarkMode = ReadPreferenceLong ("DisplayDarkMode" , 1)
NoSplashScreen = ReadPreferenceLong ("NoSplashScreen" , 0)
AlwaysHideLog = ReadPreferenceLong ("AlwaysHideLog" , 0)
ShowCompilerProgress = ReadPreferenceLong ("ShowCompilerProgress", 0)
UseHelpToolF1 = ReadPreferenceLong ("UseHelpToolF1" , 1)
MonitorFileChanges = ReadPreferenceLong ("MonitorFileChanges", 1)
UpdateCheckInterval = ReadPreferenceLong ("UpdateCheckInterval", #UPDATE_Interval_Weekly)
UpdateCheckVersions = ReadPreferenceLong ("UpdateCheckVersions", #UPDATE_Version_Final)
LastUpdateCheck = ReadPreferenceLong ("LastUpdateCheck", 0)
EnableMenuIcons = ReadPreferenceLong ("EnableMenuIcons", 1)
ScreenReaderChecked = ReadPreferenceLong ("ScreenReaderChecked", 0)
; Force a default starting zoom
CurrentZoom = #ZOOM_Default
; Removed options: always enabled now (todo: remove the old code later)
EnableColoring = 1
EnableMarkers = 1
If SourcePathSet = 0 ; only load this if not already set by commandline
CompilerIf #SpiderBasic
If PrefsVersion > 541 Or #CompileWindows = 0 ; We changed the default example path on Windows for SpiderBasic 2.00, so we invalidate previous pref to update it
SourcePath$ = ReadPreferenceString("SourceDirectory", SourcePath$)
EndIf
CompilerElse
SourcePath$ = ReadPreferenceString("SourceDirectory", SourcePath$)
CompilerEndIf
EndIf
;- - Editor
PreferenceGroup("Editor")
CompilerIf #CompileLinux
IsWindowMaximized = ReadPreferenceLong("IsWindowMaximized" , 0) ; On Raspberry and some X server, maximize doesn't work as expected and loop (and crash)
CompilerElse
IsWindowMaximized = ReadPreferenceLong("IsWindowMaximized" , 1) ; Default to maximized window, so we have a clean launch if no pref file exists
CompilerEndIf
EditorWindowX = ReadPreferenceLong("X" , 80) ; to not be directly at the OSX menubar!
EditorWindowY = ReadPreferenceLong("Y" , 80)
EditorWindowWidth = ReadPreferenceLong("Width" , 600)
EditorWindowHeight = ReadPreferenceLong("Height", 420)
Memorize_EditorWidth = EditorWindowWidth ; save the values, as they get changed on resizing
Memorize_EditorHeight = EditorWindowHeight ; for the MemorizeWindow setting
Save_EditorWidth = EditorWindowWidth ; for the MAximized saving fix
Save_EditorHeight = EditorWindowHeight
Save_EditorX = EditorWindowX
Save_EditorY = EditorWindowY
FilesPanelMultiline = ReadPreferenceLong("FilesPanelMultiline", #False)
FilesPanelCloseButtons = ReadPreferenceLong("FilesPanelCloseButtons", #True)
FilesPanelNewButton = ReadPreferenceLong("FilesPanelNewButton", #False)
CodeFileExtensions$ = ReadPreferenceString("CodeFileExtensions", "")
ExtraWordChars$ = ReadPreferenceString("ExtraWordChars", #WORDCHARS_Default)
; Init the color values with the PB defaults
;
Restore DefaultColorSchemes
Read.s SchemeName$
Read.l ToolsPanelFrontColor
Read.l ToolsPanelBackColor
For i = 0 To #COLOR_Last
Read.l Colors(i)\UserValue
Next i
CompilerIf #CompileWindows
; On Windows, default to the system colors for this, as Screen readers rely on it.
; NOTE: The Accessibility color scheme uses -1 here to indicate that the syscolors
; should always be used.
;
; If EnableAccessibility is set then it also forces the sys colors
;
Colors(#COLOR_Selection)\UserValue = GetSysColor_(#COLOR_HIGHLIGHT)
Colors(#COLOR_SelectionFront)\UserValue = GetSysColor_(#COLOR_HIGHLIGHTTEXT)
CompilerEndIf
; Load the real color values
;
Restore ColorKeys
For i = 0 To #COLOR_Last
Read.s ColorKey$
Colors(i)\UserValue = ReadPreferenceLong(ColorKey$, Colors(i)\UserValue)
; this key only exists for disabled colors, so to have the defaultvalue at 0 is important
If ReadPreferenceLong(ColorKey$+"_Disabled", 0)
Colors(i)\Enabled = 0
;
; NOTE: This test is BAD, as when no preferences are present, no keys are there,
; so all colors are disabled for new installations which is not good.
;
; ElseIf ReadPreferenceString(ColorKey$, "---missing---") = "---missing---" ; test if this even exists (read as a string for a bullitproof test)
; Colors(i)\Enabled = 0 ; color is not yet present at all (old prefs file)
Else
Colors(i)\Enabled = 1
EndIf
Next i
; calc which colors are actually used for display
CalculateHighlightingColors()
EditorFontName$ = ReadPreferenceString("EditorFontName", DefaultEditorFontName$)
EditorFontSize = ReadPreferenceLong ("EditorFontSize", #DEFAULT_EditorFontSize)
EditorFontStyle$ = ReadPreferenceString("EditorFontStyle","None")
CompilerIf #CompileMac
; While the font setting was ignored, this stored the GdkFont value because nobody ever changed it
; So if we find this setting, set it to the default so we have a good default font in these cases
If EditorFontName$ = "-*-fixed-medium-r-normal-*-*-120-*-*-*-*-*-*"
EditorFontName$ = DefaultEditorFontName$
EditorFontSize = #DEFAULT_EditorFontSize
EndIf
CompilerEndIf
EditorFontStyle = 0
If FindString(UCase(EditorFontStyle$),"BOLD",1)
EditorFontStyle | #PB_Font_Bold
EndIf
If FindString(UCase(EditorFontStyle$),"ITALIC",1)
EditorFontStyle | #PB_Font_Italic
EndIf
;- - Folding
PreferenceGroup("Folding")
EnableFolding = ReadPreferenceLong("EnableFolding", 1)
; default
NbFoldStartWords = 10
NbFoldEndWords = 7
FoldStart$(1) = ";{"
FoldStart$(2) = "Macro"
FoldStart$(3) = "Procedure"
FoldStart$(4) = "ProcedureC"
FoldStart$(5) = "ProcedureDLL"
FoldStart$(6) = "ProcedureCDLL"
FoldStart$(7) = "Module"
FoldStart$(8) = "DeclareModule"
FoldStart$(9) = "CompilerIf"
CompilerIf #SpiderBasic
FoldStart$(10) = "EnableJS"
CompilerElse
FoldStart$(10) = "EnableASM"
CompilerEndIf
FoldEnd$(1) = ";}"
FoldEnd$(2) = "EndMacro"
FoldEnd$(3) = "EndProcedure"
FoldEnd$(4) = "EndModule"
FoldEnd$(5) = "EndDeclareModule"
FoldEnd$(6) = "CompilerEndIf"
CompilerIf #SpiderBasic
FoldEnd$(7) = "DisableJS"
CompilerElse
FoldEnd$(7) = "DisableASM"
CompilerEndIf
NbFoldStartWords = ReadPreferenceLong("StartWords", NbFoldStartWords)
NbFoldEndWords = ReadPreferenceLong("EndWords", NbFoldEndWords)
For i = 1 To NbFoldStartWords
FoldStart$(i) = ReadPreferenceString("Start_"+Str(i), FoldStart$(i))
Next i
For i = 1 To NbFoldEndWords
FoldEnd$(i) = ReadPreferenceString("End_"+Str(i), FoldEnd$(i))
Next i
; If new keywords are added to the language, they should be handled like this:
; So the previous list by the user is properly extended
If PrefsVersion > 0 And PrefsVersion < 520 ; Only add this if there was a pref file, if not it's already in the default arrays
; Module, DeclareModule added in 5.20
NbFoldStartWords+1 : FoldStart$(NbFoldStartWords) = "Module"
NbFoldStartWords+1 : FoldStart$(NbFoldStartWords) = "DeclareModule"
NbFoldEndWords+1 : FoldEnd$(NbFoldEndWords) = "EndModule"
NbFoldEndWords+1 : FoldEnd$(NbFoldEndWords) = "EndDeclareModule"
EndIf
BuildFoldingVT()
;- - Indentation
PreferenceGroup("Indentation")
IndentMode = ReadPreferenceLong("IndentMode", #INDENT_Sensitive)
BackspaceUnindent = ReadPreferenceLong("BackspaceUnindent", 1)
NbIndentKeywords = ReadPreferenceLong("NbKeywords", 0)
If PrefsVersion < 450 Or NbIndentKeywords = 0
; The feature was added in 4.50, so add our default list here
Restore DefaultIndentList
Read.l NbIndentKeywords
Dim IndentKeywords.IndentEntry(NbIndentKeywords)
For i = 0 To NbIndentKeywords-1
Read.s IndentKeywords(i)\Keyword$
Read.l IndentKeywords(i)\Before
Read.l IndentKeywords(i)\After
Next i
Else
; Load existing list
Dim IndentKeywords.IndentEntry(NbIndentKeywords)
; Note: we need to exclude all duplicate keywords (can happens if an old PB version is used with the same pref (new keywords will be added again)
;
;
NbUniqueIndentKeywords = 0
For i = 0 To NbIndentKeywords-1
IndentKeyword$ = ReadPreferenceString("Keyword_"+Str(i), "")
If LCase(IndentKeyword$) <> LCase(PreviousIndentKeyword$)
IndentKeywords(NbUniqueIndentKeywords)\Keyword$ = IndentKeyword$
IndentKeywords(NbUniqueIndentKeywords)\Before = ReadPreferenceLong("Before_"+Str(i), 0)
IndentKeywords(NbUniqueIndentKeywords)\After = ReadPreferenceLong("After_"+Str(i), 0)
PreviousIndentKeyword$ = IndentKeyword$
NbUniqueIndentKeywords+1
EndIf
Next i
NbIndentKeywords = NbUniqueIndentKeywords
ReDim IndentKeywords(NbIndentKeywords+1)
EndIf
; If new keywords are added to the language, they should be handled like this:
; So the previous list by the user is properly extended
If PrefsVersion < 510
; CompilerElseIf added in 5.10
ReDim IndentKeywords.IndentEntry(NbIndentKeywords+1)
IndentKeywords(NbIndentKeywords)\Keyword$ = "CompilerElseIf"
IndentKeywords(NbIndentKeywords)\Before = -1
IndentKeywords(NbIndentKeywords)\After = 1
NbIndentKeywords+1
EndIf
If PrefsVersion < 520
; CompilerElseIf added in 5.10
ReDim IndentKeywords.IndentEntry(NbIndentKeywords+4)
IndentKeywords(NbIndentKeywords)\Keyword$ = "DeclareModule"
IndentKeywords(NbIndentKeywords)\Before = 0
IndentKeywords(NbIndentKeywords)\After = 1
NbIndentKeywords+1
IndentKeywords(NbIndentKeywords)\Keyword$ = "EndDeclareModule"
IndentKeywords(NbIndentKeywords)\Before = -1
IndentKeywords(NbIndentKeywords)\After = 0
NbIndentKeywords+1
IndentKeywords(NbIndentKeywords)\Keyword$ = "Module"
IndentKeywords(NbIndentKeywords)\Before = 0
IndentKeywords(NbIndentKeywords)\After = 1
NbIndentKeywords+1
IndentKeywords(NbIndentKeywords)\Keyword$ = "EndModule"
IndentKeywords(NbIndentKeywords)\Before = -1
IndentKeywords(NbIndentKeywords)\After = 0
NbIndentKeywords+1
EndIf
If PrefsVersion < 540
ReDim IndentKeywords.IndentEntry(NbIndentKeywords+1)
IndentKeywords(NbIndentKeywords)\Keyword$ = "EnumerationBinary"
IndentKeywords(NbIndentKeywords)\Before = 0
IndentKeywords(NbIndentKeywords)\After = 1
NbIndentKeywords+1
EndIf
; Sort and index the values
BuildIndentVT()
;- - Projects
PreferenceGroup("Projects")
DefaultProjectFile$ = ReadPreferenceString("DefaultProject", "")
LoadDialogPosition(@ProjectOptionsPosition, -1, -1, 0, 0, "ProjectOptions") ; will get a minimum size anyway, so no default w/h
;- - Form
PreferenceGroup("Form")
FormVariable = ReadPreferenceLong("Variable", 1)
FormVariableCaption = ReadPreferenceLong("VariableCaption", 0)
FormGrid = ReadPreferenceLong("Grid", 1)
FormGridSize = ReadPreferenceLong("GridSize", 10)
FormEventProcedure = ReadPreferenceLong("EventProcedure", 1)
FormSkin = ReadPreferenceLong("FormSkin", #PB_Compiler_OS)
Select OSVersion()
Case #PB_OS_Windows_Future
FormSkinVersion = ReadPreferenceLong("FormSkinVersion", 8)
Default
FormSkinVersion = ReadPreferenceLong("FormSkinVersion", 7)
EndSelect
;- - EditHistory
PreferenceGroup("EditHistory")
EnableHistory = ReadPreferenceLong("Enable", 1)
HistoryTimer = ReadPreferenceLong("Timer", 5)
HistoryMaxFileSize = ReadPreferenceLong("MaxFileSize", 2*1024*1024) ; 2mb max
HistoryPurgeMode = ReadPreferenceLong("PurgeMode", 2) ; purge by days
MaxSessionDays = ReadPreferenceLong("MaxDays", 30)
MaxSessionCount = ReadPreferenceLong("MaxCount", 20)
LoadDialogPosition(@EditHistoryPosition, -1, -1, 800, 600, "Window")
EditHistorySplitter = ReadPreferenceLong("WindowSplitter", 300)
;- - Issues
PreferenceGroup("Issues")
IssueMultiFile = ReadPreferenceLong("MultiFile", 1)
SelectedIssue = ReadPreferenceLong("Selected", 0) ; means display all issues
IssuesCol1 = ReadPreferenceLong("ColSize1", 60)
IssuesCol2 = ReadPreferenceLong("ColSize2", 250)
IssuesCol3 = ReadPreferenceLong("ColSize3", 50)
IssuesCol4 = ReadPreferenceLong("ColSize4", 120)
IssuesCol5 = ReadPreferenceLong("ColSize5", 80)
IssueCount = ReadPreferenceLong("Count", -1)
ClearList(Issues())
If IssueCount < 0
; no issues defined yet: create a default list
AddElement(Issues())
Issues()\Name$ = "Todo"
Issues()\Expression$ = "\bTODO\b.*"
Issues()\Priority = 4 ; info
Issues()\Color = Colors(#COLOR_DebuggerWarning)\UserValue
Issues()\CodeMode = 1 ; mark the backgroundo of the regex only
Issues()\InTool = 1
Issues()\InBrowser = 0
AddElement(Issues())
Issues()\Name$ = "Fixme"
Issues()\Expression$ = "\bFIXME\b.*"
Issues()\Priority = 1 ; high
Issues()\Color = Colors(#COLOR_DebuggerError)\UserValue
Issues()\CodeMode = 1 ; mark the backgroundo of the regex only
Issues()\InTool = 1
Issues()\InBrowser = 0
Else
For i = 1 To IssueCount
AddElement(Issues())
Issues()\Name$ = ReadPreferenceString("Name_" + i, "")
Issues()\Expression$ = ReadPreferenceString("Expr_" + i, "")
Issues()\Priority = ReadPreferenceLong("Prio_" + i, 2)
Issues()\Color = ReadPreferenceLong("Color_" + i, $FFFFFF)
Issues()\CodeMode = ReadPreferenceLong("Mode_" + i, 0)
Issues()\InTool = ReadPreferenceLong("InTool_" + i, 1)
Issues()\InBrowser = ReadPreferenceLong("InBrowser_" + i, 0)
; sanitize these values
If Issues()\Priority < 0
Issues()\Priority = 0
ElseIf Issues()\Priority > 4
Issues()\Priority = 4
EndIf
Next i
EndIf
InitIssueList()
;- - MiscWindows
PreferenceGroup("MiscWindows")
LoadDialogPosition(@PreferenceWindowPosition, -1, -1, 0, 0, "Preference")
LoadDialogPosition(@AboutWindowPosition, -1, -1, 0, 0, "About")
LoadDialogPosition(@SortSourcesWindowPosition, -1, -1, 0, 0, "SortSources")
LoadDialogPosition(@WarningWindowPosition, -1, -1, 470, 180, "Warning")
LoadDialogPosition(@BuildWindowPosition, -1, -1, 550, 350, "Build")
LoadDialogPosition(@UpdateWindowPosition, -1, -1, 0, 0, "Updates")
;- - Shortcuts
PreferenceGroup("Shortcuts")
Restore ShortcutItems
For i = 0 To #MENU_LastShortcutItem
Read.s MenuTitle$
Read.s MenuItem$
Read.l DefaultShortcut
KeyboardShortcuts(i) = ReadPreferenceLong(MenuItem$, DefaultShortcut)
Next i
; a little fix to not have a shortcut twice, since i switched two shortcut values in the defaults
If KeyboardShortcuts(#MENU_ToggleFolds) = KeyboardShortcuts(#MENU_ToggleThisFold) And KeyboardShortcuts(#MENU_ToggleThisFold) = #SHORTCUT_ToggleThisFold
KeyboardShortcuts(#MENU_ToggleFolds) = #SHORTCUT_ToggleFolds
EndIf
;- - Toolbar
; The 4.40+ toolbar format is saved in "ToolbarNew", to not mess up the IDE when
; the user runs an older version after a newer one with the same prefs file.
; If this happens, the user will simply get the default toolbar this way
;
If PreferenceGroup("ToolbarNew") = 0
; fall back to the old group if no new data is present (the layout will be properly converted)
PreferenceGroup("Toolbar")
EndIf
ToolbarItemCount = ReadPreferenceLong("ItemCount", ToolbarItemCount)
For i = 1 To ToolbarItemCount
Toolbar(i)\Name$ = ConvertToolbarIconName(ReadPreferenceString("Icon_"+Str(i), Toolbar(i)\Name$)) ; convert old files to new format
Toolbar(i)\Action$ = ReadPreferenceString("Action_"+Str(i), Toolbar(i)\Action$)
Next i
;- - FindWindow
PreferenceGroup("FindWindow")
LoadDialogPosition(@FindWindowPosition)
FindHistorySize = ReadPreferenceLong("HistorySize", 10)
FindDoReplace = ReadPreferenceLong("DoReplace", 0)
FindCaseSensitive = ReadPreferenceLong("CaseSensitive", 0)
FindWholeWord = ReadPreferenceLong("WholeWord", 0)
FindSelectionOnly = ReadPreferenceLong("SelectionOnly", 0)
FindAutoWrap = ReadPreferenceLong("AutoWrap", 0)
FindNoComments = ReadPreferenceLong("NoComments", 0)
FindNoStrings = ReadPreferenceLong("NoStrings", 0)
If FindHistorySize > #MAX_FindHistory
FindHistorySize = #MAX_FindHistory
EndIf
For i = 1 To FindHistorySize
FindSearchHistory(i) = ReadPreferenceString("SearchHistory_"+Str(i), "")
FindReplaceHistory(i) = ReadPreferenceString("ReplaceHistory_"+Str(i), "")
Next i
;- - DiffWindow
PreferenceGroup("DiffWindow")
LoadDialogPosition(@DiffWindowPosition, -1, -1, 700, 450, "Output")
LoadDialogPosition(@DiffDirectoryWindowPosition, -1, -1, 500, 400, "Directory")
LoadDialogPosition(@DiffDialogWindowPosition, -1, -1, 0, 0, "Dialog")
DiffVertical = ReadPreferenceLong("Vertical", 0)
DiffShowColors = ReadPreferenceLong("Colors", 1)
DiffIgnoreCase = ReadPreferenceLong("IgnoreCase", 0)
DiffIgnoreSpaceAll = ReadPreferenceLong("IgnoreSpaceAll", 0)
DiffIgnoreSpaceLeft = ReadPreferenceLong("IgnoreSpaceLeft", 0)
DiffIgnoreSpaceRight = ReadPreferenceLong("IgnoreSpaceRight", 0)
DiffRecurse = ReadPreferenceLong("Recurse", 0)
For j = 0 To 4
For i = 1 To FindHistorySize
DiffDialogHistory(j, i) = ReadPreferenceString("History_"+Str(j)+"_"+Str(i), "")
Next i
Next j
;- - GrepWindow
PreferenceGroup("GrepWindow")
LoadDialogPosition(@GrepWindowPosition)
GrepCaseSensitive = ReadPreferenceLong("CaseSensitive", 0)
GrepWholeWord = ReadPreferenceLong("WholeWord", 0)
GrepNoComments = ReadPreferenceLong("NoComments", 0)
GrepNoStrings = ReadPreferenceLong("NoStrings", 0)
GrepRecurse = ReadPreferenceLong("Recurse", 0)
For i = 1 To FindHistorySize
GrepFindHistory(i) = ReadPreferenceString("FindHistory_"+Str(i), "")
GrepDirectoryHistory(i) = ReadPreferenceString("DirectoryHistory_"+Str(i), "")
GrepExtensionHistory(i) = ReadPreferenceString("ExtensionHistory_"+Str(i), "")
Next i
;- - GrepOutput
PreferenceGroup("GrepOutput")
LoadDialogPosition(@GrepOutputPosition, 100, 100, 430, 300)
; ;- - CPUMonitor
; PreferenceGroup("CPUMonitor")
; CPUWindowX = ReadPreferenceLong("X", 0)
; CPUWindowY = ReadPreferenceLong("Y", 0)
; CPUWindowWidth = ReadPreferenceLong("Width", 500)
; CPUWindowHeight = ReadPreferenceLong("Height", 400)
; CPUUpdateInterval = ReadPreferenceLong("Intervall", 1000) ; DO NOT FIX TYPO: Intervall
; CPUStayOnTop = ReadPreferenceLong("OnTop", 1)
; DisplayCPUTotal = ReadPreferenceLong("DisplayTotal", #PB_ListIcon_Checked)
; DisplayCPUFree = ReadPreferenceLong("DisplayFree", 0)
;
; Restore CPUMonitorColors
; index = 0
; Repeat
; Read.l CPUColors(index)
; index + 1
; Until CPUColors(index-1) = -1
;
; NBCPUColors = ReadPreferenceLong("NbColors", index)
;
; For index = 0 To NbCPUColors-1
; CPUColors(index) = ReadPreferenceLong("Color_"+Str(index), CPUColors(index))
; Next index
;- - ToolsPanel
PreferenceGroup("ToolsPanel")
ToolsPanelWidth = ReadPreferenceLong("Width", 220)
ToolsPanelSide = ReadPreferenceLong("Side", 0) ; Side: 0 = Right, 1 = Left
ToolsPanelUseFont = ReadPreferenceLong("UseFont", 0)
ToolsPanelUseColors = ReadPreferenceLong("UseColors", 1)
ToolsPanelFontName$ = ReadPreferenceString("Font", "")
ToolsPanelFontSize = ReadPreferenceLong("FontSize", 12)
ToolsPanelFontStyle$ = ReadPreferenceString("FontStyle", "None")
ToolsPanelFrontColor = ReadPreferenceLong("FrontColor", $000000)
CompilerIf #SpiderBasic
ToolsPanelBackColor = ReadPreferenceLong("BackColor", $FFFFFF)
CompilerElse
ToolsPanelBackColor = ReadPreferenceLong("BackColor", $DFFFFF)
CompilerEndIf
NoIndependentToolsColors = ReadPreferenceLong("NoIndependantColors", 1) ; DO NOT FIX TYPO: NoIndependantColors
ToolsPanelAutoHide = ReadPreferenceLong("AutoHide", 0)
CompilerIf #CompileWindows
ToolsPanelHideDelay = ReadPreferenceLong("HideDelay", 2500)
CompilerElse
ToolsPanelHideDelay = 0 ; no timer on linux/mac, so the delay must be 0
CompilerEndIf
ToolsPanelFontStyle = 0
If FindString(UCase(ToolsPanelFontStyle$),"BOLD",1)
ToolsPanelFontStyle | #PB_Font_Bold
EndIf
If FindString(UCase(ToolsPanelFontStyle$),"ITALIC",1)
ToolsPanelFontStyle | #PB_Font_Italic
EndIf
If ToolsPanelFontName$ = "" Or ToolsPanelUseFont = 0
ToolsPanelFontID = #PB_Default
Else
ToolsPanelFontID = LoadFont(#FONT_ToolsPanel, ToolsPanelFontName$, ToolsPanelFontSize, ToolsPanelFontStyle)
EndIf
ActiveToolsCount = ReadPreferenceLong("ActiveTools", -1)
; read the ID's of the enabled tools
;
If ActiveToolsCount = -1 ; value doesn't exist, use the default setup
SortStructuredList(AvailablePanelTools(), #PB_Sort_Ascending, OffsetOf(ToolsPanelEntry\PanelTabOrder), TypeOf(ToolsPanelEntry\PanelTabOrder))
ForEach AvailablePanelTools()
If AvailablePanelTools()\PanelTabOrder ; If Name$ = "PROCEDUREBROWSER" Or Name$ = "FORM" Or Name$ = "PROJECTPANEL" Or Name$ = "EXPLORER" Or Name$ = "WEBVIEW"
AddElement(UsedPanelTools()) ; add the tool to the active list
UsedPanelTools() = @AvailablePanelTools()
EndIf
Next AvailablePanelTools()
Else
FormPresent = 0
ClearList(UsedPanelTools())
For i = 1 To ActiveToolsCount
Name$ = UCase(ReadPreferenceString("Tool_"+Str(i), ""))
ForEach AvailablePanelTools()
If Name$ = UCase(AvailablePanelTools()\ToolID$)
AddElement(UsedPanelTools()) ; add the tool to the active list
UsedPanelTools() = @AvailablePanelTools()
Break
EndIf
Next AvailablePanelTools()
If Name$ = "FORM"
FormPresent = 1
EndIf
Next i
; automatically add the form designer tool if upgrading from an older preferences file
If PrefsVersion < 510 And FormPresent = 0
ForEach AvailablePanelTools()
Name$ = UCase(AvailablePanelTools()\ToolID$)
If Name$ = "FORM"
AddElement(UsedPanelTools()) ; add the tool to the active list
UsedPanelTools() = @AvailablePanelTools()
Break
EndIf
Next AvailablePanelTools()
EndIf
EndIf
;- - ToolsPanelMetrics
PreferenceGroup("ToolsPanelMetrics")
; Now Read the window settings for all available tools
;
ForEach AvailablePanelTools()
AvailablePanelTools()\ToolWindowX = ReadPreferenceLong(AvailablePanelTools()\ToolName$+"_X", 0)
AvailablePanelTools()\ToolWindowY = ReadPreferenceLong(AvailablePanelTools()\ToolName$+"_Y", 0)
AvailablePanelTools()\ToolWindowWidth = ReadPreferenceLong(AvailablePanelTools()\ToolName$+"_Width", 250)
AvailablePanelTools()\ToolWindowHeight = ReadPreferenceLong(AvailablePanelTools()\ToolName$+"_Height", 460)
AvailablePanelTools()\IsToolStayOnTop = ReadPreferenceLong(AvailablePanelTools()\ToolName$+"_Top", 0)
Next AvailablePanelTools()
If ListSize(UsedPanelTools()) = 0
ToolsPanelMode = 0 ; do not display the Panel at all
Else
ToolsPanelMode = 1
EndIf
; now read the configuration for all available tools
;
ForEach AvailablePanelTools()
If AvailablePanelTools()\NeedPreferences
PanelTool.ToolsPanelInterface = @AvailablePanelTools()
PanelTool\PreferenceLoad()
EndIf
Next AvailablePanelTools()
;- - FileViewer
PreferenceGroup("FileViewer")
FileViewerX = ReadPreferenceLong ("X", 50)
FileViewerY = ReadPreferenceLong ("Y", 50)
FileViewerWidth = ReadPreferenceLong ("Width", 500)
FileViewerHeight = ReadPreferenceLong ("Height", 400)
FileViewerMaximize = ReadPreferenceLong ("IsMaximized", 0)
FileViewerPath$ = ReadPreferenceString("Path", SourcePath$)
FileViewerPattern = ReadPreferenceLong ("Pattern", 0)
;- - MacroErrorWindow
PreferenceGroup("MacroErrorWindow")
MacroErrorWindowWidth = ReadPreferenceLong("Width", 450)
MacroErrorWindowHeight = ReadPreferenceLong("Height", 300)
;- - StructureViewer
PreferenceGroup("StructureViewer")
LoadDialogPosition(@StructureViewerPosition, 100, 100, 400, 400)
StructureViewerStayOnTop = ReadPreferenceLong("StayOnTop", 1)
;- - MoreCompilers
PreferenceGroup("MoreCompilers")
Count = ReadPreferenceLong("Count", 0)
For i = 1 To Count
AddElement(Compilers())
Compilers()\Executable$ = ReadPreferenceString("Compiler"+Str(i)+"_Exe", "")
Compilers()\MD5$ = ReadPreferenceString("Compiler"+Str(i)+"_Md5", "")
Compilers()\VersionString$ = ReadPreferenceString("Compiler"+Str(i)+"_Version", "Unknown")
If Compilers()\MD5$ <> "" And FileFingerprint(Compilers()\Executable$, #PB_Cipher_MD5) = Compilers()\MD5$
; the compiler is still there and has not been updated
Compilers()\Validated = #True
Compilers()\VersionNumber = Val(LSet(RemoveString(StringField(Compilers()\VersionString$, 2, " "), "."), 3, "0"))
Else
; will try to get the info from the exe (and set it to validated)
GetCompilerVersion(Compilers()\Executable$, @Compilers())
EndIf
Next i
; Ensures the C backend compiler is automatically added to the list for the PureBasic version which have one
;
CompilerIf (#CompileWindows Or #CompileLinux) And (#CompileX86 Or #CompileX64)
CompilerIf #CompileWindows
CompilerExecutable$ = PureBasicPath$ + "Compilers\pbcompilerc.exe"
CompilerElse ; Linux
CompilerExecutable$ = PureBasicPath$ + "compilers/pbcompilerc"
CompilerEndIf
Found = #False
ForEach Compilers()
If IsEqualFile(CompilerExecutable$, Compilers()\Executable$)
Found = #True
Break
EndIf
Next
; Not found in the additional compiler list, we can add it
If Not Found
AddElement(Compilers())
Compilers()\Executable$ = CompilerExecutable$
; will try to get the info from the exe (and set it to validated)
GetCompilerVersion(Compilers()\Executable$, @Compilers())
EndIf
CompilerEndIf
SortCompilers()
;- - CompilerDefaults
PreferenceGroup("CompilerDefaults")
LoadDialogPosition(@OptionWindowPosition)
LoadDialogPosition(@ProjectOptionWindowPosition, -1, -1, 0, 0, "ProjectOption")
OptionDebugger = ReadPreferenceLong("Debugger", 1)
OptionPurifier = ReadPreferenceLong("Purifier", 0)
OptionOptimizer = ReadPreferenceLong("Optimizer", 0)
OptionInlineASM = ReadPreferenceLong("InlineASM", 0)
OptionXPSkin = ReadPreferenceLong("XPSkin", 1)
OptionVistaAdmin = ReadPreferenceLong("VistaAdmin",0)
OptionVistaUser = ReadPreferenceLong("VistaUser", 0)
OptionDPIAware = ReadPreferenceLong("DPIAware", 1)
OptionDllProtection = ReadPreferenceLong("DllProtection", 0)
OptionSharedUCRT = ReadPreferenceLong("SharedUCRT", 0)
OptionThread = ReadPreferenceLong("Thread", 0)
OptionOnError = ReadPreferenceLong("OnError", 0)
OptionCPU = ReadPreferenceLong("CPU", 0)
OptionExeFormat = ReadPreferenceLong("ExeFormat", 0)
OptionNewLineType = ReadPreferenceLong("NewLineType", #DEFAULT_NewLineType)
OptionSubSystem$ = ReadPreferenceString("SubSystem", "")
OptionErrorLog = ReadPreferenceLong("ShowErrorLog", 1)
OptionEncoding = ReadPreferenceLong("TextEncoding", 1) ; UTF8 text is default
OptionUseCompileCount = ReadPreferenceLong("UseCompileCount", 0)
OptionUseBuildCount = ReadPreferenceLong("UseBuildCount", 0)
OptionUseCreateExe = ReadPreferenceLong("UseCreateExe", 0)
OptionCustomCompiler = ReadPreferenceLong("CustomCompiler", 0)
OptionCompilerVersion$ = ReadPreferenceString("CompilerVersion", "")
CompilerIf #SpiderBasic
LoadDialogPosition(@CreateAppWindowPosition, -1, -1, 0, 0, "CreateApp")
OptionTemporaryExe = #True ; Always create the output in the source directory as we launch a webserver and don't want to launch it in temp
OptionWebBrowser$ = ReadPreferenceString("WebBrowser", "")
OptionWebServerPort = ReadPreferenceLong("WebServerPort", 19080)
OptionJDK$ = ReadPreferenceString("JDK", "")
OptionAppleTeamID$ = ReadPreferenceString("AppleTeamID", "")
CompilerElse
OptionTemporaryExe = ReadPreferenceLong("TemporaryExe", 0)
CompilerEndIf
;- - Custom Keywords
PreferenceGroup("CustomKeywords")
CustomKeywordFile$ = ReadPreferenceString("File", "")
Count = ReadPreferenceLong ("Count", 0)
ClearList(CustomKeywordList())
For i = 1 To count
AddElement(CustomKeywordList())
CustomKeywordList() = ReadPreferenceString("W"+Str(i), "")
Next i
SortList(CustomKeywordList(), 2)
BuildCustomKeywordTable()
;- - AddTools
PreferenceGroup("AddTools")
LoadDialogPosition(@AddToolsWindowPosition, -1, -1, 400, 300)
EditToolsWindowPosition\x = ReadPreferenceLong("EditX", -1)
EditToolsWindowPosition\y = ReadPreferenceLong("EditY", -1)
;- - AutoComplete
PreferenceGroup("AutoComplete")
AutoCompleteAddBrackets = ReadPreferenceLong("AddBrackets", 0)
AutoCompleteAddSpaces = ReadPreferenceLong("AddSpaces", 0)
AutoCompleteAddEndKeywords = ReadPreferenceLong("AddEndKeyWords", 0)
AutoCompleteWindowWidth = ReadPreferenceLong("Width", 230) ; 150 is way too small on Linux
AutoCompleteWindowHeight = ReadPreferenceLong("Height", 300)
AutoPopupNormal = ReadPreferenceLong("AutoPopup", 1)
;AutoCompleteNoStrings = ReadPreferenceLong("NoStrings", 1)
;AutoCompleteNoComments = ReadPreferenceLong("NoComments", 1)
AutoCompletePopupLength = ReadPreferenceLong("AutoPopupLength", 3)
AutoPopupStructures = ReadPreferenceLong("CompleteStructures", 1)
AutoPopupModules = ReadPreferenceLong("CompleteModules", 1)
AutoCompleteProject = ReadPreferenceLong("ProjectItems", 1)
AutoCompleteAllFiles = ReadPreferenceLong("AllFileItems", 0)
; removed options
AutoCompleteNoStrings = 1
AutoCompleteNoComments = 1
OldOptions = ReadPreferenceLong("Options", 0)
If OldOptions
; translate the old preferences options to the new format
AutocompleteOptions(#ITEM_Variable) = OldOptions & ((1<<#AUTOCOMPLETE_CurrentFileVariables)|(1<<#AUTOCOMPLETE_AllFileVariables))
AutocompleteOptions(#ITEM_Array) = OldOptions & ((1<<#AUTOCOMPLETE_CurrentFileArrays)|(1<<#AUTOCOMPLETE_AllFileArrays))
AutocompleteOptions(#ITEM_LinkedList) = OldOptions & ((1<<#AUTOCOMPLETE_CurrentFileLists)|(1<<#AUTOCOMPLETE_AllFileLists))
AutocompleteOptions(#ITEM_Map) = AutocompleteOptions(#ITEM_LinkedList) ; just re-use that
AutocompleteOptions(#ITEM_Procedure) = OldOptions & ((1<<#AUTOCOMPLETE_CurrentFileFunctions)|(1<<#AUTOCOMPLETE_AllFilesFunctions))
AutocompleteOptions(#ITEM_Macro) = OldOptions & ((1<<#AUTOCOMPLETE_CurrentFileMacros)|(1<<#AUTOCOMPLETE_AllFileMacros))
AutocompleteOptions(#ITEM_Import) = OldOptions & ((1<<#AUTOCOMPLETE_CurrentFileImports)|(1<<#AUTOCOMPLETE_AllFileImports))
AutocompleteOptions(#ITEM_Constant) = OldOptions & ((1<<#AUTOCOMPLETE_CurrentFileConstants)|(1<<#AUTOCOMPLETE_AllFileConstants))
AutocompleteOptions(#ITEM_Prototype) = #False
AutocompleteOptions(#ITEM_Structure) = OldOptions & ((1<<#AUTOCOMPLETE_CurrentFileStructures)|(1<<#AUTOCOMPLETE_AllFileStructures))
AutocompleteOptions(#ITEM_Interface) = OldOptions & ((1<<#AUTOCOMPLETE_CurrentFileInterfaces)|(1<<#AUTOCOMPLETE_AllFileInterfaces))
AutocompleteOptions(#ITEM_Label) = #False
AutocompletePBOptions(#PBITEM_Keyword) = OldOptions & (1<<#AUTOCOMPLETE_PBKeywords)
AutocompletePBOptions(#PBITEM_ASMKeyword) = OldOptions & (1<<#AUTOCOMPLETE_ASMKeywords)
AutocompletePBOptions(#PBITEM_Function) = OldOptions & (1<<#AUTOCOMPLETE_PBFunctions)
AutocompletePBOptions(#PBITEM_APIFunction) = OldOptions & (1<<#AUTOCOMPLETE_APIFunctions)
AutocompletePBOptions(#PBITEM_Constant) = OldOptions & (1<<#AUTOCOMPLETE_Constants)
AutocompletePBOptions(#PBITEM_Structure) = OldOptions & (1<<#AUTOCOMPLETE_Structures)
AutocompletePBOptions(#PBITEM_Interface) = OldOptions & (1<<#AUTOCOMPLETE_Interfaces)
If OldOptions & (#AUTOCOMPLETE_AllFileVariables|#AUTOCOMPLETE_AllFileArrays|#AUTOCOMPLETE_AllFileLists|#AUTOCOMPLETE_AllFilesFunctions|#AUTOCOMPLETE_AllFileMacros|#AUTOCOMPLETE_AllFileImports|#AUTOCOMPLETE_AllFileConstants|#AUTOCOMPLETE_CurrentFileStructures|#AUTOCOMPLETE_AllFileInterfaces)
AutoCompleteAllFiles = #True
Else
AutoCompleteAllFiles = #False
EndIf
Else
; read the new format prefs data
; read defaults, then read the settings
Restore SourceItem_Defaults
For i = 0 To #ITEM_LastOption
Read.l AutocompleteOptions(i)
Next i
Restore SourceItem_Names
For i = 0 To #ITEM_LastOption
Read.s ItemName$
AutocompleteOptions(i) = ReadPreferenceLong(ItemName$, AutocompleteOptions(i))
Next i
Restore PBItem_Defaults
For i = 0 To #PBITEM_Last
Read.l AutocompletePBOptions(i)
Next i
Restore PBItem_Names
For i = 0 To #PBITEM_Last
Read.s ItemName$
AutocompletePBOptions(i) = ReadPreferenceLong(ItemName$, AutocompletePBOptions(i))
Next i
EndIf
;- - RecentFiles
PreferenceGroup("RecentFiles")
FilesHistorySize = ReadPreferenceLong("HistorySize", 10)
If FilesHistorySize > #MAX_RecentFiles
FilesHistorySize = #MAX_RecentFiles
EndIf
For i = 1 To FilesHistorySize
RecentFiles(i) = ReadPreferenceString("RecentFile_"+Str(i), "")
Next i
For i = 1 To FilesHistorySize
RecentFiles(#MAX_RecentFiles+i) = ReadPreferenceString("RecentProject_"+Str(i), "")
Next i
;- - OpenedFiles
PreferenceGroup("OpenedFiles")
OpenFilesCount = ReadPreferenceLong("Count", 0)
ResetList(OpenFiles()) ; insert all names at the front, this loads the last closed one first (and all these before the commandline files)
For i = 1 To OpenFilesCount
InsertElement(OpenFiles()) ; insert all at the start
OpenFiles() = ReadPreferenceString("OpenedFile_"+Str(i), "")
Next i
LastOpenProjectFile$ = ReadPreferenceString("OpenedProject", "")
CompilerIf #CompileLinux | #CompileMac
;- - Help
PreferenceGroup("Help")
HelpWindowX = ReadPreferenceLong("X", -1)
HelpWindowY = ReadPreferenceLong("Y", -1)
HelpWindowWidth = ReadPreferenceLong("Width", 600)
HelpWindowHeight = ReadPreferenceLong("Height", 400)
HelpWindowSplitter = ReadPreferenceLong("Splitter", 180)
HelpWindowMaximized = ReadPreferenceLong("IsMaximized", 0)
CompilerEndIf
;- - Debugger
PreferenceGroup("Debugger")
DebuggerMode = ReadPreferenceLong("DebuggerMode", 1)
; CompilerIf #CompileMac ; OSX-debug
; If DebuggerMode = 1
; DebuggerMode = 2
; EndIf
; CompilerEndIf
DebuggerMemorizeWindows = ReadPreferenceLong("MemorizeWindows", 1)
DebuggerKeepErrorMarks = ReadPreferenceLong("KeepErrorMarks", 1)
IsDebuggerMaximized = ReadPreferenceLong("IsDebuggerMaximized", 0)
DebuggerOnTop = ReadPreferenceLong("StayOnTop", #DEFAULT_DebuggerStayOnTop)
DebuggerBringToTop = ReadPreferenceLong("AutoBringToTop", #DEFAULT_DebuggerBringToTop)
CallDebuggerOnStart = ReadPreferenceLong("CallOnStart", 0)
CallDebuggerOnEnd = ReadPreferenceLong("CallOnEnd", 0)
LogTimeStamp = ReadPreferenceLong("LogTimeStamp", 1)
ErrorLogHeight = ReadPreferenceLong("ErrorLogHeight", 150)
DebuggerKillOnError = ReadPreferenceLong("KillOnError", 0)
CompilerIf #SpiderBasic
DebuggerKillOnError = 1
CompilerEndIf
AutoClearLog = ReadPreferenceLong("AutoClearLog", 0)
DisplayErrorWindow = ReadPreferenceLong("DisplayErrorWindow", 1)
WarningMode = ReadPreferenceLong("WarningMode", 1)
DebuggerTimeout = ReadPreferenceLong("StartupTimeout", 10000)
DebugTimeStamp = ReadPreferenceLong("DebugTimeStamp", 0)
DebugIsHex = ReadPreferenceLong("DebugIsHex", 0)
DebugSystemMessages = ReadPreferenceLong("DebugSystemMessages", 0)
DebugOutputToErrorLog = ReadPreferenceLong("DebugOutputToErrorLog", 0)
DebugOutUseFont = ReadPreferenceLong("DebugOutUseFont", 0)
DebugOutFont$ = ReadPreferenceString("DebugOutFont", "")
DebugOutFontSize = ReadPreferenceLong("DebugOutFontSize", 12)
DebugOutFontStyle$ = ReadPreferenceString("DebugOutFontStyle", "None")
DebugWindowX = ReadPreferenceLong("DebugWindowX", 50)
DebugWindowY = ReadPreferenceLong("DebugWindowY", 50)
DebugWindowWidth = ReadPreferenceLong("DebugWindowWidth", 300)
DebugWindowHeight = ReadPreferenceLong("DebugWindowHeight", 300)
DebugWindowMaximize = ReadPreferenceLong("DebugWindowMaximize", 0)
DebugOutFontStyle = 0
If FindString(UCase(DebugOutFontStyle$),"BOLD",1)
DebugOutFontStyle | #PB_Font_Bold
EndIf
If FindString(UCase(DebugOutFontStyle$),"ITALIC",1)
DebugOutFontStyle | #PB_Font_Italic
EndIf
If DebugOutFont$ = "" Or DebugOutUseFont = 0
DebugOutFontID = #PB_Default
Else
DebugOutFontID = LoadFont(#FONT_DebugOut, DebugOutFont$, DebugOutFontSize, DebugOutFontStyle)
EndIf
RegisterIsHex = ReadPreferenceLong("RegisterIsHex", 0)
StackIsHex = ReadPreferenceLong("StackIsHex", 0)
AutoStackUpdate = ReadPreferenceLong("AutoStackUpdate", 1)
AsmWindowX = ReadPreferenceLong("AsmWindowX", 50)
AsmWindowY = ReadPreferenceLong("AsmWindowY", 50)
AsmWindowWidth = ReadPreferenceLong("AsmWindowWidth", 370)
AsmWindowHeight = ReadPreferenceLong("AsmWindowHeight", 370)
AsmWindowMaximize = ReadPreferenceLong("AsmWindowMaximize", 0)
MemoryDisplayType = ReadPreferenceLong("MemoryDisplayType", 0)