-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModernPreferences.xojo_code
81 lines (68 loc) · 1.66 KB
/
ModernPreferences.xojo_code
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
#tag Module
Protected Module ModernPreferences
#tag Method, Flags = &h1
Protected Sub Initialise(appName as Text)
Preferences = New Prefs(appName)
End Sub
#tag EndMethod
#tag Note, Name = Documentation
Manages your local application preferences. Preferences are loaded and saved
automatically.
Usage:
In your App.Open event, call PreferencesModule.Initialize("MyAppName")
before using the PreferencesModule
Preferences.Load loads your preferences
Preferences.Save saves your preferences
To assign preferences values:
Preferences.PrefName = value Or Preferences.Set("PrefName") = value
value = Preferences.PrefName Or value = Preferences.Get("PrefName")
If you attempt to access a preference that does not exist, a
PreferenceNotFoundException is raised.
#tag EndNote
#tag Property, Flags = &h0
Preferences As Prefs
#tag EndProperty
#tag ViewBehavior
#tag ViewProperty
Name="Index"
Visible=true
Group="ID"
InitialValue="-2147483648"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Left"
Visible=true
Group="Position"
InitialValue="0"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Name"
Visible=true
Group="ID"
InitialValue=""
Type="String"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Super"
Visible=true
Group="ID"
InitialValue=""
Type="String"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Top"
Visible=true
Group="Position"
InitialValue="0"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag EndViewBehavior
End Module
#tag EndModule