1 |
|
#!/usr/local/bin/wish4.0 |
2 |
< |
# SCCSid "$SunId$ LBL" |
2 |
> |
# RCSid: $Id$ |
3 |
> |
# the next line restarts using wish in case of shell execution \ |
4 |
> |
exec wish "$0" "$@" |
5 |
|
# |
6 |
|
# TCL/TK-based Rad Input File Editor |
7 |
|
# |
13 |
|
|
14 |
|
set auto_path [linsert $auto_path 0 $radlib] |
15 |
|
|
16 |
+ |
# Assign global globbing variables |
17 |
+ |
|
18 |
+ |
set myglob(rif) *.rif |
19 |
+ |
set myglob(materials) *.mat |
20 |
+ |
set myglob(illum) *.rad |
21 |
+ |
set myglob(scene) *.rad |
22 |
+ |
set myglob(objects) * |
23 |
+ |
|
24 |
|
# Create required procedures |
25 |
|
|
26 |
|
proc modified {} { # check for radvar modification |
129 |
|
proc setbutt v { |
130 |
|
radiobutton .$v -text [string toupper $v] \ |
131 |
|
-variable curmode -value $v \ |
132 |
< |
-width 9 -relief groove -anchor w \ |
132 |
> |
-width 10 -relief groove -anchor w \ |
133 |
|
-command changescreen |
134 |
|
pack .$v -in .upper.right -side top -pady 5 |
135 |
|
helplink .$v trad $v intro |
161 |
|
} |
162 |
|
wm iconbitmap . @$radlib/trad.icon |
163 |
|
|
164 |
< |
proc gotfile {{o 1}} { # set file possession state |
164 |
> |
proc gotfile o { # set file possession state |
165 |
|
global oldradvar radvar |
166 |
|
catch {unset oldradvar} |
167 |
|
if $o { |
171 |
|
} |
172 |
|
} else { |
173 |
|
set mode disabled |
164 |
– |
.file invoke |
174 |
|
} |
175 |
|
foreach b {scene zone views options action results} { |
176 |
|
.$b configure -state $mode |
179 |
|
|
180 |
|
# Decide where to go and start |
181 |
|
|
182 |
+ |
gotfile 0 |
183 |
|
if {[llength $argv] == 0} { |
184 |
|
set curmess "Choose a Radiance project file." |
185 |
< |
gotfile 0 |
185 |
> |
.file invoke |
186 |
|
} elseif {[llength $argv] == 1} { |
187 |
|
cd [file dirname $argv] |
188 |
|
set curfile [file tail $argv] |
189 |
< |
if {! [file exists $curfile]} { |
190 |
< |
newnew $curfile |
191 |
< |
.scene invoke |
189 |
> |
if {! [file isfile $curfile]} { |
190 |
> |
if [newnew $curfile] { |
191 |
> |
.scene invoke |
192 |
> |
} else { |
193 |
> |
.file invoke |
194 |
> |
} |
195 |
|
} elseif {[newload $curfile]} { |
196 |
|
if $alldone { |
197 |
|
set curmess "All renderings are finished." |