X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f43084de973e7a1040b4e03f7fc0046897fb1255..03c4c72be65175f847770e183d3333862878bc67:/src/mac/carbon/dnd.cpp diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp index a96d6270da..9ffa32aafa 100644 --- a/src/mac/carbon/dnd.cpp +++ b/src/mac/carbon/dnd.cpp @@ -206,7 +206,7 @@ bool wxDropTarget::GetData() if( theType == 'TEXT' ) { theData[dataSize]=0 ; - wxString convert = wxMacMakeStringFromCString( theData ) ; + wxString convert( theData , wxConvLocal ) ; m_dataObject->SetData( format, convert.Length() * sizeof(wxChar), (const wxChar*) convert ); } else if ( theType == kDragFlavorTypeHFS ) @@ -302,7 +302,7 @@ wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags)) dataSize-- ; dataPtr[ dataSize ] = 0 ; wxString st( (wxChar*) dataPtr ) ; - wxCharBuffer buf = wxMacStringToCString( st ) ; + wxCharBuffer buf = st.mb_str( wxConvLocal) ; AddDragItemFlavor(theDrag, theItem, type , buf.data(), strlen(buf), 0); } else if (type == kDragFlavorTypeHFS ) @@ -379,7 +379,7 @@ wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags)) gTrackingGlobals.m_currentSource = NULL ; KeyMap keymap; - GetKeys((BigEndianLong*)&keymap); + GetKeys(keymap); bool optionDown = keymap[1] & 4; wxDragResult dndresult = optionDown ? wxDragCopy : wxDragMove; return dndresult; @@ -435,7 +435,7 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind wxTopLevelWindowMac* toplevel = wxFindWinFromMacWindow( theWindow ) ; KeyMap keymap; - GetKeys((BigEndianLong*)&keymap); + GetKeys(keymap); bool optionDown = keymap[1] & 4; wxDragResult result = optionDown ? wxDragCopy : wxDragMove; @@ -463,7 +463,7 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind { wxPoint point(localMouse.h , localMouse.v) ; wxWindow *win = NULL ; - toplevel->MacGetWindowFromPointSub( point , &win ) ; + // TODO toplevel->MacGetWindowFromPointSub( point , &win ) ; int localx , localy ; localx = localMouse.h ; localy = localMouse.v ; @@ -527,27 +527,33 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind { if ( trackingGlobals->m_currentSource->MacInstallDefaultCursor( result ) == FALSE ) { - switch( result ) - { - case wxDragCopy : - { - wxCursor cursor(wxCURSOR_COPY_ARROW) ; - cursor.MacInstall() ; - } - break ; - case wxDragMove : + switch( result ) { - wxCursor cursor(wxCURSOR_ARROW) ; - cursor.MacInstall() ; - } - break ; - case wxDragNone : - { - wxCursor cursor(wxCURSOR_NO_ENTRY) ; - cursor.MacInstall() ; + case wxDragCopy : + { + wxCursor cursor(wxCURSOR_COPY_ARROW) ; + cursor.MacInstall() ; + } + break ; + case wxDragMove : + { + wxCursor cursor(wxCURSOR_ARROW) ; + cursor.MacInstall() ; + } + break ; + case wxDragNone : + { + wxCursor cursor(wxCURSOR_NO_ENTRY) ; + cursor.MacInstall() ; + } + break ; + + case wxDragError: + case wxDragLink: + case wxDragCancel: + // put these here to make gcc happy + ; } - break ; - } } } @@ -590,7 +596,7 @@ pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, if ( trackingGlobals->m_currentTarget->OnDrop( localx , localy ) ) { KeyMap keymap; - GetKeys((BigEndianLong*)&keymap); + GetKeys(keymap); bool optionDown = keymap[1] & 4; wxDragResult result = optionDown ? wxDragCopy : wxDragMove; trackingGlobals->m_currentTarget->OnData( localx , localy , result ) ;