Changeset 199


Ignore:
Timestamp:
Dec 4, 2009 5:02:03 PM (11 years ago)
Author:
toby
Message:

# on 2000/06/09 03:45:28, toby did:
Change Reload msg as per suggestions
add MD pref orientation pane
fix bug in non-BWidget implementation
make CompressList? survive use of strings
use -exportselection 0 for listboxes to avoid cut/paste conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 2000/06/01 02:48:14 to 2000/06/09 03:45:28
    • Property rcs:lines changed from +3 -2 to +51 -19
    • Property rcs:rev changed from 1.26 to 1.27
    r181 r199  
    4343    set expgui(expfile) {}
    4444}
     45
     46set expgui(curhist) {}
     47set expmap(powderlist) {}
    4548
    4649set expgui(debug) 0
     
    131134# commands for constraints
    132135source [file join $expgui(scriptdir) atomcons.tcl]
     136# commands for preferred orientation
     137source [file join $expgui(scriptdir) orient.tcl]
    133138#---------------------------------------------------------------------------
    134139# override options with locally defined values
     
    218223    set expgui(last_History) [string range [string trim [lindex [exphistory last] 1]] 0 50 ]
    219224    # set the window/icon title
    220     wm title . $expfile
     225    wm title . "EXPGUI $expfile"
    221226    set expgui(titleunchanged) 1
    222227    wm iconname . [file tail $expfile]
     
    494499        append msg ".\n"
    495500    }
    496     append msg "Do you want to load the newer version or lose the modification by editing the current version?"
     501    append msg "Do you want to use the newer (modified) version or continue with the older (previous) version of the file?"
     502
    497503    set w .ask
    498504    catch {destroy $w}
     
    516522            -default active -command "set expgui(dialogbutton) 0" \
    517523            ] -side left -expand 1 -padx 3m -pady 2m
    518     pack [button $w.bot.2 -text "Continue editing" \
     524    pack [button $w.bot.2 -text "Continue with old" \
    519525            -command "set expgui(dialogbutton) 1"] \
    520526            -side left -expand 1 -padx 3m -pady 2m
     
    950956    set flist {}
    951957    set count 0
    952     foreach num [lsort -integer $numberList] {
    953         set next [expr $lastnum+1]
    954         if {$num != $next} {
    955             if {$count == 0 && $flist != ""} {
    956                 append flist ",$num"
    957             } elseif {$count == 1 && $flist != ""} {
    958                 append flist ",$lastnum,$num"
    959             } elseif {$flist != ""} {
    960                 append flist "-$lastnum,$num"
     958    if [catch {set sortlist [lsort -integer $numberList]}] {return $numberList}
     959    foreach num $sortlist {
     960            set next [expr $lastnum+1]
     961            if {$num != $next} {
     962                if {$count == 0 && $flist != ""} {
     963                    append flist ",$num"
     964                } elseif {$count == 1 && $flist != ""} {
     965                    append flist ",$lastnum,$num"
     966                } elseif {$flist != ""} {
     967                    append flist "-$lastnum,$num"
    961968            } else {
    962969                append flist "$num"
     
    24472454            -createcmd MakeConstraintsPane]
    24482455    lappend expgui(frameactionlist) "consFrame DisplayConstraintsPane"
     2456
     2457    set expgui(orientFrame) [\
     2458            .n insert end prefPane -text "MD Pref Orient" \
     2459            -raisecmd "set expgui(pagenow) orientFrame; DisplayOrient"\
     2460            -createcmd MakeOrientPane]
     2461    lappend expgui(frameactionlist) "orientFrame DisplayOrient"
    24492462} else {
    24502463    Notebook:create .n -pages {lsFrame phaseFrame histFrame fracFrame profFrame}
    24512464    pack .n -anchor w -fill both -expand yes
    2452     foreach item {lsFrame phaseFrame histFrame fracFrame profFrame} \
    2453             page {"LS Controls" Phase Histogram Scaling Profile } {
     2465    foreach item {lsFrame phaseFrame histFrame fracFrame profFrame \
     2466            orientFrame} \
     2467            page {"LS Controls" Phase Histogram Scaling Profile \
     2468            "MD Pref Orient"} {
    24542469        set expgui($item) [Notebook:frame .n $item]
    24552470        Notebook:pageconfig .n $item -command "InitPage $item" -title $page
     
    24602475    lappend expgui(frameactionlist) "fracFrame DisplayFrac"
    24612476    lappend expgui(frameactionlist) "profFrame DisplayProfile"
     2477    lappend expgui(frameactionlist) "orientFrame DisplayOrient"
    24622478    set expgui(GlobalModeAllDisable) {}
    24632479    lappend expgui(GlobalModeAllDisable) "histFrame {Notebook:pageconfig .n histFrame}"
     
    25622578    grid columnconfig $frameLatt  0 -weight 1
    25632579    #-------------- Begin Atom Coordinates Box  ------------------------------
    2564     grid [listbox   $fbig.title -height 1 -relief flat] \
     2580    grid [listbox  $fbig.title -height 1 -relief flat \
     2581            -exportselection 0] \
    25652582            -row 0 -column 0 -sticky ew
    25662583    set expgui(atomtitle) $fbig.title
    25672584    $expgui(atomtitle) configure -font $expgui(coordfont) -selectmode extended
    25682585    grid [listbox   $fbig.lbox -height 10 \
     2586            -exportselection 0 \
    25692587            -xscrollcommand " $fbig.bscr set"\
    25702588            -yscrollcommand " $fbig.rscr set"\
     
    26822700    }
    26832701}
    2684 # make the phase pane
    2685 MakePhasePane
    26862702#-----------------------------------------------------------------------------
    26872703proc MakeHistPane {} {
     
    26952711    grid rowconfigure $expgui(histFrame) 3 -weight 1
    26962712    grid [listbox $expgui(histFrame).hs.title -height 1 -relief flat \
     2713            -exportselection 0 \
    26972714            -font $expgui(histfont) ] -row 0 -column 0 -sticky ew
    26982715    grid [listbox $expgui(histFrame).hs.lbox -height 10 -width 25 \
     2716            -exportselection 0 \
    26992717            -font $expgui(histfont) \
    27002718            -xscrollcommand "$expgui(histFrame).hs.x set" \
     
    27832801    pack [frame $expgui(fracFrame).hs] -side left -expand y -fill both
    27842802    grid [listbox $expgui(fracFrame).hs.title -height 1 -relief flat \
     2803            -exportselection 0 \
    27852804            -font $expgui(histfont) ] -row 0 -column 0 -sticky ew
    27862805    grid [listbox $expgui(fracFrame).hs.lbox -height 10 -width 25 \
     2806            -exportselection 0 \
    27872807            -font $expgui(histfont) \
    27882808            -xscrollcommand "$expgui(fracFrame).hs.x set" \
     
    28792899    pack [frame $expgui(profFrame).hs] -side left -expand y -fill both
    28802900    grid [listbox $expgui(profFrame).hs.title -height 1 -relief flat \
     2901            -exportselection 0 \
    28812902            -font $expgui(histfont) ] -row 0 -column 0 -sticky ew
    28822903    grid [listbox $expgui(profFrame).hs.lbox -height 10 -width 25 \
     2904            -exportselection 0 \
    28832905            -font $expgui(histfont) \
    28842906            -xscrollcommand "$expgui(profFrame).hs.x set" \
     
    29442966pack [frame $expgui(lsFrame).hs] -side left -expand y -fill both
    29452967grid [listbox $expgui(lsFrame).hs.title -height 1 -relief flat \
     2968        -exportselection 0 \
    29462969        -font $expgui(histfont) ] -row 0 -column 0 -sticky ew
    29472970grid [listbox $expgui(lsFrame).hs.lbox -height 10 -width 25 \
     2971        -exportselection 0 \
    29482972        -font $expgui(histfont) \
    29492973        -xscrollcommand "$expgui(lsFrame).hs.x set" \
     
    32273251#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF MENU DEFINITION ^^^^^^^^^^^^^^^^^^^
    32283252
     3253# make the phase pane
     3254MakePhasePane
     3255# and the rest of the windows w/o BWidget
     3256if !$expgui(haveBW) {
     3257    MakeHistPane
     3258    MakeScalingPane
     3259    MakeProfilePane
     3260}
    32293261
    32303262# handle indirect exits
Note: See TracChangeset for help on using the changeset viewer.