ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/trad.wsh
(Generate patch)

Comparing ray/src/util/trad.wsh (file contents):
Revision 2.8 by greg, Mon Nov 28 12:15:18 1994 UTC vs.
Revision 2.13 by greg, Tue Oct 17 21:28:21 1995 UTC

# Line 1 | Line 1
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
# Line 27 | Line 27 | proc modified {} {     # check for radvar modification
27  
28   proc chksave {} {       # check if RIF is saved and accost user if not
29          global readonly rifname oldradvar curmess
30 <        if $readonly {
31 <                set warnmess "You have modified variables, but the file\
32 < \"[file tail $rifname]\" was opened read-only.
30 >        if [modified] {
31 >                if $readonly {
32 >                        set warnmess "You have modified variables, but the\
33 > file \"[file tail $rifname]\" was opened read-only.
34   Do you wish to save this information somehow?"
35 <                set yesmess {Go to File Screen}
36 <        } else {
37 <                set warnmess "The file \"[file tail $rifname]\" has been\
38 < modified since it was last saved.
35 > set yesmess {Go to File Screen}
36 >                } else {
37 >                        set warnmess "The file \"[file tail $rifname]\" has\
38 > been modified since it was last saved.
39   Do you wish to save it now?"
40 <                set yesmess {Save File}
41 <        }
41 <        if [modified] {
40 >                        set yesmess {Save File}
41 >                }
42                  switch [tk_dialog .dlg {File Modified} $warnmess \
43                                  warning 0 $yesmess {Discard Changes} \
44                                  {Cancel Operation}] {
# Line 52 | Line 52 | Do you wish to save it now?"
52                  } elseif {[save_vars $rifname]} {
53                          gotfile 1
54                          return 1
55 <                } else { return 0 }
56 <        } else { return 1 }
55 >                }
56 >                return 0
57 >        }
58 >        return 1
59   }
60  
61   # Set global variable default values
# Line 77 | Line 79 | set smallscrn [expr [winfo screenwidth .] < 830]
79  
80   message .mess -relief ridge -font fixed -textvariable curmess -anchor nw
81   if $smallscrn {
82 <        frame .upper -geometry 640x410
83 <        frame .upper.right -geometry 120x410
82 >        frame .upper -width 640 -height 410
83 >        frame .upper.right -width 120 -height 410
84          .mess configure -width 640
85   } else {
86 <        frame .upper -geometry 830x410
87 <        frame .upper.right -geometry 130x410
86 >        frame .upper -width 830 -height 410
87 >        frame .upper.right -width 130 -height 410
88          .mess configure -width 830
89   }
90   pack .upper -side top
# Line 104 | Line 106 | proc changescreen {} {         # switch screen according to c
106          set curscreen $curmode
107          do_$curscreen .upper.left
108          if $smallscrn {
109 <                .upper.left configure -geometry 520x410
109 >                .upper.left configure -width 520 -height 410
110          } else {
111 <                .upper.left configure -geometry 700x410
111 >                .upper.left configure -width 700 -height 410
112          }
113          place .upper.left -x 0 -y 0
114   }
# Line 133 | Line 135 | setbutt results
135   rename setbutt {}
136   button .upper.right.help -text HELP -width 9 \
137                  -command "gethelp trad trad intro"
138 < pack .upper.right.help -side top -pady 10 -anchor se
138 > pack .upper.right.help -side top -pady 5 -anchor se
139   helplink .upper.right.help trad trad help
140   button .upper.right.quit -text QUIT \
141                  -command {if [chksave] {destroy .}} -width 9
142 < pack .upper.right.quit -side top -pady 10 -anchor se
142 > pack .upper.right.quit -side top -pady 5 -anchor se
143   helplink .upper.right.quit trad trad quit
144  
145   if $smallscrn {
# Line 149 | Line 151 | if $smallscrn {
151   }
152   wm iconbitmap . @$radlib/trad.icon
153  
154 < proc gotfile {{o 1}} {          # set file possession state
154 > proc gotfile o {                # set file possession state
155          global oldradvar radvar
156          catch {unset oldradvar}
157          if $o {
# Line 159 | Line 161 | proc gotfile {{o 1}} {         # set file possession state
161                  }
162          } else {
163                  set mode disabled
162                .file invoke
164          }
165          foreach b {scene zone views options action results} {
166                  .$b configure -state $mode
# Line 168 | Line 169 | proc gotfile {{o 1}} {         # set file possession state
169  
170   # Decide where to go and start
171  
172 + gotfile 0
173   if {[llength $argv] == 0} {
174          set curmess "Choose a Radiance project file."
175 <        gotfile 0
175 >        .file invoke
176   } elseif {[llength $argv] == 1} {
177          cd [file dirname $argv]
178          set curfile [file tail $argv]
179 <        if {! [file exists $curfile]} {
180 <                newnew $curfile
181 <                .scene invoke
179 >        if {! [file isfile $curfile]} {
180 >                if [newnew $curfile] {
181 >                        .scene invoke
182 >                } else {
183 >                        .file invoke
184 >                }
185          } elseif {[newload $curfile]} {
186                  if $alldone {
187                          set curmess "All renderings are finished."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines