-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathltt-gui.rkt
213 lines (206 loc) · 5.41 KB
/
ltt-gui.rkt
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
#lang racket/base
;;==========================================================================
;;=== Code generated with MrEd Designer 3.12 ===
;;=== https://github.com/Metaxal/MrEd-Designer ===
;;==========================================================================
;;; Call (ltt-gui-init) with optional arguments to this module
(require
framework
racket/list
racket/class
racket/gui/base
)
(provide ltt-gui-init
frame-main
ed-cv-txt-read
msg-info
ed-cv-txt-write
msg-timer)
(define (label-bitmap-proc l)
(let ((label (first l)) (image? (second l)) (file (third l)))
(or (and image?
(or (and file
(let ((bmp (make-object bitmap% file 'unknown/mask)))
(and (send bmp ok?) bmp)))
"<Bad Image>"))
label)))
(define (list->font l)
(with-handlers
((exn:fail?
(λ (e)
(send/apply
the-font-list
find-or-create-font
(cons (first l) (rest (rest l)))))))
(send/apply the-font-list find-or-create-font l)))
(define ltt-gui #f)
(define frame-main #f)
(define ed-cv-txt-read #f)
(define horizontal-panel-3616 #f)
(define bt-paste #f)
(define msg-info #f)
(define ed-cv-txt-write #f)
(define horizontal-panel-3937 #f)
(define bt-restart #f)
(define msg-timer #f)
(define (ltt-gui-init
#:frame-main-code-gen-class
(frame-main-code-gen-class frame%)
#:ed-cv-txt-read-editor
(ed-cv-txt-read-editor #f)
#:bt-paste-callback
(bt-paste-callback (lambda (button control-event) (void)))
#:msg-info-label
(msg-info-label (label-bitmap-proc (list "" #t "blank.png")))
#:ed-cv-txt-write-editor
(ed-cv-txt-write-editor #f)
#:bt-restart-callback
(bt-restart-callback (lambda (button control-event) (void))))
(set! frame-main
(new
frame-main-code-gen-class
(parent ltt-gui)
(label "Learn To Type")
(width #f)
(height #f)
(x #f)
(y #f)
(style '())
(enabled #t)
(border 0)
(spacing 0)
(alignment (list 'center 'top))
(min-width 700)
(min-height 200)
(stretchable-width #t)
(stretchable-height #t)))
(set! ed-cv-txt-read
(new
editor-canvas%
(parent frame-main)
(editor ed-cv-txt-read-editor)
(style '(no-focus))
(scrolls-per-page 100)
(label "Editor-Canvas")
(wheel-step 3)
(line-count #f)
(horizontal-inset 5)
(vertical-inset 5)
(enabled #t)
(vert-margin 0)
(horiz-margin 0)
(min-width 0)
(min-height 200)
(stretchable-width #t)
(stretchable-height #t)))
(set! horizontal-panel-3616
(new
horizontal-panel%
(parent frame-main)
(style '())
(enabled #t)
(vert-margin 0)
(horiz-margin 0)
(border 0)
(spacing 0)
(alignment (list 'left 'center))
(min-width 0)
(min-height 0)
(stretchable-width #t)
(stretchable-height #f)))
(set! bt-paste
(new
button%
(parent horizontal-panel-3616)
(label (label-bitmap-proc (list "Paste" #f #f)))
(callback bt-paste-callback)
(style '())
(font (list->font (list 8 #f 'default 'normal 'normal #f 'default #f)))
(enabled #t)
(vert-margin 2)
(horiz-margin 2)
(min-width 0)
(min-height 0)
(stretchable-width #f)
(stretchable-height #f)))
(set! msg-info
(new
message%
(parent horizontal-panel-3616)
(label msg-info-label)
(style '())
(font
(list->font (list 16 "Monospace" 'default 'normal 'bold #f 'default #f)))
(enabled #t)
(vert-margin 2)
(horiz-margin 2)
(min-width 0)
(min-height 20)
(stretchable-width #t)
(stretchable-height #f)
(auto-resize #t)))
(set! ed-cv-txt-write
(new
editor-canvas%
(parent frame-main)
(editor ed-cv-txt-write-editor)
(style '())
(scrolls-per-page 100)
(label "Editor-Canvas")
(wheel-step 3)
(line-count #f)
(horizontal-inset 5)
(vertical-inset 5)
(enabled #t)
(vert-margin 0)
(horiz-margin 0)
(min-width 400)
(min-height 200)
(stretchable-width #t)
(stretchable-height #t)))
(set! horizontal-panel-3937
(new
horizontal-panel%
(parent frame-main)
(style '())
(enabled #t)
(vert-margin 0)
(horiz-margin 0)
(border 0)
(spacing 0)
(alignment (list 'center 'center))
(min-width 0)
(min-height 0)
(stretchable-width #t)
(stretchable-height #f)))
(set! bt-restart
(new
button%
(parent horizontal-panel-3937)
(label (label-bitmap-proc (list "Restart" #f #f)))
(callback bt-restart-callback)
(style '())
(font (list->font (list 8 #f 'default 'normal 'normal #f 'default #f)))
(enabled #t)
(vert-margin 2)
(horiz-margin 2)
(min-width 0)
(min-height 0)
(stretchable-width #f)
(stretchable-height #f)))
(set! msg-timer
(new
message%
(parent horizontal-panel-3937)
(label (label-bitmap-proc (list "0" #f #f)))
(style '())
(font (list->font (list 8 #f 'default 'normal 'normal #f 'default #f)))
(enabled #t)
(vert-margin 2)
(horiz-margin 2)
(min-width 20)
(min-height 0)
(stretchable-width #t)
(stretchable-height #f)
(auto-resize #f)))
(send frame-main show #t))