Changeset 4362


Ignore:
Timestamp:
May 21, 2014 5:00:33 PM (10 years ago)
Author:
ldelgass
Message:

Add toggle for coords readout

File:
1 edited

Legend:

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

    r4361 r4362  
    201201    array set _settings [subst {
    202202        camera-throw           0
     203        coords-precision       5
     204        coords-units           "latlong_decimal_degrees"
     205        coords-visible         1
    203206        grid                   0
    204207        grid-type              "geodetic"
     
    370373        bind $itk_component(view) <Double-3> \
    371374            [itcl::code $this camera go %x %y 2.5]
     375        bind $itk_component(view) <Double-3> \
     376            +[itcl::code $this SendCmd "map setpos %x %y"]
    372377
    373378        # Bindings for panning via keyboard
     
    965970                    terrain-vertscale terrain-wireframe
    966971            }
     972            FixSettings coords-visible
    967973        } else {
    968974            error "No map settings on reset"
     
    13261332    }
    13271333    switch -- $what {
     1334        "coords-visible" - "coords-precision" - "coords-units" {
     1335            set bool $_settings(coords-visible)
     1336            set units $_settings(coords-units)
     1337            set precision $_settings(coords-precision)
     1338            SendCmd "map posdisp $bool $units $precision"
     1339        }
    13281340        "grid" - "grid-type" {
    13291341            set bool $_settings(grid)
     
    13321344        }
    13331345        "camera-throw" {
    1334             set bool $_settings(camera-throw)
     1346            set bool $_settings($what)
    13351347            SendCmd "camera throw $bool"
    13361348        }
    13371349        "terrain-edges" {
    1338             set bool $_settings(terrain-edges)
     1350            set bool $_settings($what)
    13391351            SendCmd "map terrain edges $bool"
    13401352        }
    13411353        "terrain-lighting" {
    1342             set bool $_settings(terrain-lighting)
     1354            set bool $_settings($what)
    13431355            SendCmd "map terrain lighting $bool"
    13441356        }
     
    13481360        }
    13491361        "terrain-vertscale" {
    1350             set val $_settings(terrain-vertscale)
     1362            set val $_settings($what)
    13511363            SendCmd "map terrain vertscale $val"
    13521364        }
    13531365        "terrain-wireframe" {
    1354             set bool $_settings(terrain-wireframe)
     1366            set bool $_settings($what)
    13551367            SendCmd "map terrain wireframe $bool"
    13561368        }
     
    13951407        -icon [Rappture::icon surface]]
    13961408    $inner configure -borderwidth 4
     1409
     1410    checkbutton $inner.posdisp \
     1411        -text "Show Coordinate Readout" \
     1412        -variable [itcl::scope _settings(coords-visible)] \
     1413        -command [itcl::code $this AdjustSetting coords-visible] \
     1414        -font "Arial 9" -anchor w
    13971415
    13981416    checkbutton $inner.grid \
     
    14401458
    14411459    blt::table $inner \
    1442         0,0 $inner.grid      -cspan 2  -anchor w -pady 2 \
    1443         1,0 $inner.wireframe -cspan 2  -anchor w -pady 2 \
    1444         2,0 $inner.lighting  -cspan 2  -anchor w -pady 2 \
    1445         3,0 $inner.edges     -cspan 2  -anchor w -pady 2 \
    1446         4,0 $inner.vscale_l  -anchor w -pady 2 \
    1447         4,1 $inner.vscale    -fill x   -pady 2 \
    1448         5,0 $inner.palette_l -anchor w -pady 2 \
    1449         5,1 $inner.palette   -fill x   -pady 2 
     1460        0,0 $inner.posdisp   -cspan 2  -anchor w -pady 2 \
     1461        1,0 $inner.grid      -cspan 2  -anchor w -pady 2 \
     1462        2,0 $inner.wireframe -cspan 2  -anchor w -pady 2 \
     1463        3,0 $inner.lighting  -cspan 2  -anchor w -pady 2 \
     1464        4,0 $inner.edges     -cspan 2  -anchor w -pady 2 \
     1465        5,0 $inner.vscale_l  -anchor w -pady 2 \
     1466        5,1 $inner.vscale    -fill x   -pady 2 \
     1467        6,0 $inner.palette_l -anchor w -pady 2 \
     1468        6,1 $inner.palette   -fill x   -pady 2 
    14501469
    14511470    blt::table configure $inner r* c* -resize none
    1452     blt::table configure $inner r7 c1 -resize expand
     1471    blt::table configure $inner r8 c1 -resize expand
    14531472}
    14541473
Note: See TracChangeset for help on using the changeset viewer.