Correct example of using wxDataObjectComposite in the docs
Don't call base class pure virtual method, but do call GetData() before using the data object. Also fix a typo in a variable name.
This commit is contained in:
@@ -427,13 +427,13 @@ public:
|
||||
wxDragResult MyDropTarget::OnData(wxCoord x, wxCoord y,
|
||||
wxDragResult defaultDragResult)
|
||||
{
|
||||
wxDragResult dragResult = wxDropTarget::OnData(x, y, defaultDragResult);
|
||||
if ( dragResult == defaultDragResult )
|
||||
{
|
||||
if ( !GetData() )
|
||||
return wxDragNone;
|
||||
|
||||
wxDataObjectComposite *
|
||||
dataobjComp = static_cast<wxDataObjectComposite *>(GetDataObject());
|
||||
|
||||
wxDataFormat format = dataObjects->GetReceivedFormat();
|
||||
wxDataFormat format = dataobjComp->GetReceivedFormat();
|
||||
wxDataObject *dataobj = dataobjComp->GetObject(format);
|
||||
switch ( format.GetType() )
|
||||
{
|
||||
@@ -458,9 +458,8 @@ public:
|
||||
default:
|
||||
wxFAIL_MSG( "unexpected data object format" );
|
||||
}
|
||||
}
|
||||
|
||||
return dragResult;
|
||||
return defaultDragResult;
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
Reference in New Issue
Block a user