wxTextDropTarget Class Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxTextDropTarget Class Referenceabstract
Class List by Category » Clipboard and Drag & Drop

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/wx/dnd.h>`

Inheritance diagram for wxTextDropTarget:
[legend]

## Detailed Description

A predefined drop target for dealing with text data.

##

Library: wxCore
Category: Clipboard and Drag & Drop

See also
  Drag and Drop Overview, wxDropSource, wxDropTarget, wxFileDropTarget

## Public Member Functions
| wxTextDropTarget ()
| Constructor.
virtual bool | OnDrop (wxCoord x, wxCoord y)
| See wxDropTarget::OnDrop().
virtual bool | OnDropText (wxCoord x, wxCoord y, const wxString &data)=0
| Override this function to receive dropped text.
Public Member Functions inherited from wxDropTarget
| wxDropTarget (wxDataObject *data=NULL)
| Constructor.
virtual | ~wxDropTarget ()
| Destructor.
virtual bool | GetData ()
| This method may only be called from within OnData().
virtual wxDragResult | OnData (wxCoord x, wxCoord y, wxDragResult defResult)=0
| Called after OnDrop() returns true.
virtual wxDragResult | OnDragOver (wxCoord x, wxCoord y, wxDragResult defResult)
| Called when the mouse is being dragged over the drop target.
virtual wxDragResult | OnEnter (wxCoord x, wxCoord y, wxDragResult defResult)
| Called when the mouse enters the drop target.
virtual void | OnLeave ()
| Called when the mouse leaves the drop target.
wxDataObject * | GetDataObject () const
| Returns the data wxDataObject associated with the drop target.
void | SetDataObject (wxDataObject *data)
| Sets the data wxDataObject associated with the drop target and deletes any previously associated data object.
void | SetDefaultAction (wxDragResult action)
| Sets the default action for drag and drop.
wxDragResult | GetDefaultAction ()
| Returns default action for drag and drop or wxDragNone if this not specified.

## Constructor & Destructor Documentation

## ◆ wxTextDropTarget()

wxTextDropTarget::wxTextDropTarget | ( |  | ) |

Constructor.

## Member Function Documentation

## ◆ OnDrop()

virtual bool wxTextDropTarget::OnDrop | ( | wxCoord | x,
|  | wxCoord | y )
| virtual

See wxDropTarget::OnDrop().

This function is implemented appropriately for text, and calls OnDropText().

Reimplemented from wxDropTarget.

## ◆ OnDropText()

virtual bool wxTextDropTarget::OnDropText | ( | wxCoord | x,
|  | wxCoord | y,
|  | const wxString & | data )
| pure virtual

Override this function to receive dropped text.

Parameters

  x | The x coordinate of the mouse.
  y | The y coordinate of the mouse.
  data | The data being dropped: a wxString.

Return true to accept the data, or false to veto the operation.