#endif
// For compilers that support precompilation, includes "wx.h".
-#define IN_WX_MAIN_CPP
#include "wx/wxprec.h"
#if defined(__BORLANDC__)
#include <wx/setup.h>
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
#include <wx/log.h>
{
m_cRef = 0;
m_pTarget = pTarget;
- m_cfFormat = 0;
+ m_cfFormat = (wxDataFormat) 0;
m_pIDataObject = NULL;
}
IMPLEMENT_IUNKNOWN_METHODS(wxIDropTarget)
-#if 0
- STDMETHODIMP wxIDropTarget::QueryInterface(REFIID riid, void **ppv)
- {
-// wxLogQueryInterface(wxIDropTarget, riid);
-
- if ( IsIidFromList(riid, ms_aIids, WXSIZEOF(ms_aIids)) ) {
- *ppv = this;
- AddRef();
-
- return S_OK;
- }
- else {
- *ppv = NULL;
-
- return (HRESULT) E_NOINTERFACE;
- }
- }
-
- STDMETHODIMP_(ULONG) wxIDropTarget::AddRef()
- {
- wxLogAddRef(wxIDropTarget, m_cRef);
-
- return ++m_cRef;
- }
-
- STDMETHODIMP_(ULONG) wxIDropTarget::Release()
- {
- wxLogRelease(wxIDropTarget, m_cRef);
-
- if ( --m_cRef == 0 ) {
- delete this;
- return 0;
- }
- else
- return m_cRef;
- }
-#endif
-
// Name : wxIDropTarget::DragEnter
// Purpose : Called when the mouse enters the window (dragging something)
// Returns : S_OK
{
HRESULT hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE);
if ( FAILED(hr) ) {
- // wxLogApiError("CoLockObjectExternal", hr);
+ wxLogApiError("CoLockObjectExternal", hr);
return FALSE;
}
if ( FAILED(hr) ) {
::CoLockObjectExternal(m_pIDropTarget, FALSE, FALSE);
- // wxLogApiError("RegisterDragDrop", hr);
+ wxLogApiError("RegisterDragDrop", hr);
return FALSE;
}
{
HRESULT hr = ::RevokeDragDrop((HWND) hwnd);
- if ( FAILED(hr) )
- {
- // wxLogApiError("RevokeDragDrop", hr);
+ if ( FAILED(hr) ) {
+ wxLogApiError("RevokeDragDrop", hr);
}
::CoLockObjectExternal(m_pIDropTarget, FALSE, TRUE);
// means) for file drag and drop
if ( pIDataSource->QueryGetData(&s_fmtMemory) == S_OK ) {
// remember this format: we'll later ask for data in it
- m_pIDropTarget->SetSupportedFormat(s_fmtMemory.cfFormat);
+ m_pIDropTarget->SetSupportedFormat((wxDataFormat) s_fmtMemory.cfFormat);
return TRUE;
}
}
wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
{
- return CF_TEXT;
+ return wxDF_TEXT;
}
// ============================================================================
HDROP hdrop = (HDROP)pData; // @@ it works, but I'm not sure about it
// get number of files (magic value -1)
- UINT nFiles = ::DragQueryFile(hdrop, -1, NULL, 0);
+ UINT nFiles = ::DragQueryFile(hdrop, (unsigned)-1, NULL, 0u);
// for each file get the length, allocate memory and then get the name
char **aszFiles = new char *[nFiles];
wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
{
#ifdef __WIN32__
- return CF_HDROP;
+ return wxDF_FILENAME;
#else
// TODO: how to implement this in WIN16?
- return CF_TEXT;
+ return wxDF_TEXT;
#endif
}
#endif
- // USE_DRAG_AND_DROP
+ // wxUSE_DRAG_AND_DROP