- Timestamp:
- Dec 4, 2009 5:12:39 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
- Property rcs:date changed from 2004/09/28 22:31:01 to 2004/10/04 16:20:26
- Property rcs:lines changed from +22 -9 to +71 -177
- Property rcs:rev changed from 1.74 to 1.75
r809 r823 136 136 set expgui(docdir) [file join $expgui(scriptdir) doc] 137 137 #---------------------------------------------------------------- 138 # use EXPGUI directory for packages 138 139 lappend auto_path $expgui(scriptdir) 139 set expgui(havetix) 0140 set expgui(haveBW) 1141 # for debugging non-BWidget version set environment variable NOBWIDGET142 catch {if $env(NOBWIDGET) {set expgui(haveBW) 0}}143 if $expgui(haveBW) {144 if [catch {package require BWidget}] {set expgui(haveBW) 0}145 }146 # get the notebook widget if not using BWidgets147 if {!$expgui(haveBW)} {source [file join $expgui(scriptdir) notebook.tcl]}148 140 #---------------------------------------------------------------- 149 141 source [file join $expgui(scriptdir) opts.tcl] … … 177 169 -message $msg -icon warning -type Ignore -default ignore \ 178 170 -helplink "expguierr.html Customizewarning" 171 } 172 if [catch {package require BWidget}] { 173 set msg "Error loading the BWidget package: This should not happen if you use the version of Tcl/Tk (tcl84+.exe) distributed with EXPGUI" 174 MyMessageBox -parent . -title "BWidget load error" \ 175 -message $msg -icon error -type Error -default error \ 176 -helplink "debug_tcltk.html" 177 destroy . 179 178 } 180 179 SetTkDefaultOptions $expgui(font) … … 1781 1780 } 1782 1781 # Top box 1783 if $expgui(haveBW) { 1784 catch {destroy $expgui(histFrame).pflag} 1785 } 1782 catch {destroy $expgui(histFrame).pflag} 1786 1783 if {$expgui(globalmode) != 0} { 1787 1784 $expgui(histFrame).top.txt config \ … … 1794 1791 set expgui(bkglbl) "Edit Background" 1795 1792 set expgui(abslbl) "Edit Abs./Refl." 1796 if { $expgui(haveBW) &&[llength $expmap(phaselist)] > 1} {1793 if {[llength $expmap(phaselist)] > 1} { 1797 1794 TitleFrame $expgui(histFrame).pflag \ 1798 1795 -borderwidth 4 -side left -relief groove \ … … 2242 2239 set txt "Phase Fractions" 2243 2240 } 2244 if $expgui(haveBW) { 2245 $expgui(fracFrame).f1.phaseFrac configure -text $txt 2246 } else { 2247 grid [label $phaseFractf1.txt -anchor center -text $txt] \ 2248 -column 0 -row 0 -sticky news 2249 } 2241 $expgui(fracFrame).f1.phaseFrac configure -text $txt 2250 2242 # Create the frame inside the canvas, One frame for each Phase. 2251 2243 foreach i {1 2 3 4 5 6 7 8 9} {set phasehistlist($i) ""} … … 2336 2328 # Label Heading for each phase. 2337 2329 set ptype [string trim [hapinfo $hist $i proftype]] 2338 if {$expgui(haveBW)} { 2339 grid [TitleFrame $expgui(ProfileBox).f.$i \ 2340 -text "Hist $hist -- Phase $i (type $ptype)" \ 2341 -relief groove -bd 2] \ 2342 -column 0 -row $ind -sticky ew 2343 set ProfileFrame [$expgui(ProfileBox).f.$i getframe] 2344 grid [frame $ProfileFrame.1] \ 2345 -column 0 -row 0 -columnspan 10 2346 pack [label $ProfileFrame.1.l \ 2347 -text Damping]\ 2348 -side left 2349 } else { 2350 grid [frame $expgui(ProfileBox).f.$i -relief groove -bd 4] \ 2351 -column 0 -row $ind -sticky ew 2352 set ProfileFrame $expgui(ProfileBox).f.$i 2353 grid [frame $ProfileFrame.1] \ 2354 -column 0 -row 0 -columnspan 10 -sticky ew 2355 pack [label $ProfileFrame.1.l \ 2356 -text "Phase $i (type $ptype) Damping"]\ 2357 -side left 2358 } 2330 grid [TitleFrame $expgui(ProfileBox).f.$i \ 2331 -text "Hist $hist -- Phase $i (type $ptype)" \ 2332 -relief groove -bd 2] \ 2333 -column 0 -row $ind -sticky ew 2334 set ProfileFrame [$expgui(ProfileBox).f.$i getframe] 2335 grid [frame $ProfileFrame.1] \ 2336 -column 0 -row 0 -columnspan 10 2337 pack [label $ProfileFrame.1.l \ 2338 -text Damping]\ 2339 -side left 2359 2340 tk_optionMenu $ProfileFrame.1.tkOptDamp entryvar(pdamp_$i) \ 2360 2341 0 1 2 3 4 5 6 7 8 9 … … 2446 2427 incr i 2447 2428 set boxtitle "Phase $p, hist [CompressList $histarray($key)]" 2448 if {$expgui(haveBW)} { 2449 grid [TitleFrame $expgui(ProfileBox).f.$i \ 2450 -text "(type $ptype)" \ 2451 -relief groove -bd 2] \ 2452 -column 0 -row $i -sticky ew 2453 set ProfileFrame [$expgui(ProfileBox).f.$i getframe] 2454 grid [frame $ProfileFrame.0] \ 2455 -column 0 -row 0 -columnspan 20 -sticky ew 2456 } else { 2457 grid [frame $expgui(ProfileBox).f.$i \ 2458 -relief groove -bd 4] \ 2459 -column 0 -row $i -sticky ew 2460 set ProfileFrame $expgui(ProfileBox).f.$i 2461 grid [frame $ProfileFrame.0] \ 2462 -column 0 -row 0 -columnspan 20 -sticky ew 2463 grid [label $ProfileFrame.0.0 \ 2464 -text "Profile Type $ptype "] -row 0 -column 0 2465 } 2429 grid [TitleFrame $expgui(ProfileBox).f.$i \ 2430 -text "(type $ptype)" \ 2431 -relief groove -bd 2] \ 2432 -column 0 -row $i -sticky ew 2433 set ProfileFrame [$expgui(ProfileBox).f.$i getframe] 2434 grid [frame $ProfileFrame.0] \ 2435 -column 0 -row 0 -columnspan 20 -sticky ew 2466 2436 grid [label $ProfileFrame.0.1 \ 2467 2437 -anchor w] -row 0 -column 1 … … 3198 3168 # Creating the notebook and panes 3199 3169 3200 # create an array element describing each notebook page (used with BW only)3170 # create an array element describing each notebook page 3201 3171 # element 0 -- pane name 3202 3172 # 1 -- Label on frame … … 3242 3212 } 3243 3213 3244 if $expgui(haveBW) { 3245 pack [NoteBook .n -bd 2] -expand yes -fill both 3246 # this should not be needed, but for some reason NoteBook is not 3247 # using the optionDB 3248 catch {.n configure -font [option get .n font Canvas]} 3249 foreach item $expgui(notebookpagelist) { 3250 set frm [lindex $item 0] 3251 set expgui($frm) [\ 3214 pack [NoteBook .n -bd 2] -expand yes -fill both 3215 # this should not be needed, but for some reason NoteBook is not 3216 # using the optionDB 3217 catch {.n configure -font [option get .n font Canvas]} 3218 foreach item $expgui(notebookpagelist) { 3219 set frm [lindex $item 0] 3220 set expgui($frm) [\ 3252 3221 .n insert end $frm -text [lindex $item 1] \ 3253 3222 -createcmd "set expgui(pagenow) $frm; [lindex $item 2]" \ 3254 3223 -raisecmd "set expgui(pagenow) $frm; [lindex $item 3]"] 3255 3224 3256 # at this time expgui(frameactionlist) is generated 3257 # from expgui(notebookpagelist), but in the future it might 3258 # make sense to use expgui(notebookpagelist) directly 3259 lappend expgui(frameactionlist) "$frm [list [lindex $item 3]]" 3260 3261 # panes to disable in global "all" mode 3262 if {[lindex $item 4]} { 3263 lappend expgui(GlobalModeAllDisable) \ 3264 "$frm \{.n itemconfigure $frm\}" 3265 } 3266 } 3267 } else { 3268 Notebook:create .n \ 3269 -pages {lsFrame phaseFrame histFrame fracFrame profFrame} 3270 pack .n -anchor w -fill both -expand yes 3271 foreach item {lsFrame phaseFrame histFrame fracFrame profFrame \ 3272 orientFrame} \ 3273 page {"LS Controls" Phase Histogram Scaling Profile \ 3274 "MD Pref Orient"} { 3275 set expgui($item) [Notebook:frame .n $item] 3276 Notebook:pageconfig .n $item -command "InitPage $item" -title $page 3277 } 3278 lappend expgui(frameactionlist) "lsFrame SetupExtractHist" 3279 lappend expgui(frameactionlist) "phaseFrame {DisplayAllAtoms $expgui(curPhase) noreset}" 3280 lappend expgui(frameactionlist) "histFrame DisplayHistogram" 3281 lappend expgui(frameactionlist) "fracFrame DisplayFrac" 3282 lappend expgui(frameactionlist) "profFrame DisplayProfile" 3283 lappend expgui(frameactionlist) "orientFrame DisplayOrient" 3284 set expgui(GlobalModeAllDisable) {} 3285 lappend expgui(GlobalModeAllDisable) "histFrame {Notebook:pageconfig .n histFrame}" 3286 lappend expgui(GlobalModeAllDisable) "profFrame {Notebook:pageconfig .n profFrame}" 3225 # at this time expgui(frameactionlist) is generated 3226 # from expgui(notebookpagelist), but in the future it might 3227 # make sense to use expgui(notebookpagelist) directly 3228 lappend expgui(frameactionlist) "$frm [list [lindex $item 3]]" 3229 3230 # panes to disable in global "all" mode 3231 if {[lindex $item 4]} { 3232 lappend expgui(GlobalModeAllDisable) "$frm \{.n itemconfigure $frm\}" 3233 } 3287 3234 } 3288 3235 … … 3290 3237 proc RaisePage {nextpage} { 3291 3238 global expgui 3292 if $expgui(haveBW) {3293 set expgui(pagenow) $nextpage3294 .n see $nextpage3295 .n raise $nextpage3296 } else {3297 Notebook:raise .n $nextpage3298 InitPage $nextpage3299 }3300 }3301 # this is only called when BWidget is not in use3302 proc InitPage {nextpage} {3303 global expgui3304 3239 set expgui(pagenow) $nextpage 3305 UpdateCurrentPage 3306 } 3240 .n see $nextpage 3241 .n raise $nextpage 3242 } 3243 3307 3244 # resize the notebook to fit all the tabs and the largest page 3308 3245 proc ResizeNotebook {} { 3309 3246 global expgui 3310 if {$expgui(haveBW)} { 3311 .n compute_size 3312 } else { 3313 Notebook:resize .n 3314 } 3247 .n compute_size 3315 3248 } 3316 3249 … … 3715 3648 frame $expgui(histFrame).top -borderwidth 4 -relief groove 3716 3649 grid [label $expgui(histFrame).top.txt] -row 0 -column 0 3717 if $expgui(haveBW) { 3718 foreach item {backBox diffBox absBox} num {2 3 4} \ 3719 title {Background "Diffractometer Constants" \ 3720 "Absorption/Reflectivity Correction"} { 3721 TitleFrame $expgui(histFrame).$item \ 3722 -borderwidth 4 -side left -relief groove -text $title 3723 set expgui($item) [$expgui(histFrame).$item getframe] 3724 grid $expgui(histFrame).$item -column 1 -row $num -sticky nsew 3725 grid rowconfigure $expgui(histFrame) $num -minsize 100 3726 } 3727 } else { 3728 foreach item {backBox diffBox absBox} num {1 2 3} \ 3729 title {Background "Diffractometer Constants" \ 3730 "Absorp./Reflect. Corr"} { 3731 frame $expgui(histFrame).$item -borderwidth 4 -relief groove 3732 grid $expgui(histFrame).$item -column 1 -row $num -sticky nsew 3733 set expgui($item) $expgui(histFrame).$item 3734 grid [label $expgui(histFrame).$item.title -text $title] \ 3735 -row 0 -column 0 -columnspan 10 -sticky nw 3736 } 3737 } 3738 3650 foreach item {backBox diffBox absBox} num {2 3 4} title {Background "Diffractometer Constants" "Absorption/Reflectivity Correction"} { 3651 TitleFrame $expgui(histFrame).$item \ 3652 -borderwidth 4 -side left -relief groove -text $title 3653 set expgui($item) [$expgui(histFrame).$item getframe] 3654 grid $expgui(histFrame).$item -column 1 -row $num -sticky nsew 3655 grid rowconfigure $expgui(histFrame) $num -minsize 100 3656 } 3739 3657 grid [frame $expgui(histFrame).bb] -column 1 -row 6 3740 3658 if [file executable $expgui(exptool)] { … … 3818 3736 # Create a large canvas area containing a frame for each phase in the data set. 3819 3737 # The canvas and vertical scrollbar are inside a frame called f1 3820 if $expgui(haveBW) { 3821 TitleFrame $expgui(fracFrame).f1.scaleBox \ 3822 -borderwidth 4 -text "Scale Factor" 3823 # -borderwidth 4 -width 600 -height 100 -label "Scale Factor" 3824 grid $expgui(fracFrame).f1.scaleBox -column 0 -row 0 -sticky nsew -columnspan 2 3825 set expgui(scaleBox) [$expgui(fracFrame).f1.scaleBox getframe] 3826 grid [label $expgui(scaleBox).histSFLabel -text Scale] \ 3827 -row 1 -column 0 -sticky nws -padx 2 -pady 3 3828 } else { 3829 frame $expgui(fracFrame).f1.scaleBox -borderwidth 4 -relief groove 3830 grid $expgui(fracFrame).f1.scaleBox -column 0 -row 0 -sticky nsew -columnspan 2 3831 set expgui(scaleBox) $expgui(fracFrame).f1.scaleBox 3832 grid [label $expgui(scaleBox).histSFLabel -text "Scale Factor"] \ 3833 -row 1 -column 0 -sticky nws -padx 2 -pady 3 3834 } 3738 TitleFrame $expgui(fracFrame).f1.scaleBox \ 3739 -borderwidth 4 -text "Scale Factor" 3740 # -borderwidth 4 -width 600 -height 100 -label "Scale Factor" 3741 grid $expgui(fracFrame).f1.scaleBox -column 0 -row 0 -sticky nsew -columnspan 2 3742 set expgui(scaleBox) [$expgui(fracFrame).f1.scaleBox getframe] 3743 grid [label $expgui(scaleBox).histSFLabel -text Scale] \ 3744 -row 1 -column 0 -sticky nws -padx 2 -pady 3 3835 3745 grid [entry $expgui(scaleBox).ent1 -textvariable entryvar(scale) -width 15] \ 3836 3746 -row 1 -column 1 -sticky ew -padx 4 -pady 3 … … 3851 3761 grid columnconfigure $expgui(scaleBox) 6 -weight 1 3852 3762 3853 if $expgui(haveBW) { 3854 grid [TitleFrame $expgui(fracFrame).f1.phaseFrac -bd 4 \ 3855 -text "Phase Fractions" -relief groove] \ 3856 -sticky news -row 1 -column 0 -columnspan 2 3857 set PhaseFractBox [$expgui(fracFrame).f1.phaseFrac getframe] 3858 } else { 3859 set PhaseFractBox $expgui(fracFrame).f1 3860 } 3763 grid [TitleFrame $expgui(fracFrame).f1.phaseFrac -bd 4 \ 3764 -text "Phase Fractions" -relief groove] \ 3765 -sticky news -row 1 -column 0 -columnspan 2 3766 set PhaseFractBox [$expgui(fracFrame).f1.phaseFrac getframe] 3861 3767 grid columnconfigure $expgui(fracFrame).f1 0 -weight 1 3862 3768 grid rowconfigure $expgui(fracFrame).f1 1 -weight 1 … … 4008 3914 4009 3915 incr row 4010 if {$expgui(haveBW)} { 4011 grid [TitleFrame $expgui(lsFrame).f1.a -bd 4 -relief groove \ 4012 -text "Reflection Intensity Extraction" \ 4013 ] -row $row -column 0 -columnspan 6 4014 set expgui(FobsExtractFrame) [$expgui(lsFrame).f1.a getframe] 4015 } else { 4016 grid [frame $expgui(lsFrame).f1.a -bd 4 -relief groove \ 4017 ] -row $row -column 0 -columnspan 6 4018 set expgui(FobsExtractFrame) $expgui(lsFrame).f1.a 4019 } 3916 grid [TitleFrame $expgui(lsFrame).f1.a -bd 4 -relief groove \ 3917 -text "Reflection Intensity Extraction" \ 3918 ] -row $row -column 0 -columnspan 6 3919 set expgui(FobsExtractFrame) [$expgui(lsFrame).f1.a getframe] 4020 3920 4021 3921 grid [frame $expgui(FobsExtractFrame).c -bd 4 -relief groove] \ … … 4334 4234 # can be called (in loadexp) 4335 4235 MakePhasePane 4336 # and the rest of the windows w/o BWidget4337 if {!$expgui(haveBW)} {4338 MakeHistPane4339 MakeScalingPane4340 MakeProfilePane4341 }4342 4236 4343 4237 # handle indirect exits
Note: See TracChangeset
for help on using the changeset viewer.