Changeset 648 for trunk/profcons.tcl


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

# on 2002/09/05 18:29:19, toby did:
make sure a phase & histogram is selected to prevent error
handholding: if there is only 1 histogram/phase select it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/profcons.tcl

    • Property rcs:date changed from 2002/07/03 21:06:49 to 2002/09/05 18:29:19
    • Property rcs:lines changed from +37 -5 to +23 -1
    • Property rcs:rev changed from 1.5 to 1.6
    r607 r648  
    470470        incr i
    471471    }
     472    # if there is only 1 choice, select it
     473    if {[llength $expmap(phaselist)] == 1} {
     474        $expcons(phaselistbox$ic) selection set 0
     475    }
    472476    # now insert the histograms into the list
    473477    set i 0
     
    478482            incr i
    479483        }
     484    }
     485    # if there is only 1 choice, select it
     486    if {[llength $expmap(powderlist)] == 1} {
     487        $expcons(histlistbox$ic) selection set 0
    480488    }
    481489}
     
    574582    set conslist {}
    575583    for {set ic 1} {$ic < 27} {incr ic} {
     584        set phases {}
     585        set hists {}
    576586        if ![info exists expcons(phaselistbox$ic)] break
    577587        if ![info exists expcons(histlistbox$ic)] break
     
    585595        if {[llength $hists] == [llength $expmap(powderlist)]} {
    586596            set hists "ALL"
     597        }
     598        if {$hists == ""} {
     599            MyMessageBox -icon warning -message \
     600                    "Please select at least one histogram before trying to save" \
     601                    -parent [winfo toplevel $expgui(consFrame)]
     602            return
     603        }
     604        if {$phases == ""} {
     605            MyMessageBox -icon warning -message \
     606                    "Please select at least one phase before trying to save" \
     607                    -parent [winfo toplevel $expgui(consFrame)]
     608            return
    587609        }
    588610        foreach h $hists {
Note: See TracChangeset for help on using the changeset viewer.