1. wxPostEvent added and documented
2. Made it possible to have wxDataObjects which support multiple formats painlessly 3. Extensively modified dnd sample to show a "real life" wxDataObject git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -142,7 +142,8 @@ bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat)
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
static bool wxSetClipboardData(wxDataObject *data)
|
||||
{
|
||||
size_t size = data->GetDataSize();
|
||||
wxDataFormat format = data->GetPreferredFormat();
|
||||
size_t size = data->GetDataSize(format);
|
||||
HANDLE hGlobal = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, size);
|
||||
if ( !hGlobal )
|
||||
{
|
||||
@@ -154,11 +155,10 @@ static bool wxSetClipboardData(wxDataObject *data)
|
||||
|
||||
LPVOID lpGlobalMemory = ::GlobalLock(hGlobal);
|
||||
|
||||
data->GetDataHere(lpGlobalMemory);
|
||||
data->GetDataHere(format, lpGlobalMemory);
|
||||
|
||||
GlobalUnlock(hGlobal);
|
||||
|
||||
wxDataFormat format = data->GetPreferredFormat();
|
||||
if ( !::SetClipboardData(format, hGlobal) )
|
||||
{
|
||||
wxLogSysError(_("Failed to set clipboard data in format %s"),
|
||||
|
Reference in New Issue
Block a user