$canvaseditor subeditor …
creates new subeditor intended to edit selected elements, where non-selected elements are disabled.

Intended to work without distraction.

obj method canvaseditor subeditor {{before {}} {after {}}} {
  # edit selection only, avoid distraction to others
  set nonSelected [ldifference [$self elements] [$self selected]]
  $self memory before [$self dump]
  eval $before
  lappend destroyLines $after\
    "$self select"\
    "$self select {*}\[\$self elements\]"\
    "$self private zoom \[\$self private zoom\]"
  foreach element $nonSelected {
    lappend destroyLines "$element state normal"
  lappend destroyLines\
    "$self buildMenu"\
    "$self basicBindings"
  foreach element $nonSelected {
    $element state disabled
  lappend destroyLines\
    "$self memory after \[$self dump\]"\
    "$self initUndoRedo \[$self memory before\] \[$self memory after\]"
  $self select
  set editor [new [$self info class] [my canvas] [join $destroyLines \n]]
  $editor private zoom [my zoom]
  $editor private defaultmessage "Editing selection. Ready."
  $editor private settings [my settings]
  $editor buildInfoWindow
  set editor

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