objUndoRedoTxt

Internal procedure.

objUndoRedoTxt object
returns commands to restore current object according to its class (line, fill, group).

obj inscope canvaseditor proc objUndoRedoTxt obj {
  # textliche Befehlsfolge für undo erzeugen
  switch -exact -- [$obj info class] {
    group {
      lappend result\
        [list $obj configure -constraint [$obj cget -constraint]]\
        {*}[lmap x [$obj private elements] {objUndoRedoTxt $x}]
    }
    fill {
      set cmdLine [list $obj configure]
      lappend cmdLine -fill [$obj cget -fill] -constraint [$obj cget -constraint]
      lappend result $cmdLine
      foreach line [$obj private lines] {
        lappend result [objUndoRedoTxt $line]
      }
    }
    line {
      set cmdLine [list $obj configure]
      foreach p [$obj configure] {
        lappend cmdLine [lindex $p 0] [lindex $p end]
      }
      lappend result $cmdLine
      foreach dot [$obj dots] {
        lappend result\
          [list $dot configure\
            -x [$dot cget -x]\
            -y [$dot cget -y]]
      }
    }
  }
  join $result \n
}

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