Changeset 1219 for trunk/atomcons.tcl


Ignore:
Timestamp:
Aug 19, 2012 1:24:43 PM (11 years ago)
Author:
toby
Message:

Major new release: bug fixes for rigid bodies; Split Restraints from Constraints; add chemistry restraints; edit f' & f; fixes for fixing atoms; start work on Absorption constraints and interface for Fourier maps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/atomcons.tcl

    r1025 r1219  
    1111    grid [NoteBook $expgui(consFrame).n -bd 2 -side bottom] -sticky news
    1212    source [file join $expgui(scriptdir) profcons.tcl]
    13     source [file join $expgui(scriptdir) distrest.tcl]
    1413}
    1514
     
    2120    catch {$expgui(consFrame).n delete macro}
    2221    catch {$expgui(consFrame).n delete profile}
    23     catch {$expgui(consFrame).n delete distrest}
    2422    set atom normal
    2523    set mm disabled
     
    4745            -createcmd "MakeProfileConstraintsPane" \
    4846            -raisecmd "DisplayProfileConstraints"]   
    49     set expcons(distmaster) [\
    50             $expgui(consFrame).n insert end distrest -text "Distance Restraints" \
    51             -state $atom \
    52             -createcmd "" \
    53             -raisecmd "DisplayDistanceRestraints"]
    54  
     47
    5548    set page [$expgui(consFrame).n raise]
    5649    # open the atom constraints page if no page is open
     
    829822    DisplayAtomConstraints $mode
    830823}
     824######################################################################
     825# restraints codes
     826######################################################################
     827# this is used once to create the constraint page
     828proc MakeRestraintsPane {} {
     829    global expgui expcons expmap
     830    # create the notebook
     831    grid [NoteBook $expgui(restrFrame).n -bd 2 -side bottom] -sticky news
     832    source [file join $expgui(scriptdir) distrest.tcl]
     833    source [file join $expgui(scriptdir) chemrest.tcl]
     834}
     835
     836# this is used to update the contents of the constraint page when displayed
     837proc DisplayRestraintsPane {} {
     838    global expgui expcons expmap
     839    # create pages for each of the constraint "subpages"
     840    catch {$expgui(restrFrame).n delete distrest}
     841    catch {$expgui(restrFrame).n delete chemrest}
     842    set atom normal
     843    set mm disabled
     844    if {[llength $expmap(phasetype)] == 0} {
     845        set atom disabled
     846    } elseif {[lindex $expmap(phasetype) 0] == 4} {
     847        set mm normal
     848        if {[llength $expmap(phasetype)] == 1} {
     849            set atom disabled
     850        }
     851    }
     852    set expcons(distmaster) [\
     853            $expgui(restrFrame).n insert end distrest -text "Distance Restraints" \
     854            -state $atom \
     855            -createcmd "" \
     856            -raisecmd "DisplayDistanceRestraints"]
     857 
     858    set expcons(chemmaster) [\
     859            $expgui(restrFrame).n insert end chemrest -text "Chemical Restraints" \
     860            -state $atom \
     861            -createcmd "" \
     862            -raisecmd "DisplayChemRestraints"]
     863 
     864    set page [$expgui(restrFrame).n raise]
     865    # open the atom constraints page if no page is open
     866    if {$page == ""} {
     867        foreach page [$expgui(restrFrame).n pages] {
     868            # loop to the first non-disabled page
     869            if {[$expgui(restrFrame).n itemcget $page -state] == "normal"} {
     870                $expgui(restrFrame).n raise $page
     871                return
     872            }
     873        }
     874    } else {
     875        set pageupdate [$expgui(restrFrame).n itemcget $page -raisecmd]
     876        catch $pageupdate
     877    }
     878}
Note: See TracChangeset for help on using the changeset viewer.