Ignore:
Timestamp:
Jun 22, 2015, 1:47:32 PM (9 years ago)
Author:
ldelgass
Message:

merge 5729 from trunk

Location:
branches/1.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4

    • Property svn:mergeinfo changed
      /trunkmerged: 5729
  • branches/1.4/gui/scripts/molvisviewer.tcl

    r5728 r5732  
    88# ======================================================================
    99#  AUTHOR:  Michael McLennan, Purdue University
    10 #  Copyright (c) 2004-2012  HUBzero Foundation, LLC
     10#  Copyright (c) 2004-2015  HUBzero Foundation, LLC
    1111#
    1212#  See the file "license.terms" for information on usage and
     
    230230    }]
    231231
    232     itk_component add 3dview {
     232    itk_component add view {
    233233        label $itk_component(plotarea).view -image $_image(plot) \
    234234            -highlightthickness 0 -borderwidth 0
     
    237237        ignore -highlightthickness -borderwidth  -background
    238238    }
    239     bind $itk_component(3dview) <Control-F1> [itcl::code $this ToggleConsole]
     239    bind $itk_component(view) <Control-F1> [itcl::code $this ToggleConsole]
    240240
    241241    set f [$itk_component(main) component controls]
     
    312312    BuildSettingsTab
    313313
    314     # HACK ALERT. Initially force a requested width of the 3dview label.
    315 
    316     # It's a chicken-and-the-egg problem.  The size of the 3dview label is set
     314    # HACK ALERT. Initially force a requested width of the view label.
     315
     316    # It's a chicken-and-the-egg problem.  The size of the view label is set
    317317    # from the size of the image retrieved from the server.  But the size of
    318318    # the image is specified by the viewport which is the size of the label.
     
    324324    # (that's why we're using the blt::table to manage the geometry).  It has
    325325    # to be big, because we don't know how big the user may want to stretch
    326     # the window.  This at least forces the sidebarframe to give the 3dview
     326    # the window.  This at least forces the sidebarframe to give the view
    327327    # the maximum size available, which is perfect for an initially closed
    328328    # sidebar.
    329329
    330330    blt::table $itk_component(plotarea) \
    331         0,0 $itk_component(3dview) -fill both -reqwidth 10000
     331        0,0 $itk_component(view) -fill both -reqwidth 10000
    332332    #
    333333    # RENDERING AREA
     
    338338    if { $_useVmouseEvents } {
    339339        # set up bindings to bridge mouse events to server
    340         bind $itk_component(3dview) <ButtonPress> \
     340        bind $itk_component(view) <ButtonPress> \
    341341            [itcl::code $this Vmouse click %b %s %x %y]
    342         bind $itk_component(3dview) <ButtonRelease> \
     342        bind $itk_component(view) <ButtonRelease> \
    343343            [itcl::code $this Vmouse release %b %s %x %y]
    344         bind $itk_component(3dview) <B1-Motion> \
     344        bind $itk_component(view) <B1-Motion> \
    345345            [itcl::code $this Vmouse drag 1 %s %x %y]
    346         bind $itk_component(3dview) <B2-Motion> \
     346        bind $itk_component(view) <B2-Motion> \
    347347            [itcl::code $this Vmouse drag 2 %s %x %y]
    348         bind $itk_component(3dview) <B3-Motion> \
     348        bind $itk_component(view) <B3-Motion> \
    349349            [itcl::code $this Vmouse drag 3 %s %x %y]
    350         bind $itk_component(3dview) <Motion> \
     350        bind $itk_component(view) <Motion> \
    351351            [itcl::code $this Vmouse move 0 %s %x %y]
    352352    } else {
    353353        # set up bindings for rotation with mouse
    354         bind $itk_component(3dview) <ButtonPress-1> \
     354        bind $itk_component(view) <ButtonPress-1> \
    355355            [itcl::code $this Rotate click %x %y]
    356         bind $itk_component(3dview) <B1-Motion> \
     356        bind $itk_component(view) <B1-Motion> \
    357357            [itcl::code $this Rotate drag %x %y]
    358         bind $itk_component(3dview) <ButtonRelease-1> \
     358        bind $itk_component(view) <ButtonRelease-1> \
    359359            [itcl::code $this Rotate release %x %y]
    360360
    361361        # set up bindings for panning with mouse
    362         bind $itk_component(3dview) <ButtonPress-2> \
     362        bind $itk_component(view) <ButtonPress-2> \
    363363            [itcl::code $this Pan click %x %y]
    364         bind $itk_component(3dview) <B2-Motion> \
     364        bind $itk_component(view) <B2-Motion> \
    365365            [itcl::code $this Pan drag %x %y]
    366         bind $itk_component(3dview) <ButtonRelease-2> \
     366        bind $itk_component(view) <ButtonRelease-2> \
    367367            [itcl::code $this Pan release %x %y]
    368368
    369369        # scroll wheel zoom
    370370        if {[string equal "x11" [tk windowingsystem]]} {
    371             bind $itk_component(3dview) <4> [itcl::code $this Zoom out 2]
    372             bind $itk_component(3dview) <5> [itcl::code $this Zoom in 2]
     371            bind $itk_component(view) <4> [itcl::code $this Zoom out 2]
     372            bind $itk_component(view) <5> [itcl::code $this Zoom in 2]
    373373        }
    374374    }
    375375
    376376    # Set up bindings for panning with keyboard
    377     bind $itk_component(3dview) <KeyPress-Left> \
     377    bind $itk_component(view) <KeyPress-Left> \
    378378        [itcl::code $this Pan set -10 0]
    379     bind $itk_component(3dview) <KeyPress-Right> \
     379    bind $itk_component(view) <KeyPress-Right> \
    380380        [itcl::code $this Pan set 10 0]
    381     bind $itk_component(3dview) <KeyPress-Up> \
     381    bind $itk_component(view) <KeyPress-Up> \
    382382        [itcl::code $this Pan set 0 -10]
    383     bind $itk_component(3dview) <KeyPress-Down> \
     383    bind $itk_component(view) <KeyPress-Down> \
    384384        [itcl::code $this Pan set 0 10]
    385     bind $itk_component(3dview) <Shift-KeyPress-Left> \
     385    bind $itk_component(view) <Shift-KeyPress-Left> \
    386386        [itcl::code $this Pan set -50 0]
    387     bind $itk_component(3dview) <Shift-KeyPress-Right> \
     387    bind $itk_component(view) <Shift-KeyPress-Right> \
    388388        [itcl::code $this Pan set 50 0]
    389     bind $itk_component(3dview) <Shift-KeyPress-Up> \
     389    bind $itk_component(view) <Shift-KeyPress-Up> \
    390390        [itcl::code $this Pan set 0 -50]
    391     bind $itk_component(3dview) <Shift-KeyPress-Down> \
     391    bind $itk_component(view) <Shift-KeyPress-Down> \
    392392        [itcl::code $this Pan set 0 50]
    393393
    394394    # Set up bindings for zoom with keyboard
    395     bind $itk_component(3dview) <KeyPress-Prior> \
     395    bind $itk_component(view) <KeyPress-Prior> \
    396396        [itcl::code $this Zoom out 2]
    397     bind $itk_component(3dview) <KeyPress-Next> \
     397    bind $itk_component(view) <KeyPress-Next> \
    398398        [itcl::code $this Zoom in 2]
    399399
    400     bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)"
    401 
    402     bind $itk_component(3dview) <Configure> \
     400    bind $itk_component(view) <Enter> "focus $itk_component(view)"
     401
     402    bind $itk_component(view) <Configure> \
    403403        [itcl::code $this EventuallyResize %w %h]
    404     bind $itk_component(3dview) <Unmap> \
     404    bind $itk_component(view) <Unmap> \
    405405        [itcl::code $this Unmap]
    406     bind $itk_component(3dview) <Map> \
     406    bind $itk_component(view) <Map> \
    407407        [itcl::code $this Map]
    408408
     
    11061106        # Set or restore viewing parameters.  We do this for the first
    11071107        # model and assume this works for everything else.
    1108         set w  [winfo width $itk_component(3dview)]
    1109         set h  [winfo height $itk_component(3dview)]
     1108        set w  [winfo width $itk_component(view)]
     1109        set h  [winfo height $itk_component(view)]
    11101110        SendCmd "reset"
    11111111        SendCmd "screen $w $h"
     
    12401240    }
    12411241    if { $option == "click" } {
    1242         $itk_component(3dview) configure -cursor hand1
     1242        $itk_component(view) configure -cursor hand1
    12431243    }
    12441244    if { $option == "drag" || $option == "release" } {
     
    12531253    set _mevent(y) $y
    12541254    if { $option == "release" } {
    1255         $itk_component(3dview) configure -cursor ""
     1255        $itk_component(view) configure -cursor ""
    12561256    }
    12571257}
     
    13071307        unset _rocker(afterid)
    13081308    }
    1309     if { ![winfo viewable $itk_component(3dview)] } {
     1309    if { ![winfo viewable $itk_component(view)] } {
    13101310        return
    13111311    }
     
    13791379    }
    13801380    if { $option == "click" } {
    1381         $itk_component(3dview) configure -cursor fleur
     1381        $itk_component(view) configure -cursor fleur
    13821382    }
    13831383    if { $option == "drag" || $option == "release" } {
     
    13881388            return
    13891389        }
    1390         set w [winfo width $itk_component(3dview)]
    1391         set h [winfo height $itk_component(3dview)]
     1390        set w [winfo width $itk_component(view)]
     1391        set h [winfo height $itk_component(view)]
    13921392        if {$w <= 0 || $h <= 0} {
    13931393            return
     
    14301430    set _mevent(time) $now
    14311431    if { $option == "release" } {
    1432         $itk_component(3dview) configure -cursor ""
     1432        $itk_component(view) configure -cursor ""
    14331433    }
    14341434}
     
    14521452    switch -- $option {
    14531453        click {
    1454             $itk_component(3dview) configure -cursor fleur
     1454            $itk_component(view) configure -cursor fleur
    14551455            set _click(x) $x
    14561456            set _click(y) $y
     
    14621462                Rotate.old click $x $y
    14631463            } else {
    1464                 set w [winfo width $itk_component(3dview)]
    1465                 set h [winfo height $itk_component(3dview)]
     1464                set w [winfo width $itk_component(view)]
     1465                set h [winfo height $itk_component(view)]
    14661466                if {$w <= 0 || $h <= 0} {
    14671467                    return
     
    15281528        release {
    15291529            Rotate.old drag $x $y
    1530             $itk_component(3dview) configure -cursor ""
     1530            $itk_component(view) configure -cursor ""
    15311531            catch {unset _click}
    15321532        }
Note: See TracChangeset for help on using the changeset viewer.