- Timestamp:
- Apr 2, 2009, 6:05:34 PM (16 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/Makefile.in
r1295 r1375 87 87 $(srcdir)/sequenceresult.tcl \ 88 88 $(srcdir)/service.tcl \ 89 $(srcdir)/sidebarframe.tcl \ 89 90 $(srcdir)/spectrum.tcl \ 90 91 $(srcdir)/spinint.tcl \ -
trunk/gui/scripts/flowvisviewer.tcl
r1373 r1375 24 24 option add *FlowvisViewer.height 4i widgetDefault 25 25 option add *FlowvisViewer.foreground black widgetDefault 26 option add *FlowvisViewer.controlBackground gray widgetDefault27 option add *FlowvisViewer.controlDarkBackground #999999 widgetDefault28 26 option add *FlowvisViewer.plotBackground black widgetDefault 29 27 option add *FlowvisViewer.plotForeground white widgetDefault … … 73 71 74 72 public method camera {option args} 75 public method tab {what who}76 73 77 74 protected method Connect {} … … 145 142 146 143 private common hardcopy_ 147 private variable headings_148 144 } 149 145 … … 211 207 set settings_($this-speed) 10 212 208 209 set f [$itk_component(main) component controls] 213 210 itk_component add reset { 214 button $itk_component(controls).reset \ 215 -borderwidth 1 -padx 1 -pady 1 \ 211 button $f.reset -borderwidth 1 -padx 1 -pady 1 \ 216 212 -image [Rappture::icon reset-view] \ 217 213 -command [itcl::code $this Zoom reset] 218 } {219 usual220 ignore -borderwidth221 rename -highlightbackground -controlbackground controlBackground Background222 214 } 223 215 pack $itk_component(reset) -side top -padx 2 -pady 2 … … 225 217 226 218 itk_component add zoomin { 227 button $itk_component(controls).zin \ 228 -borderwidth 1 -padx 1 -pady 1 \ 219 button $f.zin -borderwidth 1 -padx 1 -pady 1 \ 229 220 -image [Rappture::icon zoom-in] \ 230 221 -command [itcl::code $this Zoom in] 231 } {232 usual233 ignore -borderwidth234 rename -highlightbackground -controlbackground controlBackground Background235 222 } 236 223 pack $itk_component(zoomin) -side top -padx 2 -pady 2 … … 238 225 239 226 itk_component add zoomout { 240 button $itk_component(controls).zout \ 241 -borderwidth 1 -padx 1 -pady 1 \ 227 button $f.zout -borderwidth 1 -padx 1 -pady 1 \ 242 228 -image [Rappture::icon zoom-out] \ 243 229 -command [itcl::code $this Zoom out] 244 } {245 usual246 ignore -borderwidth247 rename -highlightbackground -controlbackground controlBackground Background248 230 } 249 231 pack $itk_component(zoomout) -side top -padx 2 -pady 2 250 232 Rappture::Tooltip::for $itk_component(zoomout) "Zoom out" 251 252 itk_component add configure_button {253 label $itk_component(controls).configbutton \254 -borderwidth 1 -padx 1 -pady 1 \255 -relief "raised" -image [Rappture::icon wrench]256 } {257 usual258 ignore -borderwidth259 rename -highlightbackground -controlbackground controlBackground \260 Background261 }262 233 263 234 # … … 265 236 # 266 237 itk_component add volume { 267 label $itk_component(controls).volume \ 268 -borderwidth 1 -relief sunken -padx 1 -pady 1 \ 238 label $f.volume -borderwidth 1 -relief sunken -padx 1 -pady 1 \ 269 239 -text "Volume" \ 270 240 -image [Rappture::icon playback-record] 271 } {272 usual273 ignore -borderwidth274 rename -highlightbackground -controlbackground controlBackground Background275 241 } 276 242 bind $itk_component(volume) <ButtonPress> \ … … 438 404 439 405 set _image(download) [image create photo] 440 441 $itk_component(scroller) contents $itk_component(view_canvas)442 $itk_component(title) configure -text "$headings_(view)"443 406 444 407 eval itk_initialize $args … … 2047 2010 set settings_($this-$key) $value 2048 2011 } 2049 itk_component add view_canvas {2050 canvas $itk_component(scroller).viewcanvas -highlightthickness 02051 } {2052 ignore -highlightthickness2053 }2054 $itk_component(sidebar) insert end "view" \2055 -image [Rappture::icon wrench] -text "" -padx 0 -pady 0 \2056 -command [itcl::code $this tab select "view"]2057 set headings_(view) "View Settings"2058 2059 itk_component add view_frame {2060 frame $itk_component(view_canvas).frame \2061 -highlightthickness 02062 } {2063 ignore -highlightthickness2064 }2065 $itk_component(view_canvas) create window 0 0 \2066 -anchor nw -window $itk_component(view_frame)2067 bind $itk_component(view_frame) <Configure> \2068 [itcl::code $this tab resize "view"]2069 2070 set inner $itk_component(view_frame)2071 2012 2072 2013 set fg [option get $itk_component(hull) font Font] 2073 2014 #set bfg [option get $itk_component(hull) boldFont Font] 2015 2016 set inner [$itk_component(main) insert end \ 2017 -title "View Settings" \ 2018 -icon [Rappture::icon wrench]] 2019 $inner configure -borderwidth 4 2074 2020 2075 2021 set ::Rappture::FlowvisViewer::settings_($this-isosurface) 0 … … 2131 2077 6,0 $inner.lic -columnspan 1 -anchor w \ 2132 2078 2079 for {set n 0} {$n <= 6} {incr n} { 2080 blt::table configure $inner r$n -resize none 2081 } 2082 blt::table configure $inner r$n -resize expand 2133 2083 } 2134 2084 … … 2142 2092 set settings_($this-$key) $value 2143 2093 } 2144 itk_component add volume_canvas { 2145 canvas $itk_component(scroller).volumecanvas -highlightthickness 0 2146 } { 2147 ignore -highlightthickness 2148 } 2149 $itk_component(sidebar) insert end "volume" \ 2150 -image [Rappture::icon playback-record] -text "" -padx 0 -pady 0 \ 2151 -command [itcl::code $this tab select "volume"] 2152 set headings_(volume) "Volume Settings" 2153 2154 itk_component add volume_frame { 2155 frame $itk_component(volume_canvas).frame \ 2156 -highlightthickness 0 2157 } { 2158 ignore -highlightthickness 2159 } 2160 $itk_component(volume_canvas) create window 0 0 \ 2161 -anchor nw -window $itk_component(volume_frame) 2162 bind $itk_component(volume_frame) <Configure> \ 2163 [itcl::code $this tab resize "volume"] 2164 2165 set inner $itk_component(volume_frame) 2094 2095 set inner [$itk_component(main) insert end \ 2096 -title "Volume Settings" \ 2097 -icon [Rappture::icon playback-record]] 2098 $inner configure -borderwidth 4 2166 2099 2167 2100 set fg [option get $itk_component(hull) font Font] … … 2197 2130 2198 2131 blt::table $inner \ 2199 0,0 $inner.dim -anchor e \ 2200 0,1 $inner.light -columnspan 2 \ 2201 0,3 $inner.bright -anchor w \ 2202 1,0 $inner.fog -anchor e \ 2203 1,1 $inner.transp -columnspan 2 \ 2204 1,3 $inner.plastic -anchor w \ 2205 2,0 $inner.clear -anchor e \ 2206 2,1 $inner.opacity -columnspan 2 \ 2207 2,3 $inner.opaque -anchor w \ 2208 3,0 $inner.thin -anchor e \ 2209 3,1 $inner.thickness -columnspan 2 \ 2210 3,3 $inner.thick -anchor w \ 2132 0,0 $inner.dim -anchor e -pady 2 \ 2133 0,1 $inner.light -columnspan 2 -pady 2 \ 2134 0,3 $inner.bright -anchor w -pady 2 \ 2135 1,0 $inner.fog -anchor e -pady 2 \ 2136 1,1 $inner.transp -columnspan 2 -pady 2 \ 2137 1,3 $inner.plastic -anchor w -pady 2 \ 2138 2,0 $inner.clear -anchor e -pady 2 \ 2139 2,1 $inner.opacity -columnspan 2 -pady 2 \ 2140 2,3 $inner.opaque -anchor w -pady 2 \ 2141 3,0 $inner.thin -anchor e -pady 2 \ 2142 3,1 $inner.thickness -columnspan 2 -pady 2 \ 2143 3,3 $inner.thick -anchor w -pady 2 2144 2145 for {set n 0} {$n <= 3} {incr n} { 2146 blt::table configure $inner r$n -resize none 2147 } 2148 blt::table configure $inner r$n -resize expand 2211 2149 } 2212 2150 2213 2151 itcl::body Rappture::FlowvisViewer::BuildCutplanesTab {} { 2214 2215 itk_component add cutplanes_canvas { 2216 canvas $itk_component(scroller).cutplanescanvas -highlightthickness 0 2217 } { 2218 ignore -highlightthickness 2219 } 2220 $itk_component(sidebar) insert end "cutplanes" \ 2221 -image [Rappture::icon cutbutton] -text "" -padx 0 -pady 0 \ 2222 -command [itcl::code $this tab select "cutplanes"] 2223 set headings_(cutplanes) "Cutplane Settings" 2224 2225 itk_component add cutplanes_frame { 2226 frame $itk_component(cutplanes_canvas).frame \ 2227 -highlightthickness 0 2228 } { 2229 ignore -highlightthickness 2230 } 2231 $itk_component(cutplanes_canvas) create window 0 0 \ 2232 -anchor nw -window $itk_component(cutplanes_frame) 2233 bind $itk_component(cutplanes_frame) <Configure> \ 2234 [itcl::code $this tab resize cutplanes] 2235 2236 set inner $itk_component(cutplanes_frame) 2152 set inner [$itk_component(main) insert end \ 2153 -title "Cutplane Settings" \ 2154 -icon [Rappture::icon cutbutton]] 2155 $inner configure -borderwidth 4 2237 2156 2238 2157 # X-value slicer... 2239 2158 itk_component add xCutButton { 2240 label $i tk_component(cutplanes_frame).xbutton \2159 label $inner.xbutton \ 2241 2160 -borderwidth 1 -relief raised -padx 1 -pady 1 \ 2242 2161 -image [Rappture::icon x-cutplane] \ … … 2245 2164 usual 2246 2165 ignore -borderwidth -highlightthickness 2247 rename -highlightbackground -controlbackground \2248 controlBackground Background2249 2166 } 2250 2167 bind $itk_component(xCutButton) <ButtonPress> \ … … 2254 2171 2255 2172 itk_component add xCutScale { 2256 ::scale $i tk_component(cutplanes_frame).xval -from 100 -to 0 \2173 ::scale $inner.xval -from 100 -to 0 \ 2257 2174 -width 10 -orient vertical -showvalue off \ 2258 2175 -borderwidth 1 -highlightthickness 0 -state disabled \ … … 2260 2177 } { 2261 2178 usual 2262 ignore -borderwidth 2263 ignore -highlightthickness 2264 rename -highlightbackground -controlbackground \ 2265 controlBackground Background 2266 rename -troughcolor -controldarkbackground \ 2267 controlDarkBackground Background 2179 ignore -borderwidth -highlightthickness 2268 2180 } 2269 2181 $itk_component(xCutScale) set 50 … … 2273 2185 # Y-value slicer... 2274 2186 itk_component add yCutButton { 2275 label $i tk_component(cutplanes_frame).ybutton \2187 label $inner.ybutton \ 2276 2188 -borderwidth 1 -relief raised -padx 1 -pady 1 \ 2277 2189 -image [Rappture::icon y-cutplane] \ … … 2280 2192 usual 2281 2193 ignore -borderwidth -highlightthickness 2282 rename -highlightbackground -controlbackground \2283 controlBackground Background2284 2194 } 2285 2195 bind $itk_component(yCutButton) <ButtonPress> \ … … 2289 2199 2290 2200 itk_component add yCutScale { 2291 ::scale $i tk_component(cutplanes_frame).yval -from 100 -to 0 \2201 ::scale $inner.yval -from 100 -to 0 \ 2292 2202 -width 10 -orient vertical -showvalue off \ 2293 2203 -borderwidth 1 -highlightthickness 0 -state disabled \ … … 2295 2205 } { 2296 2206 usual 2297 ignore -borderwidth 2298 ignore -highlightthickness 2299 rename -highlightbackground -controlbackground controlBackground Background 2300 rename -troughcolor -controldarkbackground controlDarkBackground Background 2207 ignore -borderwidth -highlightthickness 2301 2208 } 2302 2209 Rappture::Tooltip::for $itk_component(yCutScale) \ … … 2306 2213 # Z-value slicer... 2307 2214 itk_component add zCutButton { 2308 label $i tk_component(cutplanes_frame).zbutton \2215 label $inner.zbutton \ 2309 2216 -borderwidth 1 -relief raised -padx 1 -pady 1 \ 2310 2217 -image [Rappture::icon z-cutplane] \ … … 2313 2220 usual 2314 2221 ignore -borderwidth -highlightthickness 2315 rename -highlightbackground -controlbackground controlBackground Background2316 2222 } 2317 2223 bind $itk_component(zCutButton) <ButtonPress> \ … … 2321 2227 2322 2228 itk_component add zCutScale { 2323 ::scale $i tk_component(cutplanes_frame).zval -from 100 -to 0 \2229 ::scale $inner.zval -from 100 -to 0 \ 2324 2230 -width 10 -orient vertical -showvalue off \ 2325 2231 -borderwidth 1 -highlightthickness 0 -state disabled \ … … 2327 2233 } { 2328 2234 usual 2329 ignore -borderwidth 2330 ignore -highlightthickness 2331 rename -highlightbackground -controlbackground controlBackground Background 2332 rename -troughcolor -controldarkbackground controlDarkBackground Background 2235 ignore -borderwidth -highlightthickness 2333 2236 } 2334 2237 $itk_component(zCutScale) set 50 … … 2344 2247 0,1 $itk_component(yCutScale) \ 2345 2248 0,2 $itk_component(zCutScale) \ 2249 2250 for {set n 0} {$n <= 1} {incr n} { 2251 blt::table configure $inner r$n -resize none 2252 } 2253 blt::table configure $inner r$n -resize expand 2346 2254 } 2347 2255 2348 2256 itcl::body Rappture::FlowvisViewer::BuildCameraTab {} { 2349 2350 itk_component add camera_canvas { 2351 canvas $itk_component(scroller).cameracanvas -highlightthickness 0 2352 } { 2353 ignore -highlightthickness 2354 } 2355 $itk_component(sidebar) insert end "camera" \ 2356 -image [Rappture::icon camera] -text "" -padx 0 -pady 0 \ 2357 -command [itcl::code $this tab select "camera"] 2358 set headings_(camera) "Camera Settings" 2359 2360 itk_component add camera_frame { 2361 frame $itk_component(camera_canvas).frame \ 2362 -highlightthickness 0 2363 } 2364 $itk_component(camera_canvas) create window 0 0 \ 2365 -anchor nw -window $itk_component(camera_frame) 2366 bind $itk_component(camera_frame) <Configure> \ 2367 [itcl::code $this tab resize "camera"] 2368 2369 set inner $itk_component(camera_frame) 2257 set inner [$itk_component(main) insert end \ 2258 -title "Camera Settings" \ 2259 -icon [Rappture::icon camera]] 2260 $inner configure -borderwidth 4 2370 2261 2371 2262 set labels { phi theta psi pan-x pan-y zoom } … … 2378 2269 [itcl::code $this camera set ${tag}] 2379 2270 blt::table $inner \ 2380 $row,0 $inner.${tag}label -anchor e \ 2381 $row,1 $inner.${tag} -anchor w 2271 $row,0 $inner.${tag}label -anchor e -pady 2 \ 2272 $row,1 $inner.${tag} -anchor w -pady 2 2273 blt::table configure $inner r$row -resize none 2382 2274 incr row 2383 2275 } 2384 2276 blt::table configure $inner c0 c1 -resize none 2385 2277 blt::table configure $inner c2 -resize expand 2386 2278 blt::table configure $inner r$row -resize expand 2387 2279 } 2388 2280 … … 2495 2387 return "" 2496 2388 } 2497 2498 itcl::body Rappture::FlowvisViewer::tab { what who } {2499 switch -- ${what} {2500 "select" {2501 $itk_component(scroller) contents $itk_component(${who}_canvas)2502 after idle [list focus $itk_component(${who}_canvas)]2503 $itk_component(title) configure -text "$headings_($who)"2504 drawer open2505 }2506 "deselect" {2507 drawer close2508 }2509 "resize" {2510 set bbox [$itk_component(${who}_canvas) bbox all]2511 set wid [winfo width $itk_component(${who}_frame)]2512 $itk_component(${who}_canvas) configure -width $wid \2513 -scrollregion $bbox -yscrollincrement 0.1i2514 }2515 }2516 }2517 -
trunk/gui/scripts/heightmapviewer.tcl
r1373 r1375 21 21 option add *HeightmapViewer.height 4i widgetDefault 22 22 option add *HeightmapViewer.foreground black widgetDefault 23 option add *HeightmapViewer.controlBackground gray widgetDefault24 option add *HeightmapViewer.controlDarkBackground #999999 widgetDefault25 23 option add *HeightmapViewer.plotBackground black widgetDefault 26 24 option add *HeightmapViewer.plotForeground white widgetDefault … … 62 60 # do nothing 63 61 } 64 public method tab {what who}65 62 public method camera {option args} 66 63 protected method Connect {} … … 100 97 private common settings_ ;# Array used for checkbuttons and radiobuttons 101 98 private common hardcopy_ 102 private variable headings_103 99 } 104 100 … … 143 139 set obj2id_(count) 0 144 140 141 set f [$itk_component(main) component controls] 145 142 itk_component add zoom { 146 frame $itk_component(controls).zoom 147 } { 148 usual 149 rename -background -controlbackground controlBackground Background 143 frame $f.zoom 150 144 } 151 145 pack $itk_component(zoom) -side top 152 146 153 147 itk_component add reset { 154 button $itk_component(zoom).reset \ 155 -borderwidth 1 -padx 1 -pady 1 \ 148 button $f.reset -borderwidth 1 -padx 1 -pady 1 \ 156 149 -image [Rappture::icon reset-view] \ 157 150 -command [itcl::code $this _zoom reset] 158 } {159 usual160 ignore -borderwidth161 rename -highlightbackground -controlbackground controlBackground Background162 151 } 163 152 pack $itk_component(reset) -side top -padx 1 -pady { 4 0 } … … 165 154 166 155 itk_component add zoomin { 167 button $itk_component(zoom).zin \ 168 -borderwidth 1 -padx 1 -pady 1 \ 156 button $f.zin -borderwidth 1 -padx 1 -pady 1 \ 169 157 -image [Rappture::icon zoom-in] \ 170 158 -command [itcl::code $this _zoom in] 171 } {172 usual173 ignore -borderwidth174 rename -highlightbackground -controlbackground controlBackground Background175 159 } 176 160 pack $itk_component(zoomin) -side top -padx 1 -pady { 4 0 } … … 178 162 179 163 itk_component add zoomout { 180 button $itk_component(zoom).zout \ 181 -borderwidth 1 -padx 1 -pady 1 \ 164 button $f.zout -borderwidth 1 -padx 1 -pady 1 \ 182 165 -image [Rappture::icon zoom-out] \ 183 166 -command [itcl::code $this _zoom out] 184 } {185 usual186 ignore -borderwidth187 rename -highlightbackground -controlbackground controlBackground Background188 167 } 189 168 pack $itk_component(zoomout) -side top -padx 1 -pady { 4 } … … 260 239 } 261 240 262 $itk_component(scroller) contents $itk_component(view_canvas)263 $itk_component(title) configure -text "$headings_(view)"264 241 set _image(download) [image create photo] 265 242 eval itk_initialize $args … … 1129 1106 1130 1107 itcl::body Rappture::HeightmapViewer::_BuildViewTab {} { 1131 1132 itk_component add view_canvas {1133 canvas $itk_component(scroller).viewcanvas -highlightthickness 01134 } {1135 ignore -highlightthickness1136 }1137 $itk_component(sidebar) insert end "view" \1138 -image [Rappture::icon wrench] -text "" -padx 0 -pady 0 \1139 -ipadx 0 -ipady 0 \1140 -command [itcl::code $this tab select "view"]1141 1142 set headings_(view) "View Settings"1143 1144 itk_component add view_frame {1145 frame $itk_component(view_canvas).frame \1146 -highlightthickness 01147 } {1148 ignore -background1149 }1150 $itk_component(view_canvas) create window 0 0 \1151 -anchor nw -window $itk_component(view_frame)1152 bind $itk_component(view_frame) <Configure> \1153 [itcl::code $this tab resize view]1154 1155 1108 set fg [option get $itk_component(hull) font Font] 1156 1109 1157 set inner $itk_component(view_frame) 1110 set inner [$itk_component(main) insert end \ 1111 -title "View Settings" \ 1112 -icon [Rappture::icon wrench]] 1113 $inner configure -borderwidth 4 1158 1114 1159 1115 foreach { key value } { … … 1166 1122 set settings_($this-$key) $value 1167 1123 } 1168 set inner $itk_component(view_frame) 1124 1169 1125 checkbutton $inner.grid \ 1170 1126 -text "grid" \ … … 1203 1159 blt::table configure $inner c2 -resize expand 1204 1160 blt::table configure $inner c1 -resize none 1205 1161 for {set n 0} {$n <= 5} {incr n} { 1162 blt::table configure $inner r$n -resize none 1163 } 1164 blt::table configure $inner r$n -resize expand 1206 1165 } 1207 1166 1208 1167 itcl::body Rappture::HeightmapViewer::_BuildCameraTab {} { 1209 1210 itk_component add camera_canvas { 1211 canvas $itk_component(scroller).cameracanvas -highlightthickness 0 1212 } { 1213 ignore -highlightthickness 1214 } 1215 $itk_component(sidebar) insert end "camera" \ 1216 -image [Rappture::icon camera] -text "" -padx 0 -pady 0 \ 1217 -ipadx 0 -ipady 0 \ 1218 -command [itcl::code $this tab select "camera"] 1219 set headings_(camera) "Camera Settings" 1220 1221 itk_component add camera_frame { 1222 frame $itk_component(camera_canvas).frame \ 1223 -highlightthickness 0 1224 } { 1225 usual 1226 ignore -background 1227 } 1228 $itk_component(camera_canvas) create window 0 0 \ 1229 -anchor nw -window $itk_component(camera_frame) 1230 bind $itk_component(camera_frame) <Configure> \ 1231 [itcl::code $this tab resize camera] 1232 1233 set inner $itk_component(camera_frame) 1168 set fg [option get $itk_component(hull) font Font] 1169 1170 set inner [$itk_component(main) insert end \ 1171 -title "Camera Settings" \ 1172 -icon [Rappture::icon camera]] 1173 $inner configure -borderwidth 4 1234 1174 1235 1175 set labels { phi theta psi pan-x pan-y zoom } … … 1237 1177 foreach tag $labels { 1238 1178 label $inner.${tag}label -text $tag -font "Arial 9" 1239 entry $inner.${tag} -font "Arial 9" -bg white\1179 entry $inner.${tag} -font "Arial 9" -bg white -width 10 \ 1240 1180 -textvariable [itcl::scope settings_($this-$tag)] 1241 1181 bind $inner.${tag} <KeyPress-Return> \ … … 1244 1184 $row,1 $inner.${tag}label -anchor e \ 1245 1185 $row,2 $inner.${tag} -anchor w 1186 blt::table configure $inner r$row -resize none 1246 1187 incr row 1247 1188 } 1248 1189 blt::table configure $inner c1 c2 -resize none 1249 1190 blt::table configure $inner c3 -resize expand 1250 1251 } 1252 1253 itcl::body Rappture::HeightmapViewer::tab { what who } { 1254 switch -- ${what} { 1255 "select" { 1256 $itk_component(scroller) contents $itk_component(${who}_canvas) 1257 after idle [list focus $itk_component(${who}_canvas)] 1258 $itk_component(title) configure -text "$headings_($who)" 1259 drawer open 1260 } 1261 "deselect" { 1262 drawer close 1263 } 1264 "resize" { 1265 set bbox [$itk_component(${who}_canvas) bbox all] 1266 set wid [winfo width $itk_component(${who}_frame)] 1267 $itk_component(${who}_canvas) configure -width $wid \ 1268 -scrollregion $bbox -yscrollincrement 0.1i 1269 } 1270 } 1271 } 1272 1191 blt::table configure $inner r$row -resize expand 1192 } -
trunk/gui/scripts/molvisviewer.tcl
r1373 r1375 20 20 option add *MolvisViewer.height 4i widgetDefault 21 21 option add *MolvisViewer.foreground black widgetDefault 22 option add *MolvisViewer.controlBackground gray widgetDefault23 option add *MolvisViewer.controlDarkBackground #999999 widgetDefault24 22 option add *MolvisViewer.font -*-helvetica-medium-r-normal-*-12-* widgetDefault 25 23 … … 71 69 public method bondthickness {option {model "all"} } 72 70 public method ResetView {} 73 public method tab {what who}74 71 75 72 protected method _send {args} … … 122 119 private common hardcopy_ 123 120 private variable nextToken_ 0 124 private variable headings_125 121 } 126 122 … … 196 192 # Set up the widgets in the main body 197 193 # 194 set f [$itk_component(main) component controls] 198 195 itk_component add reset { 199 button $itk_component(controls).reset \ 200 -borderwidth 1 -padx 1 -pady 1 \ 196 button $f.reset -borderwidth 1 -padx 1 -pady 1 \ 201 197 -image [Rappture::icon reset-view] \ 202 198 -command [itcl::code $this ResetView] 203 } {204 usual205 ignore -borderwidth206 rename -highlightbackground -controlbackground controlBackground \207 Background208 199 } 209 200 pack $itk_component(reset) -padx 1 -pady 2 … … 212 203 213 204 itk_component add zoomin { 214 button $itk_component(controls).zin \ 215 -borderwidth 1 -padx 1 -pady 1 \ 205 button $f.zin -borderwidth 1 -padx 1 -pady 1 \ 216 206 -image [Rappture::icon zoom-in] \ 217 207 -command [itcl::code $this _zoom in] 218 } {219 usual220 ignore -borderwidth221 rename -highlightbackground -controlbackground \222 controlBackground Background223 208 } 224 209 pack $itk_component(zoomin) -padx 2 -pady { 0 2 } … … 226 211 227 212 itk_component add zoomout { 228 button $itk_component(controls).zout \ 229 -borderwidth 1 -padx 1 -pady 1 \ 213 button $f.zout -borderwidth 1 -padx 1 -pady 1 \ 230 214 -image [Rappture::icon zoom-out] \ 231 215 -command [itcl::code $this _zoom out] 232 } {233 usual234 ignore -borderwidth235 rename -highlightbackground -controlbackground controlBackground \236 Background237 216 } 238 217 pack $itk_component(zoomout) -padx 2 -pady { 0 2 } 239 218 Rappture::Tooltip::for $itk_component(zoomout) "Zoom out" 240 219 241 #242 # Shortcuts243 #244 itk_component add shortcuts {245 frame $itk_component(controls).shortcuts246 } {247 usual248 rename -background -controlbackground controlBackground Background249 }250 pack $itk_component(shortcuts) -side top251 252 220 itk_component add labels { 253 label $itk_component(shortcuts).labels \ 254 -borderwidth 1 -padx 1 -pady 1 \ 221 label $f.labels -borderwidth 1 -padx 1 -pady 1 \ 255 222 -relief "raised" -image [Rappture::icon atom-label] 256 } {257 usual258 ignore -borderwidth259 rename -highlightbackground -controlbackground controlBackground \260 Background261 223 } 262 224 pack $itk_component(labels) -padx 2 -pady { 0 2} -ipadx 1 -ipady 1 … … 267 229 268 230 itk_component add rock { 269 label $itk_component(shortcuts).rock \ 270 -borderwidth 1 -padx 1 -pady 1 \ 231 label $f.rock -borderwidth 1 -padx 1 -pady 1 \ 271 232 -relief "raised" -image [Rappture::icon rock-view] 272 } {273 usual274 ignore -borderwidth275 rename -highlightbackground -controlbackground controlBackground \276 Background277 233 } 278 234 pack $itk_component(rock) -padx 2 -pady { 0 2 } -ipadx 1 -ipady 1 … … 284 240 285 241 itk_component add ortho { 286 label $itk_component(shortcuts).ortho \ 287 -borderwidth 1 -padx 1 -pady 1 \ 242 label $f.ortho -borderwidth 1 -padx 1 -pady 1 \ 288 243 -relief "raised" -image [Rappture::icon 3dpers] 289 } {290 usual291 ignore -borderwidth292 rename -highlightbackground -controlbackground controlBackground \293 Background294 244 } 295 245 pack $itk_component(ortho) -padx 2 -pady { 0 2 } -ipadx 1 -ipady 1 … … 300 250 [itcl::code $this projection toggle] 301 251 $this projection perspective 302 303 itk_component add configure_button {304 label $itk_component(controls).configbutton \305 -borderwidth 1 -padx 1 -pady 1 \306 -relief "raised" -image [Rappture::icon wrench]307 } {308 usual309 ignore -borderwidth310 rename -highlightbackground -controlbackground controlBackground \311 Background312 }313 252 314 253 _BuildViewTab … … 401 340 [itcl::code $this _map] 402 341 403 $itk_component(scroller) contents $itk_component(view_canvas)404 $itk_component(title) configure -text "$headings_(view)"405 406 342 eval itk_initialize $args 407 343 Connect … … 409 345 410 346 itcl::body Rappture::MolvisViewer::_BuildViewTab {} { 411 412 itk_component add view_canvas {413 canvas $itk_component(scroller).viewcanvas -highlightthickness 0414 } {415 ignore -highlightthickness416 }417 $itk_component(sidebar) insert end "view" \418 -image [Rappture::icon wrench] -text "" -padx 0 -pady 0 \419 -command [itcl::code $this tab select "view"]420 set headings_(view) "View Settings"421 422 itk_component add view_frame {423 frame $itk_component(view_canvas).frame -bg white424 }425 $itk_component(view_canvas) create window 0 0 \426 -anchor nw -window $itk_component(view_frame)427 bind $itk_component(view_frame) <Configure> \428 [itcl::code $this tab resize view]429 430 347 set fg [option get $itk_component(hull) font Font] 431 348 432 set inner $itk_component(view_frame) 349 set inner [$itk_component(main) insert end \ 350 -title "View Settings" \ 351 -icon [Rappture::icon wrench]] 352 $inner configure -borderwidth 4 353 433 354 label $inner.drawinglabel -text "Drawing Method" -font "Arial 9 bold" 434 355 … … 473 394 -variable Rappture::MolvisViewer::_settings($this-ortho) \ 474 395 -font "Arial 9 bold" 396 397 label $inner.spacer 475 398 blt::table $inner \ 476 399 0,0 $inner.drawinglabel -anchor w -columnspan 4 \ … … 479 402 2,2 $inner.lines -anchor w -columnspan 2 \ 480 403 3,2 $inner.bstick -anchor w -columnspan 2 \ 481 4,0 $inner.labels -anchor w -columnspan 4 \482 5,0 $inner.rock -anchor w -columnspan 4 \483 6,0 $inner.ortho -anchor w -columnspan 4 \484 8,1 $inner.atomscale - anchor w -columnspan 2\485 10,1 $inner.bondthickness - anchor w -columnspan 2404 4,0 $inner.labels -anchor w -columnspan 4 -pady {6 0} \ 405 5,0 $inner.rock -anchor w -columnspan 4 -pady {6 0} \ 406 6,0 $inner.ortho -anchor w -columnspan 4 -pady {6 0} \ 407 8,1 $inner.atomscale -fill x -columnspan 4 -pady {6 0} \ 408 10,1 $inner.bondthickness -fill x -columnspan 4 -pady {6 0} 486 409 487 410 blt::table configure $inner c0 -resize expand -width 2 488 411 blt::table configure $inner c1 c2 -resize none 489 412 blt::table configure $inner c3 -resize expand 413 for {set n 0} {$n <= 10} {incr n} { 414 blt::table configure $inner r$n -resize none 415 } 416 blt::table configure $inner r$n -resize expand 490 417 } 491 418 … … 1228 1155 } 1229 1156 set _settings($this-modelimg) [Rappture::icon $option] 1230 #@set inner [$itk_component(controls).panel component inner] 1231 set inner $itk_component(settings_frame) 1157 set inner [$itk_component(main) panel "View Settings"] 1232 1158 $inner.pict configure -image $_settings($this-modelimg) 1233 1159 … … 1632 1558 return "" 1633 1559 } 1634 1635 itcl::body Rappture::MolvisViewer::tab { what who } {1636 switch -- ${what} {1637 "select" {1638 $itk_component(scroller) contents $itk_component(${who}_canvas)1639 after idle [list focus $itk_component(${who}_canvas)]1640 $itk_component(title) configure -text "$headings_($who)"1641 drawer open1642 }1643 "deselect" {1644 drawer close1645 }1646 "resize" {1647 set bbox [$itk_component(${who}_canvas) bbox all]1648 set wid [winfo width $itk_component(${who}_frame)]1649 $itk_component(${who}_canvas) configure -width $wid \1650 -scrollregion $bbox -yscrollincrement 0.1i1651 }1652 }1653 } -
trunk/gui/scripts/scroller.tcl
r1342 r1375 113 113 itcl::body Rappture::Scroller::contents {{widget "!@#query"}} { 114 114 if {$widget == "!@#query"} { 115 if {$_contents == $_frame} { 116 return $_frame.f 117 } 115 118 return $_contents 116 119 } … … 268 271 } 269 272 outer { 270 $_frame itemconfigure frame -width [winfo width $_frame] 273 if {[winfo width $_frame] > [winfo reqwidth $_frame.f]} { 274 $_frame itemconfigure frame -width [winfo width $_frame] 275 } else { 276 $_frame itemconfigure frame -width 0 277 } 271 278 if {[winfo height $_frame] > [winfo reqheight $_frame.f]} { 272 279 $_frame itemconfigure frame -height [winfo height $_frame] -
trunk/gui/scripts/visviewer.tcl
r1373 r1375 65 65 protected method Color2RGB { color } 66 66 protected method Euler2XYZ { theta phi psi } 67 protected method drawer {what}68 67 69 68 private proc _CheckNameList { namelist } { … … 90 89 itk::usual Panedwindow { 91 90 keep -background -cursor 92 }93 itk::usual Tabset {94 keep -background95 91 } 96 92 … … 124 120 pack propagate $itk_component(hull) no 125 121 126 itk_component add panes { 127 panedwindow $itk_interior.panes \ 128 -orient horizontal -opaqueresize 1 -handlepad 0 \ 129 -handlesize 1 -sashwidth 2 130 } 131 pack $itk_component(panes) -expand yes -fill both 122 itk_component add main { 123 Rappture::SidebarFrame $itk_interior.main 124 } 125 pack $itk_component(main) -expand yes -fill both 126 set f [$itk_component(main) component frame] 132 127 133 128 itk_component add plotarea { 134 frame $itk_component(panes).plotarea -highlightthickness 0 135 } 136 $itk_component(panes) add $itk_component(plotarea) -sticky nsew 129 frame $f.plotarea -highlightthickness 0 130 } 137 131 set _image(plot) [image create photo] 138 132 itk_component add 3dview { … … 143 137 ignore -highlightthickness -borderwidth 144 138 } 145 itk_component add drawer {146 frame $itk_component(panes).cntls147 } {148 usual149 rename -background -controlbackground controlBackground Background150 }151 itk_component add controls {152 frame $itk_component(drawer).cntls153 } {154 usual155 rename -background -controlbackground controlBackground Background156 ignore -highlightthickness -borderwidth157 }158 159 itk_component add titlebar {160 frame $itk_component(drawer).titlebar -background \#6666cc161 } {162 usual163 ignore -highlightthickness -borderwidth -background164 }165 166 itk_component add title {167 label $itk_component(titlebar).title -text "This is the title bar" \168 -background \#6666cc -font "Arial 8" -foreground white169 } {170 usual171 ignore -background -font -foreground172 }173 itk_component add flipswitch {174 button $itk_component(titlebar).flip \175 -borderwidth 1 -highlightthickness 0 \176 -relief "flat" -image [Rappture::icon sbar-open] \177 -command [itcl::code $this drawer toggle] \178 -background \#6666cc -foreground white -overrelief raised \179 -activebackground \#6666cc -activeforeground white180 181 } {182 ignore -borderwidth183 rename -highlightbackground -controlbackground controlBackground \184 Background185 }186 Rappture::Tooltip::for $itk_component(flipswitch) \187 "Configure settings"188 189 blt::table $itk_component(titlebar) \190 0,0 $itk_component(flipswitch) -ipady 2 -ipadx 5 -anchor w \191 0,1 $itk_component(title) -anchor w192 blt::table configure $itk_component(titlebar) c0 -width 30193 194 itk_component add sidebar {195 blt::tabset $itk_component(drawer).sidebar \196 -highlightthickness 0 -tearoff 0 -side left \197 -bd 0 -gap 0 -tabborderwidth 1 \198 -outerpad 0199 } {200 usual201 ignore -highlightthickness -borderwidth202 rename -highlightbackground -controlbackground controlBackground \203 Background204 rename -background -controlbackground controlBackground \205 Background206 }207 itk_component add scroller {208 Rappture::Scroller $itk_component(drawer).scroller \209 -xscrollmode auto -yscrollmode auto \210 -highlightthickness 0211 }212 blt::table $itk_component(drawer) \213 0,0 $itk_component(titlebar) -fill x -anchor w -columnspan 2 \214 1,0 $itk_component(controls) -fill y -anchor n -pady 3 \215 1,1 $itk_component(scroller) -rowspan 2 -fill both \216 2,0 $itk_component(sidebar) -fill y -anchor s217 218 $itk_component(panes) add $itk_component(drawer) -sticky nsew219 blt::table configure $itk_component(drawer) r0 c1 r1 c0 -resize none220 blt::table configure $itk_component(drawer) c2 -resize expand221 blt::table configure $itk_component(drawer) r2 -resize expand222 139 223 140 eval itk_initialize $args 224 225 # Two things wrong with the tk:panedwindow.226 # 1. can't disable the sash. Maybe I can hide it.227 # 2. can't set/force the width of a pane.228 229 $itk_component(panes) paneconfigure $itk_component(drawer) \230 -minsize 30231 141 } 232 142 … … 622 532 } 623 533 } 624 625 itcl::body Rappture::VisViewer::drawer { what } {626 switch -- ${what} {627 "open" {628 after idle [list focus $itk_component(drawer)]629 set win [$itk_component(scroller) contents]630 set w1 [winfo reqwidth $win]631 set w2 [winfo reqwidth $itk_component(title)]632 set w [expr max($w1,$w2) + 30]633 set x [expr [winfo width $itk_component(panes)] - $w]634 $itk_component(panes) sash place 0 $x 0635 $itk_component(panes) paneconfigure $itk_component(drawer) \636 -width $w637 #sash place 0 $x 0638 $itk_component(flipswitch) configure \639 -image [Rappture::icon sbar-closed]640 set isOpen_ 1641 }642 "close" {643 $itk_component(flipswitch) configure \644 -image [Rappture::icon sbar-open]645 set w [winfo width $itk_component(panes)]646 if { $w <= 1 } {647 set w [winfo reqwidth $itk_component(panes)]648 }649 set x [lindex [$itk_component(panes) sash coord 0] 0]650 set initialized_(drawer) $x651 $itk_component(panes) paneconfigure $itk_component(drawer) \652 -minsize 30653 set x [expr $w - 30]654 $itk_component(panes) sash place 0 $x 0655 set isOpen_ 0656 }657 "toggle" {658 if { $isOpen_ } {659 drawer close660 } else {661 drawer open662 }663 }664 }665 } -
trunk/gui/scripts/xyresult.tcl
r1342 r1375 85 85 public method parameters {title args} { # do nothing } 86 86 public method download {option args} 87 public method legend {option args}88 87 89 88 protected method _rebuild {} … … 142 141 pack propagate $itk_component(hull) no 143 142 144 itk_component add controls { 145 frame $itk_interior.cntls 146 } { 147 usual 148 rename -background -controlbackground controlBackground Background 149 } 150 pack $itk_component(controls) -side right -fill y 143 itk_component add main { 144 Rappture::SidebarFrame $itk_interior.main 145 } 146 pack $itk_component(main) -expand yes -fill both 147 set f [$itk_component(main) component controls] 151 148 152 149 itk_component add reset { 153 button $itk_component(controls).reset \ 154 -borderwidth 1 -padx 1 -pady 1 \ 150 button $f.reset -borderwidth 1 -padx 1 -pady 1 \ 155 151 -image [Rappture::icon reset-view] \ 156 152 -command [itcl::code $this _zoom reset] … … 158 154 usual 159 155 ignore -borderwidth 160 rename -highlightbackground -controlbackground controlBackground Background161 156 } 162 157 pack $itk_component(reset) -padx 4 -pady 2 -anchor e 163 158 Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level" 164 itk_component add drawer { 165 panedwindow $itk_interior.drawer \ 166 -orient horizontal -opaqueresize 1 -handlepad 0 \ 167 -handlesize 1 -sashwidth 2 168 } 169 pack $itk_component(drawer) -expand yes -fill both 159 160 set f [$itk_component(main) component frame] 170 161 itk_component add plot { 171 blt::graph $ itk_component(drawer).plot \162 blt::graph $f.plot \ 172 163 -highlightthickness 0 -plotpadx 0 -plotpady 0 \ 173 164 -rightmargin 10 … … 175 166 keep -background -foreground -cursor -font 176 167 } 177 $itk_component(drawer) add $itk_component(plot) -sticky nsew168 pack $itk_component(plot) -expand yes -fill both 178 169 179 170 $itk_component(plot) pen configure activeLine \ … … 244 235 245 236 $itk_component(plot) legend configure -hide yes 237 246 238 # 247 239 # Add legend for editing hidden/elements: 248 240 # 249 itk_component add legendbutton { 250 button $itk_component(controls).legendbutton \ 251 -borderwidth 1 -padx 2 -pady 0 -highlightthickness 0 \ 252 -image [Rappture::icon wrench] \ 253 -command [itcl::code $this legend toggle] 254 } { 255 usual 256 ignore -borderwidth -font 257 rename -highlightbackground -controlbackground controlBackground Background 258 } 259 pack $itk_component(legendbutton) \ 260 -side bottom -padx 4 -pady { 0 2 } -anchor e 261 241 set inner [$itk_component(main) insert end \ 242 -title "Legend" \ 243 -icon [Rappture::icon wrench]] 244 $inner configure -borderwidth 4 245 262 246 itk_component add legend { 263 Rappture::XyLegend $itk_component(drawer).legend $itk_component(plot) 264 } 247 Rappture::XyLegend $inner.legend $itk_component(plot) 248 } 249 pack $itk_component(legend) -expand yes -fill both 250 265 251 after idle [subst { 266 252 update idletasks 267 253 $itk_component(legend) reset 268 254 }] 269 Rappture::Tooltip::for $itk_component(legendbutton) \270 "Display legend"271 255 272 256 # quick-and-dirty zoom functionality, for now... … … 1583 1567 } 1584 1568 } 1585 1586 itcl::body Rappture::XyResult::legend { what args } {1587 switch -- ${what} {1588 "activate" {1589 $itk_component(drawer) add $itk_component(legend) -sticky nsew1590 after idle [list focus $itk_component(legend)]1591 if { !$initialized_ } {1592 set w [winfo width $itk_component(drawer)]1593 set x [expr $w - 100]1594 $itk_component(drawer) sash place 0 $x 01595 set initialized_ 11596 }1597 }1598 "deactivate" {1599 $itk_component(drawer) forget $itk_component(legend)1600 }1601 "toggle" {1602 set slaves [$itk_component(drawer) panes]1603 if { [lsearch $slaves $itk_component(legend)] >= 0 } {1604 legend deactivate1605 } else {1606 legend activate1607 }1608 }1609 }1610 }1611
Note: See TracChangeset
for help on using the changeset viewer.