1. wxDropTarget::OnData() returns wxDragResult now, not bool
2. fixed assert failure in wxMSW::wxListBox 3. wxFileHistory automatically deletes non existinf files from menu 4. wxDropTarget coordinates are client (and not screen) under MSW too 5. wxConvertBitmapToDib and vice versa seem to work! 6. client data field if filled by wxListBox and wxChoice and it's also deleted (this just wasn't done before!) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -289,3 +289,45 @@ bool wxCustomDataObject::SetData(size_t size, const void *buf)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// some common dnd related code
|
||||
// ============================================================================
|
||||
|
||||
#include "wx/dnd.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextDropTarget
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxTextDropTarget::wxTextDropTarget()
|
||||
: wxDropTarget(new wxTextDataObject)
|
||||
{
|
||||
}
|
||||
|
||||
wxDragResult wxTextDropTarget::OnData(wxCoord x, wxCoord y, wxDragResult def)
|
||||
{
|
||||
if ( !GetData() )
|
||||
return wxDragNone;
|
||||
|
||||
wxTextDataObject *dobj = (wxTextDataObject *)m_dataObject;
|
||||
return OnDropText(x, y, dobj->GetText()) ? def : wxDragNone;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFileDropTarget
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxFileDropTarget::wxFileDropTarget()
|
||||
: wxDropTarget(new wxFileDataObject)
|
||||
{
|
||||
}
|
||||
|
||||
wxDragResult wxFileDropTarget::OnData(wxCoord x, wxCoord y, wxDragResult def)
|
||||
{
|
||||
if ( !GetData() )
|
||||
return wxDragNone;
|
||||
|
||||
wxFileDataObject *dobj = (wxFileDataObject *)m_dataObject;
|
||||
return OnDropFiles(x, y, dobj->GetFilenames()) ? def : wxDragNone;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user