3 #############################################################################
4 # Visual Tcl v1.20 Project
5 # Author : Philippe Brochard
7 #################################
19 #################################
20 # USER DEFINED PROCEDURES
22 proc init {argc argv} {
38 if { $fullscreen == 1 } { set str_fullscreen "-fullscreen" }
40 if { $nosound == 1 } { set str_nosound "-nosound" }
42 if { $scaleup == 1 } { set str_scaleup "-scaleup" }
44 if { $mirror == 1 } { set str_mirror "-mirror" }
46 if { $nogore == 1 } { set str_nogore "-nogore" }
48 if { $fireworks == 1 } { set str_fireworks "-fireworks" }
51 if { [ .top17.lis26 curselection ] != "" } then {
52 set file "%%PREFIX%%/games/jumpnbump/[ .top17.lis26 get [.top17.lis26 curselection] ].dat"
55 exec jumpnbump $str_fullscreen $str_nosound $str_scaleup $str_mirror $str_nogore $str_fireworks -dat $file &
58 proc {fill_list_box} {} {
59 if [ catch { exec ls %%PREFIX%%/share/jumpnbump/ } data ] {
64 .top17.lis26 insert end [ find_name $p ]
68 proc {find_name} {path} {
69 set alast [ string last "/" $path ];
72 if { $alast != [ string length $path ] } {
73 set name [ string range $path $alast end ];
76 set tmp [ string range $path 0 $alast ];
77 set alast [ string last "/" $tmp ];
79 set name [ string range $tmp $alast end ];
82 set fname [ split $name . ]
83 set firstname [ lindex $fname 0 ]
88 proc {main} {argc argv} {
91 bind .top17.lis26 <Double-Button-1> { exec_file }
94 proc {Window} {args} {
96 set cmd [lindex $args 0]
97 set name [lindex $args 1]
98 set newname [lindex $args 2]
99 set rest [lrange $args 3 end]
100 if {$name == "" || $cmd == ""} {return}
101 if {$newname == ""} {
104 set exists [winfo exists $newname]
107 if {$exists == "1" && $name != "."} {wm deiconify $name; return}
108 if {[info procs vTclWindow(pre)$name] != ""} {
109 eval "vTclWindow(pre)$name $newname $rest"
111 if {[info procs vTclWindow$name] != ""} {
112 eval "vTclWindow$name $newname $rest"
114 if {[info procs vTclWindow(post)$name] != ""} {
115 eval "vTclWindow(post)$name $newname $rest"
118 hide { if $exists {wm withdraw $newname; return} }
119 iconify { if $exists {wm iconify $newname; return} }
120 destroy { if $exists {destroy $newname; return} }
124 #################################
125 # VTCL GENERATED GUI PROCEDURES
128 proc vTclWindow. {base} {
135 wm focusmodel $base passive
136 wm geometry $base 1x1+0+0
137 wm maxsize $base 1009 738
139 wm overrideredirect $base 0
140 wm resizable $base 1 1
141 wm resizable $base 0 0
143 wm title $base "vt.tcl"
149 proc vTclWindow.top17 {base} {
153 if {[winfo exists $base]} {
154 wm deiconify $base; return
159 toplevel $base -class Toplevel
160 wm focusmodel $base passive
161 wm geometry $base 416x314+246+193
162 wm maxsize $base 1009 738
164 wm overrideredirect $base 0
165 wm resizable $base 1 1
166 wm resizable $base 0 0
168 wm title $base "Jump n Bump"
170 -borderwidth 1 -relief raised -text {Jump n Bump}
172 -borderwidth 1 -relief sunken
173 checkbutton $base.che22 \
174 -text {full screen} -variable fullscreen
175 checkbutton $base.che23 \
176 -text {no sound} -variable nosound
177 checkbutton $base.che24 \
178 -text {no gore} -variable nogore
179 checkbutton $base.che25 \
180 -text fireworks -variable fireworks
181 checkbutton $base.che28 \
182 -text scaleup -variable scaleup
183 checkbutton $base.che29 \
184 -text mirror -variable mirror
185 listbox $base.lis26 \
186 -yscrollcommand {.top17.scr27 set}
187 bind $base.lis26 <Double-Button-1> {
190 scrollbar $base.scr27 \
191 -command {.top17.lis26 yview}
193 -command { exec_file } -text Start
195 -command { exit } -text Quit
200 -x 25 -y 10 -width 366 -height 17 -anchor nw -bordermode ignore
202 -x 190 -y 40 -width 196 -height 257 -anchor nw -bordermode ignore
204 -x 220 -y 54 -anchor nw -bordermode ignore
206 -x 220 -y 83 -anchor nw -bordermode ignore
208 -x 220 -y 112 -anchor nw -bordermode ignore
210 -x 220 -y 141 -anchor nw -bordermode ignore
212 -x 220 -y 170 -anchor nw -bordermode ignore
214 -x 220 -y 199 -anchor nw -bordermode ignore
216 -x 30 -y 40 -width 103 -height 261 -anchor nw -bordermode ignore
218 -x 145 -y 40 -width 21 -height 262 -anchor nw -bordermode ignore
220 -x 230 -y 230 -width 117 -height 25 -anchor nw -bordermode ignore
222 -x 230 -y 255 -width 117 -height 25 -anchor nw -bordermode ignore