* Change "def" to defResult as def is a reserved word in Python
* Correct some methods that were marked pure virtual but which aren't. * etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -16,47 +16,6 @@ enum
|
|||||||
wxDrag_DefaultMove = 3 ///< Allow moving and make it default operation.
|
wxDrag_DefaultMove = 3 ///< Allow moving and make it default operation.
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
@class wxTextDropTarget
|
|
||||||
|
|
||||||
A predefined drop target for dealing with text data.
|
|
||||||
|
|
||||||
@library{wxcore}
|
|
||||||
@category{dnd}
|
|
||||||
|
|
||||||
@see @ref overview_dnd, wxDropSource, wxDropTarget, wxFileDropTarget
|
|
||||||
*/
|
|
||||||
class wxTextDropTarget : public wxDropTarget
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
Constructor.
|
|
||||||
*/
|
|
||||||
wxTextDropTarget();
|
|
||||||
|
|
||||||
/**
|
|
||||||
See wxDropTarget::OnDrop(). This function is implemented appropriately
|
|
||||||
for text, and calls OnDropText().
|
|
||||||
*/
|
|
||||||
virtual bool OnDrop(wxCoord x, wxCoord y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Override this function to receive dropped text.
|
|
||||||
|
|
||||||
@param x
|
|
||||||
The x coordinate of the mouse.
|
|
||||||
@param y
|
|
||||||
The y coordinate of the mouse.
|
|
||||||
@param data
|
|
||||||
The data being dropped: a wxString.
|
|
||||||
|
|
||||||
Return @true to accept the data, or @false to veto the operation.
|
|
||||||
*/
|
|
||||||
virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Result returned from a wxDropSource::DoDragDrop() call.
|
Result returned from a wxDropSource::DoDragDrop() call.
|
||||||
*/
|
*/
|
||||||
@@ -70,6 +29,8 @@ enum wxDragResult
|
|||||||
wxDragCancel ///< The operation was cancelled by user (not an error).
|
wxDragCancel ///< The operation was cancelled by user (not an error).
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxDropTarget
|
@class wxDropTarget
|
||||||
|
|
||||||
@@ -109,23 +70,23 @@ public:
|
|||||||
associated with this drop target, calling its wxDataObject::SetData()
|
associated with this drop target, calling its wxDataObject::SetData()
|
||||||
method.
|
method.
|
||||||
*/
|
*/
|
||||||
virtual bool GetData() = 0;
|
virtual bool GetData();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Called after OnDrop() returns @true. By default this will usually
|
Called after OnDrop() returns @true. By default this will usually
|
||||||
GetData() and will return the suggested default value @a def.
|
GetData() and will return the suggested default value @a defResult.
|
||||||
*/
|
*/
|
||||||
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) = 0;
|
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult defResult) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Called when the mouse is being dragged over the drop target. By
|
Called when the mouse is being dragged over the drop target. By
|
||||||
default, this calls functions return the suggested return value @a def.
|
default, this calls functions return the suggested return value @a defResult.
|
||||||
|
|
||||||
@param x
|
@param x
|
||||||
The x coordinate of the mouse.
|
The x coordinate of the mouse.
|
||||||
@param y
|
@param y
|
||||||
The y coordinate of the mouse.
|
The y coordinate of the mouse.
|
||||||
@param def
|
@param defResult
|
||||||
Suggested value for return value. Determined by SHIFT or CONTROL
|
Suggested value for return value. Determined by SHIFT or CONTROL
|
||||||
key states.
|
key states.
|
||||||
|
|
||||||
@@ -133,7 +94,7 @@ public:
|
|||||||
feedback from the side of the drop source, typically in form
|
feedback from the side of the drop source, typically in form
|
||||||
of changing the icon.
|
of changing the icon.
|
||||||
*/
|
*/
|
||||||
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult defResult);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Called when the user drops a data object on the target. Return @false
|
Called when the user drops a data object on the target. Return @false
|
||||||
@@ -146,7 +107,7 @@ public:
|
|||||||
|
|
||||||
@return @true to accept the data, or @false to veto the operation.
|
@return @true to accept the data, or @false to veto the operation.
|
||||||
*/
|
*/
|
||||||
virtual bool OnDrop(wxCoord x, wxCoord y) = 0;
|
virtual bool OnDrop(wxCoord x, wxCoord y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Called when the mouse enters the drop target. By default, this calls
|
Called when the mouse enters the drop target. By default, this calls
|
||||||
@@ -156,7 +117,7 @@ public:
|
|||||||
The x coordinate of the mouse.
|
The x coordinate of the mouse.
|
||||||
@param y
|
@param y
|
||||||
The y coordinate of the mouse.
|
The y coordinate of the mouse.
|
||||||
@param def
|
@param defResult
|
||||||
Suggested default for return value. Determined by SHIFT or CONTROL
|
Suggested default for return value. Determined by SHIFT or CONTROL
|
||||||
key states.
|
key states.
|
||||||
|
|
||||||
@@ -164,7 +125,7 @@ public:
|
|||||||
feedback from the side of the drop source, typically in form
|
feedback from the side of the drop source, typically in form
|
||||||
of changing the icon.
|
of changing the icon.
|
||||||
*/
|
*/
|
||||||
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def);
|
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult defResult);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Called when the mouse leaves the drop target.
|
Called when the mouse leaves the drop target.
|
||||||
@@ -176,6 +137,22 @@ public:
|
|||||||
any previously associated data object.
|
any previously associated data object.
|
||||||
*/
|
*/
|
||||||
void SetDataObject(wxDataObject* data);
|
void SetDataObject(wxDataObject* data);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the default action for drag and drop. Use wxDragMove or
|
||||||
|
wxDragCopy to set deafult action to move or copy and use wxDragNone
|
||||||
|
(default) to set default action specified by initialization of draging
|
||||||
|
(see wxDropSource::DoDragDrop())
|
||||||
|
*/
|
||||||
|
void SetDefaultAction(wxDragResult action);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns default action for drag and drop or wxDragNone if this not
|
||||||
|
specified.
|
||||||
|
*/
|
||||||
|
wxDragResult GetDefaultAction();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -346,6 +323,46 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@class wxTextDropTarget
|
||||||
|
|
||||||
|
A predefined drop target for dealing with text data.
|
||||||
|
|
||||||
|
@library{wxcore}
|
||||||
|
@category{dnd}
|
||||||
|
|
||||||
|
@see @ref overview_dnd, wxDropSource, wxDropTarget, wxFileDropTarget
|
||||||
|
*/
|
||||||
|
class wxTextDropTarget : public wxDropTarget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
Constructor.
|
||||||
|
*/
|
||||||
|
wxTextDropTarget();
|
||||||
|
|
||||||
|
/**
|
||||||
|
See wxDropTarget::OnDrop(). This function is implemented appropriately
|
||||||
|
for text, and calls OnDropText().
|
||||||
|
*/
|
||||||
|
virtual bool OnDrop(wxCoord x, wxCoord y);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Override this function to receive dropped text.
|
||||||
|
|
||||||
|
@param x
|
||||||
|
The x coordinate of the mouse.
|
||||||
|
@param y
|
||||||
|
The y coordinate of the mouse.
|
||||||
|
@param data
|
||||||
|
The data being dropped: a wxString.
|
||||||
|
|
||||||
|
Return @true to accept the data, or @false to veto the operation.
|
||||||
|
*/
|
||||||
|
virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxFileDropTarget
|
@class wxFileDropTarget
|
||||||
|
|
||||||
@@ -410,5 +427,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
#define wxDROP_ICON(name)
|
#define wxDROP_ICON(name)
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns true if res indicates that something was done during a DnD operation,
|
||||||
|
i.e. is neither error nor none nor cancel.
|
||||||
|
*/
|
||||||
|
bool wxIsDragResultOk(wxDragResult res);
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user