Changeset 5023 for trunk


Ignore:
Timestamp:
Feb 13, 2015 3:36:37 PM (5 years ago)
Author:
ldelgass
Message:

Add heading,pitch sliders, more keyboard bindings

File:
1 edited

Legend:

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

    r5022 r5023  
    110110    private method SetPitch { {value -89.999} }
    111111    private method SetTerrainStyle { style }
     112    private method ToggleGrid {}
     113    private method ToggleLighting {}
     114    private method ToggleWireframe {}
    112115    private method UpdateLayerControls {}
    113116    private method Zoom {option {x 0} {y 0}}
     
    258261
    259262    set c $itk_component(view)
    260     #bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    261     #bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    262     #bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    263     #bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    264263    bind $c <Enter> "focus %W"
    265264    bind $c <Control-F1> [itcl::code $this ToggleConsole]
     
    482481        bind $itk_component(view) <p> \
    483482            [itcl::code $this SetPitch]
     483        bind $itk_component(view) <g> \
     484            [itcl::code $this ToggleGrid]
     485        bind $itk_component(view) <l> \
     486            [itcl::code $this ToggleLighting]
     487        bind $itk_component(view) <w> \
     488            [itcl::code $this ToggleWireframe]
    484489
    485490        # Binding for mouse motion events
     
    18421847    }
    18431848
     1849    label $inner.heading_slider_l -text "Heading" -font "Arial 9"
     1850    ::scale $inner.heading_slider -font "Arial 9" \
     1851        -from -180 -to 180 -orient horizontal \
     1852        -variable [itcl::scope _view(heading)] \
     1853        -showvalue on \
     1854        -command [itcl::code $this camera set heading]
     1855
     1856    blt::table $inner \
     1857            $row,0 $inner.heading_slider_l -anchor w -pady 2
     1858    blt::table $inner \
     1859            $row,1 $inner.heading_slider -fill x -anchor w -pady 2
     1860    blt::table configure $inner r$row -resize none
     1861    incr row
     1862
     1863    label $inner.pitch_slider_l -text "Pitch" -font "Arial 9"
     1864    ::scale $inner.pitch_slider -font "Arial 9" \
     1865        -from -10 -to -90 -orient horizontal \
     1866        -variable [itcl::scope _view(pitch)] \
     1867        -showvalue on \
     1868        -command [itcl::code $this camera set pitch]
     1869
     1870    blt::table $inner \
     1871            $row,0 $inner.pitch_slider_l -anchor w -pady 2
     1872    blt::table $inner \
     1873            $row,1 $inner.pitch_slider -fill x -anchor w -pady 2
     1874    blt::table configure $inner r$row -resize none
     1875    incr row
     1876
    18441877    blt::table configure $inner c* r* -resize none
    18451878    blt::table configure $inner c2 -resize expand
     
    19631996    $inner.image_button invoke
    19641997    return $inner
     1998}
     1999
     2000itcl::body Rappture::MapViewer::ToggleGrid {} {
     2001    set _settings(grid) [expr !$_settings(grid)]
     2002    AdjustSetting grid
     2003}
     2004
     2005itcl::body Rappture::MapViewer::ToggleLighting {} {
     2006    set _settings(terrain-lighting) [expr !$_settings(terrain-lighting)]
     2007    AdjustSetting terrain-lighting
     2008}
     2009
     2010itcl::body Rappture::MapViewer::ToggleWireframe {} {
     2011    set _settings(terrain-wireframe) [expr !$_settings(terrain-wireframe)]
     2012    AdjustSetting terrain-wireframe
    19652013}
    19662014
Note: See TracChangeset for help on using the changeset viewer.