Changeset 6225


Ignore:
Timestamp:
Mar 30, 2016 11:00:44 AM (8 years ago)
Author:
ldelgass
Message:

Validation for select arguments, add select mode option

File:
1 edited

Legend:

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

    r6224 r6225  
    934934# ----------------------------------------------------------------------
    935935# USAGE: select clear
    936 # USAGE: select feature <args...>
    937 # USAGE: select annotation <args...>
     936# USAGE: select feature add|delete|set <featureIDList> <layerName>
     937# USAGE: select mode <boolean>
    938938#
    939939# Clients use this method to notify the map widget of a selection event
     
    942942itcl::body Rappture::MapViewer::select {option {args ""}} {
    943943    switch $option {
    944         "annotation" {
    945             SendCmd "select annotation $args"
    946         }
    947944        "clear" {
     945            if {[llength $args] > 0} {
     946                error "wrong # args: should be \"select clear\""
     947            }
    948948            SendCmd "select clear"
    949949        }
    950950        "feature" {
     951            if {[llength $args] != 3} {
     952                error "wrong #args: should be \"select feature <op> <featureIDList> <layerName>\""
     953            }
    951954            set op [lindex $args 0]
    952955            set layer [lindex $args end]
     
    969972                }
    970973            }
     974        }
     975        "mode" {
     976            if {[llength $args] != 1} {
     977                error "wrong # args: should be \"select mode <boolean>\""
     978            }
     979            if {![string is boolean $args]} {
     980                error "argument to \"select mode\" must be boolean"
     981            }
     982            SendCmd "select mode $args"
    971983        }
    972984        default {
Note: See TracChangeset for help on using the changeset viewer.