// Purpose: implementation of wxIDropSource and wxDropSource
// Author: Vadim Zeitlin
// Modified by:
// Created: 10.05.98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Purpose: implementation of wxIDropSource and wxDropSource
// Author: Vadim Zeitlin
// Modified by:
// Created: 10.05.98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if defined(__BORLANDC__)
#pragma hdrstop
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if defined(__BORLANDC__)
#pragma hdrstop
#endif
// IDropSource
STDMETHODIMP QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState);
STDMETHODIMP GiveFeedback(DWORD dwEffect);
// IDropSource
STDMETHODIMP QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState);
STDMETHODIMP GiveFeedback(DWORD dwEffect);
private:
DWORD m_grfInitKeyState; // button which started the d&d operation
wxDropSource *m_pDropSource; // pointer to C++ class we belong to
private:
DWORD m_grfInitKeyState; // button which started the d&d operation
wxDropSource *m_pDropSource; // pointer to C++ class we belong to
// Name : DoDragDrop
// Purpose : start drag and drop operation
// Returns : wxDragResult - the code of performed operation
// Name : DoDragDrop
// Purpose : start drag and drop operation
// Returns : wxDragResult - the code of performed operation
{
wxCHECK_MSG( m_data != NULL, wxDragNone, wxT("No data in wxDropSource!") );
DWORD dwEffect;
HRESULT hr = ::DoDragDrop(m_data->GetInterface(),
m_pIDropSource,
{
wxCHECK_MSG( m_data != NULL, wxDragNone, wxT("No data in wxDropSource!") );
DWORD dwEffect;
HRESULT hr = ::DoDragDrop(m_data->GetInterface(),
m_pIDropSource,
}
else if ( dwEffect & DROPEFFECT_MOVE ) {
// consistency check: normally, we shouldn't get "move" at all
}
else if ( dwEffect & DROPEFFECT_MOVE ) {
// consistency check: normally, we shouldn't get "move" at all
- // here if !bAllowMove, but in practice it does happen quite often
- if ( bAllowMove )
- return wxDragMove;
- else
- return wxDragCopy;
+ // here if we don't allow it, but in practice it does happen quite often
+ return (flags & wxDrag_AllowMove) ? wxDragMove : wxDragCopy;