Home » U++ Library support » TreeCtrl » Nodes with Ctrl content disappear when Drag n Drop
Nodes with Ctrl content disappear when Drag n Drop [message #23433] |
Mon, 19 October 2009 09:26 |
|
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
hi there,
using TreeCtrl with ctrl content in the nodes is just fine, though we still cant use the key approach to find the node with a key, if it contains a ctrl.
BUT: drag and drop reacts weired. the ctrl content simply disappears when dragging those elements. find attached a modified TreeCtrlDnD version, which uses EditString as content, and play around.
the problem here is the use of the Copy function (TreeCtrl.cpp:1701), no matter what action is performed. DND_MOVE should somehow preserve the ctrl, while DND_COPY freele can set the copy Node ctrl to NULL.
also it would be great, to have kind of a TreeCtrl based API method, which can *manually* move elements, something like
int Move(id src, int parent, int ii);
which can move a treeelement with src id, into another element, adressed with parent id and using its child position ii.
maybe this would be a nice feature for other Container Ctrls as well (ArrayCtrl, ColumnList, ...)
whis would give means to reorganize the tree (or basicly speaking the data base) in an easy way in code, without using the DragnDrop or Insert API, which breaks ctrl references
OTHER question:
the following Move workaround crasches in the Call of Remove(), why? (tGroups is a TreeCtrl, id is the to be moved element, moving to parent / ii), it works so far, leaving the dummy element, but removing causes an ASSERT
//insert a dummy so we can swap them, and delete the dummy
int id__ = tGroups.Insert(parent, ii, Image(), Value(0));
tGroups.Swap(id, id__);
tGroups.Remove(id); //ASSERT
any help greatly appreciated
|
|
|
|
|
Goto Forum:
Current Time: Sat Sep 21 07:12:51 CEST 2024
Total time taken to generate the page: 0.03572 seconds
|