GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing docs.wxpython.org — wx.DragImage — wxPython 4.3.2 Docs
|
Default constructor. |
|
Start dragging the image, in a window or full screen. |
|
Call this when the drag has finished. |
|
Hides the image. |
|
Call this to move the image to a new position. |
|
Shows the image. |
Class API¶Possible constructors:
DragImage() -> None DragImage(image, cursor=NullCursor) -> None DragImage(image, cursor=NullCursor) -> None DragImage(text, cursor=NullCursor) -> None DragImage(treeCtrl, id) -> None DragImage(listCtrl, id) -> None
This class is used when you wish to drag an object on the screen, and a simple cursor is not enough.
__init__ (self)
Default constructor.
None
__init__ (self, image, cursor=NullCursor)
Constructs a drag image from a bitmap and optional cursor.
None
__init__ (self, image, cursor=NullCursor)
Constructs a drag image from an icon and optional cursor.
None
__init__ (self, text, cursor=NullCursor)
Constructs a drag image from a text string and optional cursor.
text (string) – Text used to construct a drag image.
cursor (wx.Cursor) – Optional cursor to combine with the image.
None
__init__ (self, treeCtrl, id)
Constructs a drag image from the text in the given tree control item, and optional cursor.
treeCtrl (wx.TreeCtrl) – Tree control for constructing a tree drag image.
id (wx.TreeItemId) – Tree control item id.
None
__init__ (self, listCtrl, id)
Constructs a drag image from the text in the given list control item, and optional cursor.
listCtrl (wx.ListCtrl) – List control for constructing a list drag image.
id (long) – List control item id.
None
BeginDrag (self, hotspot, window, fullScreen=False, rect=None)
Start dragging the image, in a window or full screen.
You need to then call Show and Move to show the image on the screen. Call EndDrag when the drag has finished.
Note that this call automatically calls CaptureMouse().
hotspot (wx.Point) – The location of the drag position relative to the upper-left corner of the image.
window (wx.Window) – The window that captures the mouse, and within which the dragging is limited unless fullScreen is True.
fullScreen (bool) – If True, specifies that the drag will be visible over the full screen, or over as much of the screen as is specified by rect. Note that the mouse will still be captured in window.
rect (wx.Rect) – If non-null, specifies the rectangle (in screen coordinates) that bounds the dragging operation. Specifying this can make the operation more efficient by cutting down on the area under consideration, and it can also make a visual difference since the drag is clipped to this area.
bool
BeginDrag (self, hotspot, window, boundingWindow)
Start dragging the image, using the first window to capture the mouse and the second to specify the bounding area.
This form is equivalent to using the first form, but more convenient than working out the bounding rectangle explicitly.
You need to then call Show and Move to show the image on the screen. Call EndDrag when the drag has finished.
Note that this call automatically calls CaptureMouse().
bool
Call this when the drag has finished.
bool
Note
This function automatically releases mouse capture.
Hides the image.
You may wish to call this before updating the window contents (perhaps highlighting an item). Then call Move and Show .
bool
Call this to move the image to a new position.
The image will only be shown if Show has been called previously (for example at the start of the drag).
Shows the image.
Call this at least once when dragging.
bool