Changeset 238 for trunk/expgui
- Timestamp:
- Dec 4, 2009 5:02:42 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
- Property rcs:date changed from 2000/07/06 22:43:40 to 2000/07/20 22:13:40
- Property rcs:lines changed from +118 -158 to +80 -57
- Property rcs:rev changed from 1.28 to 1.29
r234 r238 102 102 } 103 103 # get the notebook widget if not using BWidgets 104 if {!$expgui(haveBW)} {source $expgui(scriptdir)/notebook.tcl}104 if {!$expgui(haveBW)} {source [file join $expgui(scriptdir) notebook.tcl]} 105 105 #---------------------------------------------------------------- 106 106 if [file exists [file join $expgui(scriptdir) opts.tcl]] { … … 115 115 # commands for adding phases, histograms & atoms 116 116 source [file join $expgui(scriptdir) addcmds.tcl] 117 # commands for constraints118 source [file join $expgui(scriptdir) atomcons.tcl]119 117 # commands for preferred orientation 120 118 source [file join $expgui(scriptdir) orient.tcl] … … 261 259 SetupExtractHist 262 260 263 # update the histogram list & the page, if shown261 # update the histogram list & update the page 264 262 sethistlist 265 266 # update the atoms display267 # DisplayAllAtoms noreset268 SelectOnePhase $expgui(curPhase)269 263 270 264 # start checking for external changes … … 688 682 foreach n $expmap(phaselist) type $expmap(phasetype) { 689 683 if {$n == $num && $type <= 3} { 690 $expgui(phaseFrame).top.ps.$num config -relief sunken684 catch {$expgui(phaseFrame).top.ps.$num config -relief sunken} 691 685 set crsPhase $num 692 686 if {$type == 3} { … … 701 695 } 702 696 } else { 703 $expgui(phaseFrame).top.ps.$n config -relief raised697 catch {$expgui(phaseFrame).top.ps.$n config -relief raised} 704 698 } 705 699 } … … 1240 1234 } 1241 1235 } 1236 UpdateCurrentPage 1237 } 1238 1239 proc UpdateCurrentPage {} { 1240 global expgui 1242 1241 foreach set $expgui(frameactionlist) { 1243 if {$expgui(pagenow) == [lindex $set 0]} [lindex $set 1]1242 if {$expgui(pagenow) == [lindex $set 0]} {catch [lindex $set 1]} 1244 1243 } 1245 1244 } … … 2443 2442 # Creating the notebook with 5 panes: Phase, Histogram, Scaling, Profile 2444 2443 # & LS controls 2444 # 0 name, 2445 # 1 title 2446 # 2 create command 2447 # 3 raise command 2448 # 4 disable page in global mode (0/1) 2449 2445 2450 if $expgui(haveBW) { 2446 2451 pack [NoteBook .n -bd 2] -expand yes -fill both 2447 set expgui(lsFrame) [\ 2448 .n insert end lsFrame -text "LS Controls" \ 2449 -raisecmd "set expgui(pagenow) lsFrame; SetupExtractHist"] 2450 lappend expgui(frameactionlist) "lsFrame SetupExtractHist" 2451 set expgui(phaseFrame) [\ 2452 .n insert end phasePane -text "Phase" \ 2453 -raisecmd "set expgui(pagenow) phaseFrame; \ 2454 DisplayAllAtoms noreset"] 2455 # lappend expgui(frameactionlist) "phaseFrame {DisplayAllAtoms noreset}" 2456 set expgui(histFrame) [\ 2457 .n insert end histPane -text "Histogram" \ 2458 -raisecmd "set expgui(pagenow) histFrame; DisplayHistogram" \ 2459 -createcmd MakeHistPane] 2460 lappend expgui(frameactionlist) "histFrame DisplayHistogram" 2461 lappend expgui(GlobalModeAllDisable) "histFrame {.n itemconfigure histPane}" 2462 set expgui(fracFrame) [\ 2463 .n insert end fracPane -text "Scaling" \ 2464 -raisecmd "set expgui(pagenow) fracFrame; DisplayFrac" \ 2465 -createcmd MakeScalingPane] 2466 lappend expgui(frameactionlist) "fracFrame DisplayFrac" 2467 set expgui(profFrame) [\ 2468 .n insert end profPane -text Profile \ 2469 -raisecmd "set expgui(pagenow) profFrame; DisplayProfile"\ 2470 -createcmd MakeProfilePane] 2471 lappend expgui(frameactionlist) "profFrame DisplayProfile" 2472 lappend expgui(GlobalModeAllDisable) "profFrame {.n itemconfigure profPane}" 2473 set expgui(consFrame) [\ 2474 .n insert end consPane -text Constraints \ 2475 -raisecmd "set expgui(pagenow) consFrame; DisplayConstraintsPane"\ 2476 -createcmd MakeConstraintsPane] 2477 lappend expgui(frameactionlist) "consFrame DisplayConstraintsPane" 2478 2479 set expgui(orientFrame) [\ 2480 .n insert end prefPane -text "MD Pref Orient" \ 2481 -raisecmd "set expgui(pagenow) orientFrame; DisplayOrient"\ 2482 -createcmd MakeOrientPane] 2483 lappend expgui(frameactionlist) "orientFrame DisplayOrient" 2452 # create an array element describing each notebook page 2453 # element 0 -- pane name 2454 # 1 -- Label on frame 2455 # 2 -- initialization command 2456 # 3 -- update command 2457 # 4 -- 0/1 Use 1 if pane should be disabled in when all histograms 2458 # are selected in global mode, 0 otherwise 2459 set expgui(notebookpagelist) { 2460 {lsFrame "LS Controls" \ 2461 "" \ 2462 SetupExtractHist \ 2463 0} 2464 {phaseFrame Phase \ 2465 "" \ 2466 "SelectOnePhase \$expgui(curPhase); DisplayAllAtoms noreset" \ 2467 0} 2468 {histFrame Histogram \ 2469 MakeHistPane \ 2470 DisplayHistogram \ 2471 1} 2472 {fracFrame Scaling \ 2473 MakeScalingPane \ 2474 DisplayFrac \ 2475 0} 2476 {profFrame Profile \ 2477 MakeProfilePane \ 2478 DisplayProfile \ 2479 1} 2480 {consFrame Constraints \ 2481 "source [file join $expgui(scriptdir) atomcons.tcl]; MakeConstraintsPane" \ 2482 DisplayConstraintsPane \ 2483 0} 2484 {orientFrame "MD Pref Orient" \ 2485 MakeOrientPane \ 2486 DisplayOrient \ 2487 0} 2488 {odfFrame "SH Pref Orient" \ 2489 "source [file join $expgui(scriptdir) odf.tcl]; MakeODFPane" \ 2490 DisplayODFPane \ 2491 0} 2492 } 2493 foreach item $expgui(notebookpagelist) { 2494 set frm [lindex $item 0] 2495 set expgui($frm) [\ 2496 .n insert end $frm -text [lindex $item 1] \ 2497 -createcmd [lindex $item 2] \ 2498 -raisecmd "set expgui(pagenow) $frm; [lindex $item 3]"] 2499 2500 # at this time expgui(frameactionlist) is generated 2501 # from expgui(notebookpagelist), but in the future it might 2502 # make sense to use expgui(notebookpagelist) directly 2503 lappend expgui(frameactionlist) "$frm [list [lindex $item 3]]" 2504 2505 # panes to disable in global "all" mode 2506 if {[lindex $item 4]} { 2507 lappend expgui(GlobalModeAllDisable) \ 2508 "$frm \{.n itemconfigure $frm\}" 2509 } 2510 } 2484 2511 } else { 2485 Notebook:create .n -pages {lsFrame phaseFrame histFrame fracFrame profFrame} 2512 Notebook:create .n \ 2513 -pages {lsFrame phaseFrame histFrame fracFrame profFrame} 2486 2514 pack .n -anchor w -fill both -expand yes 2487 2515 foreach item {lsFrame phaseFrame histFrame fracFrame profFrame \ … … 2519 2547 global expgui 2520 2548 set expgui(pagenow) $nextpage 2521 foreach set $expgui(frameactionlist) { 2522 # don't worry about errors 2523 catch { 2524 if {$expgui(pagenow) == [lindex $set 0]} [lindex $set 1] 2525 } 2526 } 2549 UpdateCurrentPage 2527 2550 } 2528 2551 # resize the notebook to fit all the tabs and the largest page
Note: See TracChangeset
for help on using the changeset viewer.