pasteFromClipboard

$canvaseditor pasteFromClipboard
processes contents as previously copied.
$canvaseditor pasteFromClipboard XMLsrc
processes XMLsrc

obj method canvaseditor pasteFromClipboard {{xml {}}} {
  if {$xml eq {}} then {
    set xml [clipboard get]
  }
  set undoList {}
  set redoList {}
  set before [$self elements]
  $self processXML $xml
  set after [$self elements]
  foreach obj $after {
    if {$obj ni $before} then {
      $self select $obj
      lappend undoList "$obj draw no"
      lappend redoList "$obj draw"
    }
  }
  set undoStr \n[join $undoList \n]\n
  set redoStr \n[join $redoList \n]\n
  append redoStr \n [$self undoRedoCode] \n
  $self initUndoRedo $undoStr $redoStr
}

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