{"id":101,"date":"2007-05-12T14:07:36","date_gmt":"2007-05-12T12:07:36","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/dragdrop-im-tree-fur-bestimmte-nodes-verhindern\/"},"modified":"2007-05-12T14:07:37","modified_gmt":"2007-05-12T12:07:37","slug":"dragdrop-im-tree-fur-bestimmte-nodes-verhindern","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/dragdrop-im-tree-fur-bestimmte-nodes-verhindern\/","title":{"rendered":"Drag&#038;Drop im Tree f\u00fcr bestimmte Nodes verhindern"},"content":{"rendered":"<p>Hallo Boris,<\/p>\n<p>dein Vorschlag mit DragMode = dmManual funktioniert.<br \/>\nZu beachten ist noch der Parameter FALSE in BeginDrag.<br \/>\nDer Drag-Vorgang wird dann erst gestartet, wenn die Maus<br \/>\nnoch etwas bewegt wird.<br \/>\n[code lang=&#8221;delphi&#8221;]procedure TViewWindowPositionen.CopyTreeMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);<\/p>\n<p>var<br \/>\n  bDragAllowed : Boolean;<br \/>\n  bIsHierarchie: Boolean;<br \/>\n  sKE          : String;<\/p>\n<p>  Node         : TTreeDFNode;<\/p>\n<p>begin<br \/>\n  inherited;<\/p>\n<p>  if Button = mbLeft then begin<br \/>\n    Node:= CopyTree.GetNodeAt(X, Y);<\/p>\n<p>    if Node <> nil then begin<br \/>\n      bDragAllowed:= FALSE;<\/p>\n<p>      if (Node.sType = NODE_LEISTUNG) or (Node.sType = NODE_SELEKT_PFLANZE) then begin<br \/>\n         bDragAllowed:= TRUE;<\/p>\n<p>      end else if Node.sType = NODE_POSITION then begin<br \/>\n         GetPosTypFromID(Node.sID, sKE, bIsHierarchie);<\/p>\n<p>         bDragAllowed:= (sKe <> &#8216;PL&#8217;) and (sKE <> &#8216;PS&#8217;);<br \/>\n      end;<\/p>\n<p>      if bDragAllowed then begin<br \/>\n         (Sender as TControl).BeginDrag(FALSE);<br \/>\n         CopyTree.DraggedNode:= Node;<br \/>\n      end;<br \/>\n    end;<br \/>\n  end;<br \/>\nend;[\/code]<\/p>\n<p>[tags]Delphi, Components, TreeView[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hallo Boris, dein Vorschlag mit DragMode = dmManual funktioniert. Zu beachten ist noch der Parameter FALSE in BeginDrag. Der Drag-Vorgang wird dann erst&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[90,75,95],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-1D","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/101"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/101\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}