editSelected

$canvaseditor editSelected
sets state of non-selected elements to disabled, allows to edit a group.

obj method canvaseditor editSelected {} {
  if {[llength [my selection]] != 1} then {
    # Edit two or more elements
    set subEd [$self subeditor]
    $self statusLine {*}[$subEd private defaultmessage]
  } elseif {[$self selected isa group]} then {
    # Edit group elements
    set msg "Edit group [namespace tail [$self selected]]. Ready"
    set subEd [$self subeditor [subst {
          $self selected release all
        }] [subst {
          [$self selected] add {*}\[\$self elements\]
        }]]
    $self statusLine {*}[$subEd private defaultmessage $msg]
  } elseif {[$self selected isa fill]} then {
    # Edit fill object
    lassign [$self selected] fill
    set zIndex [$fill canvasZ]
    set msg "Edit fill [namespace tail $fill]. Ready"
    set subEd [$self subeditor [subst {
          $fill empty
        }] [subst {
          $fill add {*}\[\$self elements\]
          $fill draw no
          $fill draw
          $fill canvasZ $zIndex
        }]]
    $self statusLine [$subEd private defaultmessage $msg]
  } elseif {[$self selected isa line]} then {
    $self editLine {*}[$self selected]
  }
}

© Wolf-Dieter Busch | Home | Sitemap | Urheber | A-Z