This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I found that if I set the DragAction to be "Select", it will only work for 1 item that being included in the dragged selection rectangle. I would like to select multiple nodes with the drag action, but seems like the SelectionMode with Extended cannot achieve that. Somehow the "Multiple" mode did that right. Is this a misbehaviour for Extended mode? |
|
|
Hello Everything is working as expected at my end. There may be some other factor causing this to happen. Check that it really is failing when selection mode is Extended, and if so, please send a repro and we will solve it. - Jason |
|
|
Hi Jason, check this sample project out, drag your mouse over two nodes and you'll see the nodes didn't change the state to selected, so do the total no. of selectedItems. |
|
|
Hello Thanks for this repro, it helped a lot! While using marquee select, the nodes were actually being selected, but setting the visibility of the Resizer control on line 141 of MainWindow.xaml to be collapsed makes it look like the nodes are not selected. The default behaviour of displaying a node as being selected is to display the resizer. This may have been intentional though. The reason why the selected items count is incorrect is because there was a bug with raising the SelectedElemntsChanged event while using the marquee select rectangle. This has been resolved and can be downloaded through the nightly builds from tomorrow the 4th of June. - Jason |
|
|
Hi Jason, thanks for the fix. Now the selection works as expected. However, here's another corner case that might need your advice: I actually implemented my own node and style. And, for certain circumstances, the user can set the node to be 'not movable'. In that case, I would like the selection to exclude the 'non-movable' nodes, eventhough the marquee select rectangle includes them. This only happen if the user use the drag marquee selection, other times the non-movable nodes are not hitable since i set the HitTest to false. So, now the question is how can I achieve such effect with the marquee selection? |
|
|
Sorry, I should make it more clear: The user use the marquee selection to select multiple nodes, and MOVE them. Since some nodes are Not suppose to be movable, how to prevent that happen? |
|
|
Hello I tried this out and got successful results by overriding the OnBoundsChanged method in a custom node. Here is what I used:
private Rect? _bounds = null; protected override void OnBoundsChanged() The first condition is so that the bounds property can still be set by the node tool when dragging it from the tool box. The second condition reverts any changes made to the Bounds property which makes it appear non-movable. This is the general idea, but you may need to modify the logic a bit to fit your model. Let us know how it goes. - Jason |
|