| 1 |
< |
#!/usr/local/bin/wish -f |
| 1 |
> |
#!/usr/local/bin/wish4.0 |
| 2 |
|
# SCCSid "$SunId$ LBL" |
| 3 |
|
# |
| 4 |
|
# TCL/TK-based Rad Input File Editor |
| 11 |
|
|
| 12 |
|
set auto_path [linsert $auto_path 0 $radlib] |
| 13 |
|
|
| 14 |
+ |
# Assign global globbing variables |
| 15 |
+ |
|
| 16 |
+ |
set myglob(rif) *.rif |
| 17 |
+ |
set myglob(materials) *.mat |
| 18 |
+ |
set myglob(illum) *.rad |
| 19 |
+ |
set myglob(scene) *.rad |
| 20 |
+ |
set myglob(objects) * |
| 21 |
+ |
|
| 22 |
|
# Create required procedures |
| 23 |
|
|
| 24 |
|
proc modified {} { # check for radvar modification |
| 87 |
|
|
| 88 |
|
message .mess -relief ridge -font fixed -textvariable curmess -anchor nw |
| 89 |
|
if $smallscrn { |
| 90 |
< |
frame .upper -geometry 640x410 |
| 91 |
< |
frame .upper.right -geometry 120x410 |
| 90 |
> |
frame .upper -width 640 -height 410 |
| 91 |
> |
frame .upper.right -width 120 -height 410 |
| 92 |
|
.mess configure -width 640 |
| 93 |
|
} else { |
| 94 |
< |
frame .upper -geometry 830x410 |
| 95 |
< |
frame .upper.right -geometry 130x410 |
| 94 |
> |
frame .upper -width 830 -height 410 |
| 95 |
> |
frame .upper.right -width 130 -height 410 |
| 96 |
|
.mess configure -width 830 |
| 97 |
|
} |
| 98 |
|
pack .upper -side top |
| 114 |
|
set curscreen $curmode |
| 115 |
|
do_$curscreen .upper.left |
| 116 |
|
if $smallscrn { |
| 117 |
< |
.upper.left configure -geometry 520x410 |
| 117 |
> |
.upper.left configure -width 520 -height 410 |
| 118 |
|
} else { |
| 119 |
< |
.upper.left configure -geometry 700x410 |
| 119 |
> |
.upper.left configure -width 700 -height 410 |
| 120 |
|
} |
| 121 |
|
place .upper.left -x 0 -y 0 |
| 122 |
|
} |
| 143 |
|
rename setbutt {} |
| 144 |
|
button .upper.right.help -text HELP -width 9 \ |
| 145 |
|
-command "gethelp trad trad intro" |
| 146 |
< |
pack .upper.right.help -side top -pady 10 -anchor se |
| 146 |
> |
pack .upper.right.help -side top -pady 5 -anchor se |
| 147 |
|
helplink .upper.right.help trad trad help |
| 148 |
|
button .upper.right.quit -text QUIT \ |
| 149 |
|
-command {if [chksave] {destroy .}} -width 9 |
| 150 |
< |
pack .upper.right.quit -side top -pady 10 -anchor se |
| 150 |
> |
pack .upper.right.quit -side top -pady 5 -anchor se |
| 151 |
|
helplink .upper.right.quit trad trad quit |
| 152 |
|
|
| 153 |
|
if $smallscrn { |
| 159 |
|
} |
| 160 |
|
wm iconbitmap . @$radlib/trad.icon |
| 161 |
|
|
| 162 |
< |
proc gotfile {{o 1}} { # set file possession state |
| 162 |
> |
proc gotfile o { # set file possession state |
| 163 |
|
global oldradvar radvar |
| 164 |
|
catch {unset oldradvar} |
| 165 |
|
if $o { |
| 169 |
|
} |
| 170 |
|
} else { |
| 171 |
|
set mode disabled |
| 164 |
– |
.file invoke |
| 172 |
|
} |
| 173 |
|
foreach b {scene zone views options action results} { |
| 174 |
|
.$b configure -state $mode |
| 177 |
|
|
| 178 |
|
# Decide where to go and start |
| 179 |
|
|
| 180 |
+ |
gotfile 0 |
| 181 |
|
if {[llength $argv] == 0} { |
| 182 |
|
set curmess "Choose a Radiance project file." |
| 183 |
< |
gotfile 0 |
| 183 |
> |
.file invoke |
| 184 |
|
} elseif {[llength $argv] == 1} { |
| 185 |
|
cd [file dirname $argv] |
| 186 |
|
set curfile [file tail $argv] |
| 187 |
< |
if {! [file exists $curfile]} { |
| 188 |
< |
newnew $curfile |
| 189 |
< |
.scene invoke |
| 187 |
> |
if {! [file isfile $curfile]} { |
| 188 |
> |
if [newnew $curfile] { |
| 189 |
> |
.scene invoke |
| 190 |
> |
} else { |
| 191 |
> |
.file invoke |
| 192 |
> |
} |
| 193 |
|
} elseif {[newload $curfile]} { |
| 194 |
|
if $alldone { |
| 195 |
|
set curmess "All renderings are finished." |