-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.xojo_code
55 lines (43 loc) · 1.62 KB
/
App.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
#tag Class
Protected Class App
Inherits Application
#tag Event
Sub Open()
app.AutoQuit = True
if not appData.Exists then
appData.CreateAsFolder
end if
End Sub
#tag EndEvent
#tag Event
Function UnhandledException(error As RuntimeException) As Boolean
dim d as new date
dim time as String = d.SQLDateTime
time = time.ReplaceAll(":","-")
dim tos as TextOutputStream = TextOutputStream.Create(appData.Child("Error log " + time))
tos.Write Join(error.Stack,EndOfLine)
tos.Close
MsgBox "A crash log has been placed in the Application Support folder."
Return False
End Function
#tag EndEvent
#tag Method, Flags = &h0
Function appData() As FolderItem
Return SpecialFolder.ApplicationData.Child("DeclareMaker")
End Function
#tag EndMethod
#tag Constant, Name = kEditClear, Type = String, Dynamic = False, Default = \"&Delete", Scope = Public
#Tag Instance, Platform = Windows, Language = Default, Definition = \"&Delete"
#Tag Instance, Platform = Linux, Language = Default, Definition = \"&Delete"
#tag EndConstant
#tag Constant, Name = kFileQuit, Type = String, Dynamic = False, Default = \"&Quit", Scope = Public
#Tag Instance, Platform = Windows, Language = Default, Definition = \"E&xit"
#tag EndConstant
#tag Constant, Name = kFileQuitShortcut, Type = String, Dynamic = False, Default = \"", Scope = Public
#Tag Instance, Platform = Mac OS, Language = Default, Definition = \"Cmd+Q"
#Tag Instance, Platform = Linux, Language = Default, Definition = \"Ctrl+Q"
#tag EndConstant
#tag ViewBehavior
#tag EndViewBehavior
End Class
#tag EndClass