Changeset 150 for trunk/atomcons.tcl


Ignore:
Timestamp:
Dec 4, 2009 5:01:14 PM (14 years ago)
Author:
toby
Message:

# on 2000/05/18 15:54:08, toby did:
fix bugs (already!)
test for more that 100 parmaters in a constraint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/atomcons.tcl

    • Property rcs:date changed from 2000/05/17 00:22:54 to 2000/05/18 15:54:08
    • Property rcs:rev changed from 1.1 to 1.2
    • Property rcs:lines set to +25 -9
    r131 r150  
    1616    # a profile constraints page (someday)
    1717    $expgui(consFrame).n  insert end profile -text Profile -state disabled
    18    
    19     # open the atom constraints page
    20     $expgui(consFrame).n raise atomic
     18}
     19
     20# this is used to update the contents of the constraint page when displayed
     21proc DisplayConstraintsPane {} {
     22    global expgui
     23    set page [$expgui(consFrame).n raise]
     24    # open the atom constraints page if no page is open
     25    if {$page == ""} {
     26        set page atomic
     27        $expgui(consFrame).n raise atomic
     28    } else {
     29        set pageupdate [$expgui(consFrame).n itemcget $page -raisecmd]
     30        catch $pageupdate
     31    }
    2132}
    2233
     
    293304            -command "SaveAtomConstraint $num $top"] \
    294305            -column 0 -row 4
    295 #    set cmd "if {!\[tk_dialog .changes {Abandon Changes} \
    296 #               {Do you want to lose any changes made to this constraint?} \
    297 #               warning 0 {Abandon\nChanges} {Continue\nEdit}\]} \
    298 #               {destroy $top}"
    299306    grid [button $top.quit -text "Cancel Changes" \
    300307            -command "DeleteEditAtomConstraint $top"]  -column 1 -row 4
     
    602609                    # error if mult is invalid
    603610                    if [catch {expr $mult}] {
    604                         tk_dialog .badmult "Bad Multiplier" \
     611                        MyMessageBox -message \
    605612                                "Multiplier value \"$mult\" in column $ic is invalid" \
    606                                 error 0 Fix
     613                                -parent [winfo toplevel $expcons(atommaster)] \
     614                                -type {Fix} -default fix -icon error
    607615                        return
    608616                    }
     
    613621            }
    614622        }
     623        # maximum number of parameters in a constraint is 100
     624        if {[llength $clist] > 100} {
     625            MyMessageBox -message \
     626                    "There are [llength $clist] parameters in this constraint, but only 100 are allowed in an atom constraint." \
     627                    -parent [winfo toplevel $expcons(atommaster)] \
     628                    -type {Fix} -default fix -icon error
     629            return
     630        }
    615631        if {$num == "new"} {
    616632            constrinfo atom add {} $clist
Note: See TracChangeset for help on using the changeset viewer.