This module implements objects that are used in Drag-and-Drop and Cut-andPaste functions.

DragAndDropObjects is made up of the following:

DragDropEvaluation(source, destination) -- A Boolean FUNCTION that indicates whether the specified source object, a DatabaseTreeTab Node, can be legally dropped on the destination, another DatabaseTreeTab Node. This is implemented as a function because it is used in the DropSource's GiveFeedback method and in the DropTarget's OnData method.

DataTreeDragDropData -- a Python Object that contains the data that is encapsulated in a DatabaseTreeTab Node. This encapsulates the essential information for what is being dragged.

DataTreeDropSource -- an Object derived from wxDropSource. It is implemented in such a way as to provide visual feedback to the user to indicate whether a proposed Drop is legal or not.

DataTreeDropTarget -- an Object derived from wxDropTarget. It is designed to handle data drops on the DatabaseTreeTab.

ClipDragDropData -- a Python Object that contains the data that is needed for creating a Clip by dragging text (and other information) from the Transcript to the Database Tree.

ProcessPasteDrop(treeCtrl, sourceData, destNode, action): -- a method that processes a Paste or Drop request. It is a stand-alone method so that as much logic as possible can be shared by Drag-and-Drop routines and Cut-and-Paste routines.

CopyMoveClip(treeCtrl, destNode, sourceClip, sourceCollection, destCollection, action): -- a method used by ProcessPasteDrop to implement the copy and move operations for Clips. It is a stand-alone method to allow code reuse between several different methods of copying and moving clips.

ChangeClipOrder(treeCtrl, destNode, sourceClip, sourceCollection): -- a method used by ProcessPasteDrop to implement the altering of Clip Sort Order when desired. It is a stand-alone method to allow code resuse by several different methods related to dropping and pasting clips. CreateQuickClip(clipData, kwg, kw, dbTree): -- a method used to implement Open Coding via Quick Clips.

DragAndDropObjects contains the following functions:

FunctionDescription
DragDropEvaluation() This boolean function indicates whether the source tree node can legally be dropped (or pasted) on the destination tree node. This function is encapsulated because it needs to be called from several different locations during the Drag-and-Drop process, including the DropSource's GiveFeedback() Method and the DropTarget's OnData() Method, as well as the DBTree's OnRightClick() to enable or disable the "Paste" option.
CreateClip() This method handles the creation of a Clip Object in the Transana Database
DropKeyword() Drop a Keyword onto an Object. sourceData is from the Keyword. The targetType is one of 'Series', 'Episode', 'Collection', or 'Clip'. targetParent is only used for collections.
ProcessPasteDrop() This method processes a "Paste" or "Drop" request for the Transana Database Tree. Parameters are: treeCtrl -- the wxTreeCtrl where the Paste or Drop is occurring (the DBTree) sourceData -- the DATA associated with the Cut/Copy or Drag, the _NodeData or the DataTreeDragDropData Object destNode -- the actual Tree Node selected for Drop or Paste action -- a string of "Copy" or "Move", indicating whether a Copy or Cut/Move has been requested. (This value is ignored in some instances where "Move" has no meaning.
ClearClipboard() If we Moved, we need to clear out the Clipboard. We'll do this by putting an empty DataTreeDragDropData object into the Clipboard.
CheckForDuplicateClipName() Check the destCollectionNode to see if sourceClipName already exists. If so, prompt for a name change. Return True if duplicate is found, False if no duplicate is found or if Clip is renamed appropriately.
CopyMoveClip() This function copies or moves sourceClip to destCollection, depending on the value of 'action'
ChangeClipOrder() This function changes the order of the clips in a Collection
CreateQuickClip() Create a "Quick Clip", which is the implementation of a simplified form of Clip Creation