-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.xojo_code
More file actions
179 lines (146 loc) · 4.07 KB
/
App.xojo_code
File metadata and controls
179 lines (146 loc) · 4.07 KB
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
#tag Class
Protected Class App
Inherits Application
#tag Event
Sub Open()
// Obtain the version string
applicationVersion = str(App.MajorVersion) + "." + str(app.MinorVersion) + "." + str(App.BugVersion) + "." + str(app.StageCode)+ "." + str(App.NonReleaseVersion)
applicationName = self.applicationName
// Open the trace window if in debug mode
if DebugBuild then
wndTrace.Show
end if
// Create a new global undo manager for the application.
UndoManager = New UndoKit.UndoManager
End Sub
#tag EndEvent
#tag Event
Sub OpenDocument(item As FolderItem)
If not item.Exists Then
return
end if
// Load the project
dim mywindow as new wndTimeLine
if not myWindow.init(item) then
Notify("Error loading project", "The selected project could not be opened")
end if
End Sub
#tag EndEvent
#tag Event
Function UnhandledException(error As RuntimeException) As Boolean
dim stack as string
dim counter as integer
dim stackAll() as string = error.Stack()
for i as integer = 0 to ubound(error.stack)
counter = counter + 1
stack = stackAll(i) + EndOfLine
if counter > 10 then exit
next
// Leave a trace of the error
Trace("App:UnhandledException: Stack trace:" + EndOfLine + EndOfLine + stack, cstTraceLevelCritical)
Return true
End Function
#tag EndEvent
#tag MenuHandler
Function FileOpen() As Boolean Handles FileOpen.Action
dim file as folderitem = Chooseproject()
if file <> nil then
// And load the project
dim newTimeline as new wndTimeLine
call newTimeline.init(file)
end if
End Function
#tag EndMenuHandler
#tag MenuHandler
Function FileQuit() As Boolean Handles FileQuit.Action
Files.CleanDataFolders
quit
End Function
#tag EndMenuHandler
#tag MenuHandler
Function HelpOnlineHelp() As Boolean Handles HelpOnlineHelp.Action
ShowURL "http://www.spontz.org/index.php?pageID=54"
End Function
#tag EndMenuHandler
#tag MenuHandler
Function HelpSpntzHomePage() As Boolean Handles HelpSpntzHomePage.Action
ShowURL "http://www.spontz.org"
End Function
#tag EndMenuHandler
#tag MenuHandler
Function mnuAppleAboutSpöntzVisualsEditor() As Boolean Handles mnuAppleAboutSpöntzVisualsEditor.Action
wndAbout.show
End Function
#tag EndMenuHandler
#tag MenuHandler
Function mnuPathEditor() As Boolean Handles mnuPathEditor.Action
// Opening of a new instance of the path editor
dim newWindow as wndPathsEditor
newWindow = new wndPathsEditor
End Function
#tag EndMenuHandler
#tag MenuHandler
Function mnuTrace() As Boolean Handles mnuTrace.Action
wndTrace.Show
Return True
End Function
#tag EndMenuHandler
#tag MenuHandler
Function NewProject() As Boolean Handles NewProject.Action
wndChooseDemoengine.show
End Function
#tag EndMenuHandler
#tag Property, Flags = &h0
applicationName As String
#tag EndProperty
#tag Property, Flags = &h0
applicationVersion As String
#tag EndProperty
#tag Property, Flags = &h0
fonts() As folderItem
#tag EndProperty
#tag Property, Flags = &h0
UndoManager As UndoKit.UndoManager
#tag EndProperty
#tag Property, Flags = &h0
WindowBorderWidth As Integer
#tag EndProperty
#tag Property, Flags = &h0
WindowTopBarHeight As Integer
#tag EndProperty
#tag ViewBehavior
#tag ViewProperty
Name="applicationName"
Visible=false
Group="Behavior"
InitialValue=""
Type="String"
EditorType="MultiLineEditor"
#tag EndViewProperty
#tag ViewProperty
Name="applicationVersion"
Visible=false
Group="Behavior"
InitialValue=""
Type="String"
EditorType="MultiLineEditor"
#tag EndViewProperty
#tag ViewProperty
Name="WindowBorderWidth"
Visible=false
Group="Behavior"
InitialValue=""
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="WindowTopBarHeight"
Visible=false
Group="Behavior"
InitialValue=""
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag EndViewBehavior
End Class
#tag EndClass