This class helps a max explorer container handle the drag and drop related events The drag and drop could occur between different explorers or from explorer to max viewport.
Besides the "NodeCommand", user could register additional node command to be executed during drag and drop. The DragDropNodeCommandEventHandler always use the first valid node command(IsValid method return true) to respond to the drag and drop events. The sequence is first check "NodeCommand", then the additional node commands as the sequence they were registered.
If you want make sure a specific node command will be used first, set it to "NodeCommand".
Public Member Functions |
|
DragDropNodeCommandEventHandler () | |
Constructs an empty event handler. |
|
override void | HandleNodeEvent (object sender, TraversalNodeEventArgs e) |
Event handler any Node Event. |
|
override void | HandleDragOverNode (object sender, TraversalNodeActionQueryEventArgs e) |
Handles the DragOver event on the
ExplorerContainer that it is monitoring. |
|
virtual void | HandleBeforeDragNodes (object sender, EventArgs e) |
Handles the BeforeDragNodes event on the
TreeList that it is monitoring. |
|
virtual void | HandleDragEnterTreeList (object sender, DragEventArgs e) |
Handles the DragEnter event on the TreeList
that it is monitoring. |
|
virtual void | HandleQueryContinueDrag (object sender, QueryContinueDragEventArgs e) |
Handles the QueryContinueDrag event on the
TreeList that it is monitoring. |
|
void | RegisterAdditionalNodeCommand (NodeCommand cmd) |
Register an additional node command and
update its Explorer property. |
|
void | UnregisterAdditionalNodeCommand (NodeCommand cmd) |
Unregister an additional node command.
|
|
void | UnregisterAllAdditionalCommands () |
Unregister all the additional node commands.
|
MaxCustomControls::MaxExplorerControls::DragDropNodeCommandEventHandler::DragDropNodeCommandEventHandler | ( | ) | [inline] |
Constructs an empty event handler.
override void MaxCustomControls::MaxExplorerControls::DragDropNodeCommandEventHandler::HandleNodeEvent | ( | object | sender, |
TraversalNodeEventArgs | e | ||
) | [inline, virtual] |
Event handler any Node Event.
Fires the given NodeCommand.
sender | The source of the event |
e | Data about this event containing the affected node. |
Reimplemented from MaxCustomControls::NodeCommandEventHandler.
override void MaxCustomControls::MaxExplorerControls::DragDropNodeCommandEventHandler::HandleDragOverNode | ( | object | sender, |
TraversalNodeActionQueryEventArgs | e | ||
) | [inline, virtual] |
Handles the DragOver event on the ExplorerContainer that it is monitoring.
Will call IsValid method on each node command and set the result in TraversalNodeDragEventArgs.DragActionIsValid to true if any IsValid method return true.
sender | The sender of the event. |
e | The arguments for this event. The arguments contain the current target node and property that allows this handler to indicate whether the NodeCommand is valid for this target. |
Reimplemented from MaxCustomControls::NodeCommandEventHandler.
virtual void MaxCustomControls::MaxExplorerControls::DragDropNodeCommandEventHandler::HandleBeforeDragNodes | ( | object | sender, |
EventArgs | e | ||
) | [inline, virtual] |
Handles the BeforeDragNodes event on the TreeList that it is monitoring.
It gets the explorer from which the event is raised and set it to all the registered node commands.
sender | The sender of the event. |
e | The arguments for this event. |
virtual void MaxCustomControls::MaxExplorerControls::DragDropNodeCommandEventHandler::HandleDragEnterTreeList | ( | object | sender, |
DragEventArgs | e | ||
) | [inline, virtual] |
Handles the DragEnter event on the TreeList that it is monitoring.
It will try to get the source explorer from which the drag and drop was raised. And update all the node commands' Explorer property accordingly.
sender | The sender of the event. |
e | The arguments for this event. The arguments contain the source explorer from which the drag and drop operation is first raised. |
virtual void MaxCustomControls::MaxExplorerControls::DragDropNodeCommandEventHandler::HandleQueryContinueDrag | ( | object | sender, |
QueryContinueDragEventArgs | e | ||
) | [inline, virtual] |
Handles the QueryContinueDrag event on the TreeList that it is monitoring.
It is used to handle drag and drop from explorer to viewport. It first check if the cursor is over any viewport of 3ds Max. Then it try to get the objects that the cursor is over. Afterwards, if dragging, it call the will check if any registered node command could handle the operation and set the cursor accordingly. If dropped, it will execute the first valid node command.
sender | The sender of the event. |
e | The arguments for this event. |
void MaxCustomControls::MaxExplorerControls::DragDropNodeCommandEventHandler::RegisterAdditionalNodeCommand | ( | NodeCommand | cmd | ) | [inline] |
Register an additional node command and update its Explorer property.
cmd | The NodeCommand to be registered. |
void MaxCustomControls::MaxExplorerControls::DragDropNodeCommandEventHandler::UnregisterAdditionalNodeCommand | ( | NodeCommand | cmd | ) | [inline] |
Unregister an additional node command.
cmd | The NodeCommand to be unregistered. |
void MaxCustomControls::MaxExplorerControls::DragDropNodeCommandEventHandler::UnregisterAllAdditionalCommands | ( | ) | [inline] |
Unregister all the additional node commands.