X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0fba44b4103530bd7904c4b5720b7568b753daec..8e1a5bf979fcdf82238b20cda1209a4f67f394c0:/src/os2/dnd.cpp diff --git a/src/os2/dnd.cpp b/src/os2/dnd.cpp index 1dddfa4b66..0f61318b77 100644 --- a/src/os2/dnd.cpp +++ b/src/os2/dnd.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dnd.cpp +// Name: src/os2/dnd.cpp // Purpose: wxDropTarget, wxDropSource, wxDataObject implementation // Author: David Webster // Modified by: @@ -9,21 +9,24 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "dnd.h" +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#if wxUSE_DRAG_AND_DROP + +#include "wx/dnd.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/window.h" #endif -#include "wx/window.h" -#include "wx/app.h" #include "wx/gdicmn.h" -#include "wx/dnd.h" #define INCL_PM #define INCL_DOS #include -#if wxUSE_DRAG_AND_DROP - // ---------------------------------------------------------------------------- // global // ---------------------------------------------------------------------------- @@ -120,7 +123,7 @@ bool CIDropTarget::DragLeave() // Release the held object // Free(); - return TRUE; + return true; } // end of CIDropTarget::DragLeave MRESULT CIDropTarget::DragOver () @@ -250,7 +253,7 @@ MRESULT CIDropTarget::Drop () ,m_pDragInfo->yDrop )) { - wxDragResult eRc = wxDragNone;; + wxDragResult eRc = wxDragNone; // // And now it has the data @@ -260,7 +263,7 @@ MRESULT CIDropTarget::Drop () ,eRc ); } - //else: OnDrop() returned FALSE, no need to copy data + //else: OnDrop() returned false, no need to copy data // // Release the held object @@ -292,12 +295,12 @@ bool wxDropTarget::GetData () if (vFormat == wxDF_INVALID) { - return FALSE; + return false; } // // Under OS/2 we already have the data via the attached DRAGITEM's // - return TRUE; + return true; } // end of wxDropTarget::GetData wxDataFormat wxDropTarget::GetSupportedFormat ( @@ -313,7 +316,7 @@ wxDataFormat wxDropTarget::GetSupportedFormat ( ULONG n; wxString sMechanism; wxString sFormat; - bool bValid = FALSE; + bool bValid = false; pFormats = ulFormats == 1 ? &vFormat : new wxDataFormat[ulFormats]; m_dataObject->GetAllFormats( pFormats @@ -387,7 +390,7 @@ wxDataFormat wxDropTarget::GetSupportedFormat ( pDragItem = ::DrgQueryDragitemPtr(pDataSource, i); if (::DrgVerifyRMF(pDragItem, (PSZ)sMechanism.c_str(), (PSZ)sFormat.c_str())) { - bValid = TRUE; + bValid = true; break; } } @@ -434,24 +437,19 @@ bool wxDropTarget::OnDrop ( , wxCoord WXUNUSED(y) ) { - return TRUE; + return true; } // end of wxDropTarget::OnDrop //------------------------------------------------------------------------- // wxDropSource //------------------------------------------------------------------------- -wxDropSource::wxDropSource ( - wxWindow* pWin -) +wxDropSource::wxDropSource ( wxWindow* WXUNUSED(pWin) ) { Init(); } // end of wxDropSource::wxDropSource -wxDropSource::wxDropSource ( - wxDataObject& rData -, wxWindow* pWin -) +wxDropSource::wxDropSource ( wxDataObject& rData, wxWindow* WXUNUSED(pWin) ) { Init(); SetData(rData); @@ -525,11 +523,11 @@ bool wxDropSource::GiveFeedback ( case wxDragError: break; } - return TRUE; + return true; } else { - return FALSE; + return false; } } // end of GuiAdvDnd_CDropSource::GiveFeedback @@ -549,13 +547,13 @@ void wxDropSource::Init () m_vDragImage.cxOffset = 0; m_vDragImage.cyOffset = 0; - HSTR hStrType = ::DrgAddStrHandle(DRT_UNKNOWN); - HSTR hStrRMF; - HSTR hStrContainer; - wxChar zFormats[128]; - wxChar zContainer[128]; - USHORT uSize = GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat()) + 1; - wxChar* pzBuffer = new wxChar[uSize]; + HSTR hStrType = ::DrgAddStrHandle(DRT_UNKNOWN); + HSTR hStrRMF; + HSTR hStrContainer; + wxChar zFormats[128]; + wxChar zContainer[128]; + USHORT uSize = (USHORT)(GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat()) + 1); + wxChar* pzBuffer = new wxChar[uSize]; memset(pzBuffer, '\0', GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat())); pzBuffer[GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat())] = '\0';