wxoo.dnd
index
p:\wxproperties\wxoo\dnd.py

Event-based drag and drop implementation classes
 
Summary:
        Make handling of object drag-and-drop more like having the source window
        send a richly-configured event to the target window.
 
 
Details:
        The module defines a PyCommandEvent sub-class which provides information
        about the drag-and-drop operation.  The event is partially configured by
        the drop source, passed through the drag-and-drop system as a key into a
        global store, then is finalised and passed to the target window as an
        event in the pending events queue.
        
        The implementation is fairly straightforward and simple (naive), but it
        does make the process of creating drag-and-drop systems which trade
        Python objects fairly easy.  Consider it a proof-of-concept or neat
        idea, rather than a professional-quality utility module.

 
Modules
       
clip_dndc
cmndlgsc
controls2c
controlsc
copy
eventsc
filesysc
fontsc
framesc
gdic
imagec
mdic
misc2c
miscc
printfwc
sizersc
stattoolc
streamsc
struct
sys
types
utilsc
windows2c
windows3c
windowsc
wxPython.wx
wxPython.wxc

 
Classes
       
DragSource
ObjectDestination
_ObjectStore
wxPyCommandEvent(wxPyCommandEventPtr)
ObjectDropEvent
ObjectCopyEvent
ObjectCutEvent
wxPyDropTarget(wxPyDropTargetPtr)
ObjectDropTarget

 
class DragSource
    Mix-in providing drag-source support
 
  Methods defined here:
BeginDrag(self, node, sourcePosition=None)
About to start dragging the node
GetDragFormat(self, node)
Return the string identifying the drag format

 
class ObjectCopyEvent(ObjectDropEvent)
    
Method resolution order:
ObjectCopyEvent
ObjectDropEvent
wxPyCommandEvent
wxPyCommandEventPtr
wxCommandEventPtr
wxEventPtr
wxObjectPtr

Data and other attributes defined here:
dropType = 2
eventType = 10239

Methods inherited from ObjectDropEvent:
Clone(self)
__init__(self, windowID, object, sourceWindow, sourcePosition=None, destinationPosition=None, destinationWindow=None)

Methods inherited from wxPyCommandEventPtr:
GetSelf(self, *_args, **_kwargs)
SetSelf(self, *_args, **_kwargs)
__del__(self, delfunc=<built-in function delete_wxPyCommandEvent>)
__repr__(self)

Methods inherited from wxCommandEventPtr:
Checked(self, *_args, **_kwargs)
GetClientData(self, *_args, **_kwargs)
GetExtraLong(self, *_args, **_kwargs)
GetInt(self, *_args, **_kwargs)
GetSelection(self, *_args, **_kwargs)
GetString(self, *_args, **_kwargs)
IsChecked(self, *_args, **_kwargs)
IsSelection(self, *_args, **_kwargs)
SetExtraLong(self, *_args, **_kwargs)
SetInt(self, *_args, **_kwargs)
SetString(self, *_args, **_kwargs)

Methods inherited from wxEventPtr:
GetEventObject(self, *_args, **_kwargs)
GetEventType(self, *_args, **_kwargs)
GetId(self, *_args, **_kwargs)
GetSkipped(self, *_args, **_kwargs)
GetTimestamp(self, *_args, **_kwargs)
SetEventObject(self, *_args, **_kwargs)
SetEventType(self, *_args, **_kwargs)
SetId(self, *_args, **_kwargs)
SetTimestamp(self, *_args, **_kwargs)
Skip(self, *_args, **_kwargs)

Methods inherited from wxObjectPtr:
Destroy(self, *_args, **_kwargs)
GetClassName(self, *_args, **_kwargs)

 
class ObjectCutEvent(ObjectDropEvent)
    
Method resolution order:
ObjectCutEvent
ObjectDropEvent
wxPyCommandEvent
wxPyCommandEventPtr
wxCommandEventPtr
wxEventPtr
wxObjectPtr

Data and other attributes defined here:
dropType = 3
eventType = 10238

Methods inherited from ObjectDropEvent:
Clone(self)
__init__(self, windowID, object, sourceWindow, sourcePosition=None, destinationPosition=None, destinationWindow=None)

Methods inherited from wxPyCommandEventPtr:
GetSelf(self, *_args, **_kwargs)
SetSelf(self, *_args, **_kwargs)
__del__(self, delfunc=<built-in function delete_wxPyCommandEvent>)
__repr__(self)

Methods inherited from wxCommandEventPtr:
Checked(self, *_args, **_kwargs)
GetClientData(self, *_args, **_kwargs)
GetExtraLong(self, *_args, **_kwargs)
GetInt(self, *_args, **_kwargs)
GetSelection(self, *_args, **_kwargs)
GetString(self, *_args, **_kwargs)
IsChecked(self, *_args, **_kwargs)
IsSelection(self, *_args, **_kwargs)
SetExtraLong(self, *_args, **_kwargs)
SetInt(self, *_args, **_kwargs)
SetString(self, *_args, **_kwargs)

Methods inherited from wxEventPtr:
GetEventObject(self, *_args, **_kwargs)
GetEventType(self, *_args, **_kwargs)
GetId(self, *_args, **_kwargs)
GetSkipped(self, *_args, **_kwargs)
GetTimestamp(self, *_args, **_kwargs)
SetEventObject(self, *_args, **_kwargs)
SetEventType(self, *_args, **_kwargs)
SetId(self, *_args, **_kwargs)
SetTimestamp(self, *_args, **_kwargs)
Skip(self, *_args, **_kwargs)

Methods inherited from wxObjectPtr:
Destroy(self, *_args, **_kwargs)
GetClassName(self, *_args, **_kwargs)

 
class ObjectDestination
    Mix-in class for destinations, call SetupDrop to get the ObjectDropEvent
 
  Methods defined here:
ConfigureDropEvent(self, event)
Perform any extra configuration of the drop event required by this class
GetDragFormat(self, node=None)
Return the string identifying the drag format
SetupDrop(self)

 
class ObjectDropEvent(wxPyCommandEvent)
    
Method resolution order:
ObjectDropEvent
wxPyCommandEvent
wxPyCommandEventPtr
wxCommandEventPtr
wxEventPtr
wxObjectPtr

Methods defined here:
Clone(self)
__init__(self, windowID, object, sourceWindow, sourcePosition=None, destinationPosition=None, destinationWindow=None)

Data and other attributes defined here:
dropType = 3
eventType = 10237

Methods inherited from wxPyCommandEventPtr:
GetSelf(self, *_args, **_kwargs)
SetSelf(self, *_args, **_kwargs)
__del__(self, delfunc=<built-in function delete_wxPyCommandEvent>)
__repr__(self)

Methods inherited from wxCommandEventPtr:
Checked(self, *_args, **_kwargs)
GetClientData(self, *_args, **_kwargs)
GetExtraLong(self, *_args, **_kwargs)
GetInt(self, *_args, **_kwargs)
GetSelection(self, *_args, **_kwargs)
GetString(self, *_args, **_kwargs)
IsChecked(self, *_args, **_kwargs)
IsSelection(self, *_args, **_kwargs)
SetExtraLong(self, *_args, **_kwargs)
SetInt(self, *_args, **_kwargs)
SetString(self, *_args, **_kwargs)

Methods inherited from wxEventPtr:
GetEventObject(self, *_args, **_kwargs)
GetEventType(self, *_args, **_kwargs)
GetId(self, *_args, **_kwargs)
GetSkipped(self, *_args, **_kwargs)
GetTimestamp(self, *_args, **_kwargs)
SetEventObject(self, *_args, **_kwargs)
SetEventType(self, *_args, **_kwargs)
SetId(self, *_args, **_kwargs)
SetTimestamp(self, *_args, **_kwargs)
Skip(self, *_args, **_kwargs)

Methods inherited from wxObjectPtr:
Destroy(self, *_args, **_kwargs)
GetClassName(self, *_args, **_kwargs)

 
class ObjectDropTarget(wxPyDropTarget)
    Drop target for handling "live" object drops
To use:
        call theWindow.SetDropTarget( ObjectDropTarget(theWindow, formatName))
        where formatName is the format
 
 
Method resolution order:
ObjectDropTarget
wxPyDropTarget
wxPyDropTargetPtr
wxDropTargetPtr

Methods defined here:
OnData(self, x, y, default)
OnDrop(self, x, y)
OnEnter(self, x, y, default)
__init__(self, client, formatName)

Methods inherited from wxPyDropTargetPtr:
GetData(self, *_args, **_kwargs)
GetDataObject(self, *_args, **_kwargs)
SetDataObject(self, *_args, **_kwargs)
__del__(self, delfunc=<built-in function delete_wxPyDropTarget>)
__repr__(self)
base_OnDragOver(self, *_args, **_kwargs)
base_OnDrop(self, *_args, **_kwargs)
base_OnEnter(self, *_args, **_kwargs)
base_OnLeave(self, *_args, **_kwargs)

 
class _ObjectStore
    Keeps objects live while transfered through drag and drop
 
  Methods defined here:
remove(self, node, id=<built-in function id>)
store(self, node)
unstore(self, key)

Data and other attributes defined here:
liveEvents = {}

 
Functions
       
EVT_OBJECTCOPY(window, function)
Handle the dropping of live objects on the window
EVT_OBJECTCUT(window, function)
Handle the dropping of live objects on the window
EVT_OBJECTDROP(window, function)
Handle the dropping of live objects on the window

 
Data
        DEFAULTDATAFORMAT = 'LivePythonObject'
OBJECTCOPY = 10239
OBJECTCUT = 10238
OBJECTDROP = 10237
Store = <wxoo.dnd._ObjectStore instance at 0x015E1DA0>