Bug #19139 2013-10-01 09:59

mojca

"wxIcon copycursor(...)" doesn't work with Carbon/Cocoa

The following code from src/plugins/contrib/NassiShneiderman/NassiView.cpp doesn't work on Mac (it works with wxGTK, but not with Carbon or Cocoa based wxWidgets - it fails both with wxWidgets 2.8 and 2.9):

        #if defined(__WXMSW__)
            wxCursor copycursor(dnd_copy_cur_xpm);
            wxCursor movecursor(dnd_move_cur_xpm);
            wxCursor nonecursor(dnd_none_cur_xpm);
        #else
            wxIcon copycursor(dnd_copy_cur_xpm);
            wxIcon movecursor(dnd_move_cur_xpm);
            wxIcon nonecursor(dnd_none_cur_xpm);
        #endif
        //wxDragResult result;

        wxDropSource dndSource(m_diagramwindow, copycursor, movecursor, nonecursor);

The following quick workaround solved the problem, but a better solution is needed and I'm not exactly sure how. One option would be to use
    #if defined(__WXMSW__) || defined (__WXOSX__) || ...
for the first part, but I'm not sure that this is the proper solution either.

--- src/plugins/contrib/NassiShneiderman/NassiView.cpp.orig
+++ src/plugins/contrib/NassiShneiderman/NassiView.cpp
@@ -1048,15 +1048,9 @@
 
     if ( dataptr )
     {
-        #if defined(__WXMSW__)
             wxCursor copycursor(dnd_copy_cur_xpm);
             wxCursor movecursor(dnd_move_cur_xpm);
             wxCursor nonecursor(dnd_none_cur_xpm);
-        #else
-            wxIcon copycursor(dnd_copy_cur_xpm);
-            wxIcon movecursor(dnd_move_cur_xpm);
-            wxIcon nonecursor(dnd_none_cur_xpm);
-        #endif
         //wxDragResult result;
 
         wxDropSource dndSource(m_diagramwindow, copycursor, movecursor, nonecursor);

See also http://docs.wxwidgets.org/2.9.5/overview_bitmap.html
Category
 
Group
Platform:Mac
Status
Open
Close date
 
Assigned to