-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tcl
286 lines (274 loc) · 11.2 KB
/
main.tcl
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
#############################################################################
# Generated by PAGE version 4.22
# in conjunction with Tcl version 8.6
# Aug 07, 2019 09:15:51 AM CEST platform: Windows NT
set vTcl(timestamp) ""
if {!$vTcl(borrow)} {
set vTcl(actual_gui_bg) #d9d9d9
set vTcl(actual_gui_fg) #000000
set vTcl(actual_gui_analog) #ececec
set vTcl(actual_gui_menu_analog) #ececec
set vTcl(actual_gui_menu_bg) #d9d9d9
set vTcl(actual_gui_menu_fg) #000000
set vTcl(complement_color) #d9d9d9
set vTcl(analog_color_p) #d9d9d9
set vTcl(analog_color_m) #ececec
set vTcl(active_fg) #000000
set vTcl(actual_gui_menu_active_bg) #ececec
set vTcl(active_menu_fg) #000000
}
#################################
#LIBRARY PROCEDURES
#
if {[info exists vTcl(sourcing)]} {
proc vTcl:project:info {} {
set base .top42
global vTcl
set base $vTcl(btop)
if {$base == ""} {
set base .top42
}
namespace eval ::widgets::$base {
set dflt,origin 0
set runvisible 1
}
namespace eval ::widgets_bindings {
set tagslist _TopLevel
}
namespace eval ::vTcl::modules::main {
set procs {
}
set compounds {
}
set projectType single
}
}
}
#################################
# GENERATED GUI PROCEDURES
#
proc vTclWindow.top42 {base} {
if {$base == ""} {
set base .top42
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
set top $base
###################
# CREATING WIDGETS
###################
vTcl::widgets::core::toplevel::createCmd $top -class Toplevel \
-background {#d9d9d9} -highlightbackground {#d9d9d9} \
-highlightcolor black
wm focusmodel $top passive
wm geometry $top 519x565+533+80
update
# set in toplevel.wgt.
global vTcl
global img_list
set vTcl(save,dflt,origin) 0
wm maxsize $top 1684 1031
wm minsize $top 120 1
wm overrideredirect $top 0
wm resizable $top 0 0
wm deiconify $top
wm title $top "New Toplevel"
vTcl:DefineAlias "$top" "Toplevel1" vTcl:Toplevel:WidgetProc "" 1
button $top.but43 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black -pady 0 \
-text Button
vTcl:DefineAlias "$top.but43" "Button1" vTcl:WidgetProc "Toplevel1" 1
bind $top.but43 <Button-1> {
lambda e: btnButton1_Click(e)
}
button $top.but44 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black -pady 0 \
-text {Save Edges State}
vTcl:DefineAlias "$top.but44" "btnSaveEdgesState" vTcl:WidgetProc "Toplevel1" 1
bind $top.but44 <Button-1> {
lambda e: btnSaveEdgesState_Click(e)
}
canvas $top.can45 \
-background {#d9d9d9} -borderwidth 2 -closeenough 1.0 -height 513 \
-highlightbackground {#d9d9d9} -highlightcolor black \
-insertbackground black -relief ridge -selectbackground {#c4c4c4} \
-selectforeground black -width 373
vTcl:DefineAlias "$top.can45" "Canvas1" vTcl:WidgetProc "Toplevel1" 1
label $top.lab46 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black \
-text {Uplne Neco jineho}
vTcl:DefineAlias "$top.lab46" "Label1" vTcl:WidgetProc "Toplevel1" 1
button $top.but45 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black -pady 0 \
-text {Load Edges State}
vTcl:DefineAlias "$top.but45" "btnLoadEdgesState" vTcl:WidgetProc "Toplevel1" 1
bind $top.but45 <Button-1> {
lambda e: btnLoadEdgesState_Click(e)
}
button $top.but46 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black -pady 0 \
-text {Play AI}
vTcl:DefineAlias "$top.but46" "btnPlayAI" vTcl:WidgetProc "Toplevel1" 1
bind $top.but46 <Button-1> {
lambda e: btnPlayAI_Click(e)
}
ttk::style configure Treeview.Heading -background #d9d9d9
ttk::style configure Treeview.Heading -font "TkDefaultFont"
vTcl::widgets::ttk::scrolledtreeview::CreateCmd $top.scr45 \
-background {#d9d9d9} -height 15 -highlightbackground {#d9d9d9} \
-highlightcolor black -width 30
vTcl:DefineAlias "$top.scr45" "trvPath" vTcl:WidgetProc "Toplevel1" 1
bind $top.scr45 <<TreeviewSelect>> {
lambda e: trvPath_Select(e)
}
.top42.scr45.01 configure -columns {}
.top42.scr45.01 heading #0 -anchor center
.top42.scr45.01 column #0 -width 421
.top42.scr45.01 column #0 -minwidth 20
.top42.scr45.01 column #0 -stretch 1
.top42.scr45.01 column #0 -anchor w
label $top.lab43 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black -text {AI paths}
vTcl:DefineAlias "$top.lab43" "Label2" vTcl:WidgetProc "Toplevel1" 1
entry $top.ent43 \
-background white -disabledforeground {#a3a3a3} -font TkFixedFont \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -insertbackground black \
-selectbackground {#c4c4c4} -selectforeground black
vTcl:DefineAlias "$top.ent43" "txtNumberOfPathsToEndNodes" vTcl:WidgetProc "Toplevel1" 1
button $top.but47 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black -pady 0 \
-text {Set game} -width 30
vTcl:DefineAlias "$top.but47" "btnSetGameProperties" vTcl:WidgetProc "Toplevel1" 1
bind $top.but47 <Button-1> {
lambda e: btnSetGameProperties_OnClick(e)
}
button $top.but48 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 10 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -pady 0 -text Play
vTcl:DefineAlias "$top.but48" "btnPlay" vTcl:WidgetProc "Toplevel1" 1
bind $top.but48 <Button-1> {
lambda e: btnPlay_OnClick(e)
}
canvas $top.can46 \
-background {#d9d9d9} -borderwidth 2 -closeenough 1.0 -height 73 \
-highlightbackground {#d9d9d9} -highlightcolor black \
-insertbackground black -relief ridge -selectbackground {#c4c4c4} \
-selectforeground black -width 83
vTcl:DefineAlias "$top.can46" "canvasArrowUP" vTcl:WidgetProc "Toplevel1" 1
canvas $top.can47 \
-background {#d9d9d9} -borderwidth 2 -closeenough 1.0 -height 73 \
-highlightbackground {#d9d9d9} -highlightcolor black \
-insertbackground black -relief ridge -selectbackground {#c4c4c4} \
-selectforeground black -width 83
vTcl:DefineAlias "$top.can47" "canvasArrowDOWN" vTcl:WidgetProc "Toplevel1" 1
label $top.lab48 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black
vTcl:DefineAlias "$top.lab48" "lblPlayer1Name" vTcl:WidgetProc "Toplevel1" 1
label $top.lab49 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black
vTcl:DefineAlias "$top.lab49" "lblPlayer2Name" vTcl:WidgetProc "Toplevel1" 1
button $top.but49 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font TkDefaultFont -foreground {#000000} \
-highlightbackground {#d9d9d9} -highlightcolor black -pady 0 \
-text {Set colors} -width 30
vTcl:DefineAlias "$top.but49" "btnSetColorProperties" vTcl:WidgetProc "Toplevel1" 1
bind $top.but49 <Button-1> {
lambda e: btnSetColorProperties_OnClick(e)
}
###################
# SETTING GEOMETRY
###################
place $top.but43 \
-in $top -x 50 -y 370 -anchor nw -bordermode ignore
place $top.but44 \
-in $top -x 20 -y 490 -width 95 -relwidth 0 -height 24 -relheight 0 \
-anchor nw -bordermode ignore
place $top.can45 \
-in $top -x 130 -y 30 -width 373 -relwidth 0 -height 513 -relheight 0 \
-anchor nw -bordermode ignore
place $top.lab46 \
-in $top -x 20 -y 400 -anchor nw -bordermode ignore
place $top.but45 \
-in $top -x 20 -y 430 -width 107 -relwidth 0 -height 24 -relheight 0 \
-anchor nw -bordermode ignore
place $top.but46 \
-in $top -x 20 -y 460 -width 97 -relwidth 0 -height 24 -relheight 0 \
-anchor nw -bordermode ignore
place $top.scr45 \
-in $top -x 500 -y 40 -width 440 -relwidth 0 -height 367 -relheight 0 \
-anchor nw -bordermode ignore
place $top.lab43 \
-in $top -x 510 -y 30 -anchor nw -bordermode ignore
place $top.ent43 \
-in $top -x 30 -y 530 -width 64 -relwidth 0 -height 20 -relheight 0 \
-anchor nw -bordermode ignore
place $top.but47 \
-in $top -x 20 -y 80 -width 83 -relwidth 0 -height 24 -relheight 0 \
-anchor nw -bordermode ignore
place $top.but48 \
-in $top -x 21 -y 116 -width 83 -relwidth 0 -height 34 -relheight 0 \
-anchor nw -bordermode ignore
place $top.can46 \
-in $top -x 60 -y 200 -width 48 -relwidth 0 -height 48 -relheight 0 \
-anchor nw -bordermode ignore
place $top.can47 \
-in $top -x 60 -y 200 -width 48 -height 48 -anchor nw \
-bordermode ignore
place $top.lab48 \
-in $top -x 60 -y 180 -width 60 -relwidth 0 -anchor nw \
-bordermode ignore
place $top.lab49 \
-in $top -x 60 -y 250 -width 60 -relwidth 0 -anchor nw \
-bordermode ignore
place $top.but49 \
-in $top -x 20 -y 50 -width 83 -height 24 -anchor nw \
-bordermode ignore
vTcl:FireEvent $base <<Ready>>
}
set btop ""
if {$vTcl(borrow)} {
set btop .bor[expr int([expr rand() * 100])]
while {[lsearch $btop $vTcl(tops)] != -1} {
set btop .bor[expr int([expr rand() * 100])]
}
}
set vTcl(btop) $btop
Window show .
Window show .top42 $btop
if {$vTcl(borrow)} {
$btop configure -background plum
}