Changeset 172 for trunk


Ignore:
Timestamp:
Feb 14, 2006 12:52:18 PM (18 years ago)
Author:
mmc
Message:

Fixed the download button so that it doesn't force the
analyzer screen to be too big, and so that it disappears
gracefully when squeezed out.

Fixed the molecule viewer so that it handles the case
where one molecule is empty and another is not, and
they're being compared with the comparison dial. Was
chocking on the empty molecule with no xmin/xmax set.

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/analyzer.tcl

    r171 r172  
    186186    pack $w.top.l -side left
    187187
    188     if {[Rappture::filexfer::enabled]} {
    189         itk_component add download {
    190             button $w.top.dl -text "Download..." \
    191                 -command [itcl::code $this download]
    192         }
    193         pack $itk_component(download) -side right -padx {4 0}
    194         Rappture::Tooltip::for $itk_component(download) "Downloads the current result to a new web browser window on your desktop.  From there, you can easily print or save results.
    195 
    196 NOTE:  Your web browser must allow pop-ups from this site.  If your output does not appear, look for a 'pop-up blocked' message and enable pop-ups."
    197     }
    198 
    199188    itk_component add resultselector {
    200         Rappture::Combobox $w.top.sel -width 50 -editable no
     189        Rappture::Combobox $w.top.sel -width 10 -editable no
    201190    } {
    202191        usual
     
    205194    pack $itk_component(resultselector) -side left -expand yes -fill x
    206195    bind $itk_component(resultselector) <<Value>> [itcl::code $this _fixResult]
     196
     197    if {[Rappture::filexfer::enabled]} {
     198        itk_component add download {
     199            button $w.top.dl -text "Download..." -anchor w \
     200                -command [itcl::code $this download]
     201        }
     202        pack $itk_component(download) -side right -padx {4 0}
     203        Rappture::Tooltip::for $itk_component(download) "Downloads the current result to a new web browser window on your desktop.  From there, you can easily print or save results.
     204
     205NOTE:  Your web browser must allow pop-ups from this site.  If your output does not appear, look for a 'pop-up blocked' message and enable pop-ups."
     206    }
    207207
    208208    itk_component add results {
  • trunk/gui/scripts/moleculeViewer.tcl

    r115 r172  
    448448    set zp [expr {cos($theta*$deg2rad)}]
    449449
    450     set xm [expr {0.5*($_limits(xmax)+$_limits(xmin))}]
    451     set ym [expr {0.5*($_limits(ymax)+$_limits(ymin))}]
    452     set zm [expr {0.5*($_limits(zmax)+$_limits(zmin))}]
     450    set blank 0
     451    foreach lim {xmin xmax ymin ymax zmin zmax} {
     452        if {"" == $_limits($lim)} {
     453            set blank 1
     454            break
     455        }
     456    }
     457    if {$blank} {
     458        set xm 0
     459        set ym 0
     460        set zm 0
     461    } else {
     462        set xm [expr {0.5*($_limits(xmax)+$_limits(xmin))}]
     463        set ym [expr {0.5*($_limits(ymax)+$_limits(ymin))}]
     464        set zm [expr {0.5*($_limits(zmax)+$_limits(zmin))}]
     465    }
    453466
    454467    set cam [$this-ren GetActiveCamera]
Note: See TracChangeset for help on using the changeset viewer.