]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/cursor.cpp
Avoid do-nothing virtuals in WinCE.
[wxWidgets.git] / src / os2 / cursor.cpp
index a3dddf55b8618bfa72d6058e184e5343dc995d70..24fbc16ea100bc79880c54c8d923f50b03481e51 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        cursor.cpp
+// Name:        src/os2/cursor.cpp
 // Purpose:     wxCursor class
 // Author:      David Webster
 // Modified by:
 // Purpose:     wxCursor class
 // Author:      David Webster
 // Modified by:
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#ifndef WX_PRECOMP
-#include <stdio.h>
-#include "wx/setup.h"
-#include "wx/list.h"
-#include "wx/utils.h"
-#include "wx/app.h"
 #include "wx/cursor.h"
 #include "wx/cursor.h"
-#include "wx/icon.h"
+
+#ifndef WX_PRECOMP
+    #include <stdio.h>
+    #include "wx/list.h"
+    #include "wx/utils.h"
+    #include "wx/app.h"
+    #include "wx/icon.h"
+    #include "wx/image.h"
 #endif
 
 #include "wx/os2/private.h"
 #endif
 
 #include "wx/os2/private.h"
-#include "wx/image.h"
+#include "wx/os2/wxrsc.h"
 
 #include "assert.h"
 
 
 #include "assert.h"
 
@@ -34,7 +35,7 @@ wxCursorRefData::wxCursorRefData(void)
   m_nWidth = 32;
   m_nHeight = 32;
   m_hCursor = 0 ;
   m_nWidth = 32;
   m_nHeight = 32;
   m_hCursor = 0 ;
-  m_bDestroyCursor = FALSE;
+  m_bDestroyCursor = false;
 }
 
 void wxCursorRefData::Free()
 }
 
 void wxCursorRefData::Free()
@@ -52,39 +53,35 @@ wxCursor::wxCursor(void)
 {
 }
 
 {
 }
 
-wxCursor::wxCursor(
-  const char                        WXUNUSED(bits)[]
-, int                               WXUNUSED(width)
-, int                               WXUNUSED(height)
-, int                               WXUNUSED(hotSpotX)
-, int                               WXUNUSED(hotSpotY)
-, const char                        WXUNUSED(maskBits)[]
-)
+wxCursor::wxCursor(const char WXUNUSED(bits)[],
+                   int WXUNUSED(width),
+                   int WXUNUSED(height),
+                   int WXUNUSED(hotSpotX),
+                   int WXUNUSED(hotSpotY),
+                   const char WXUNUSED(maskBits)[])
 {
 }
 
 {
 }
 
-wxCursor::wxCursor(
-  const wxImage&                    rImage
-)
+wxCursor::wxCursor(const wxImage& rImage)
 {
 {
-    wxImage                         vImage32 = rImage.Scale(32,32);
-    int                             nWidth   = vImage32.GetWidth();
-    int                             nHeight  = vImage32.GetHeight();
+    wxImage  vImage32 = rImage.Scale(32,32);
+    int      nWidth   = vImage32.GetWidth();
+    int      nHeight  = vImage32.GetHeight();
 
     //
     // Need a bitmap handle somehow
     //
 
     //
     // Need a bitmap handle somehow
     //
-    HBITMAP                      hBitmap = wxBitmap(vImage32).GetHBITMAP();
-    int                          nHotSpotX = vImage32.GetOptionInt(wxCUR_HOTSPOT_X);
-    int                          nHotSpotY = vImage32.GetOptionInt(wxCUR_HOTSPOT_Y);
+    HBITMAP  hBitmap = wxBitmap(vImage32).GetHBITMAP();
+    int      nHotSpotX = vImage32.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X);
+    int      nHotSpotY = vImage32.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y);
 
     if (nHotSpotX < 0 || nHotSpotX >= nWidth)
 
     if (nHotSpotX < 0 || nHotSpotX >= nWidth)
-            nHotSpotX = 0;
+        nHotSpotX = 0;
     if (nHotSpotY < 0 || nHotSpotY >= nHeight)
     if (nHotSpotY < 0 || nHotSpotY >= nHeight)
-            nHotSpotY = 0;
+        nHotSpotY = 0;
 
 
 
 
-    wxCursorRefData*                pRefData = new wxCursorRefData;
+    wxCursorRefData* pRefData = new wxCursorRefData;
 
     m_refData = pRefData;
     pRefData->m_hCursor = (WXHCURSOR) ::WinCreatePointer( HWND_DESKTOP
 
     m_refData = pRefData;
     pRefData->m_hCursor = (WXHCURSOR) ::WinCreatePointer( HWND_DESKTOP
@@ -96,18 +93,16 @@ wxCursor::wxCursor(
 
 } // end of wxCursor::wxCursor
 
 
 } // end of wxCursor::wxCursor
 
-wxCursor::wxCursor(
-  const wxString&                   rsCursorFile
-, long                              lFlags
-, int                               nHotSpotX
-, int                               nHotSpotY
-)
+wxCursor::wxCursor( const wxString& WXUNUSED(rsCursorFile),
+                    long lFlags,
+                    int WXUNUSED(nHotSpotX),
+                    int WXUNUSED(nHotSpotY) )
 {
 {
-    wxCursorRefData*                pRefData = new wxCursorRefData;
+    wxCursorRefData* pRefData = new wxCursorRefData;
 
     pRefData = new wxCursorRefData;
     m_refData = pRefData;
 
     pRefData = new wxCursorRefData;
     m_refData = pRefData;
-    pRefData->m_bDestroyCursor = FALSE;
+    pRefData->m_bDestroyCursor = false;
     if (lFlags == wxBITMAP_TYPE_CUR_RESOURCE)
     {
         pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
     if (lFlags == wxBITMAP_TYPE_CUR_RESOURCE)
     {
         pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
@@ -118,9 +113,7 @@ wxCursor::wxCursor(
 } // end of wxCursor::wxCursor
 
 // Cursors by stock number
 } // end of wxCursor::wxCursor
 
 // Cursors by stock number
-wxCursor::wxCursor(
-  int                               nCursorType
-)
+wxCursor::wxCursor(int nCursorType)
 {
     wxCursorRefData*                pRefData = new wxCursorRefData;
 
 {
     wxCursorRefData*                pRefData = new wxCursorRefData;
 
@@ -134,6 +127,7 @@ wxCursor::wxCursor(
                                                                   );
             break;
 
                                                                   );
             break;
 
+        case wxCURSOR_WATCH:
         case wxCURSOR_WAIT:
             pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
                                                                    ,(ULONG)SPTR_WAIT
         case wxCURSOR_WAIT:
             pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
                                                                    ,(ULONG)SPTR_WAIT
@@ -219,10 +213,10 @@ wxCursor::wxCursor(
             break;
 
         case wxCURSOR_NO_ENTRY:
             break;
 
         case wxCURSOR_NO_ENTRY:
-            pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
-                                                               ,0
-                                                               ,(ULONG)wxCURSOR_NO_ENTRY
-                                                              );
+            pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
+                                                                   ,(ULONG)SPTR_ILLEGAL
+                                                                   ,FALSE
+                                                                  );
             break;
 
         case wxCURSOR_LEFT_BUTTON:
             break;
 
         case wxCURSOR_LEFT_BUTTON:
@@ -253,13 +247,6 @@ wxCursor::wxCursor(
                                                                   );
             break;
 
                                                                   );
             break;
 
-        case wxCURSOR_WATCH:
-            pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
-                                                               ,0
-                                                               ,(ULONG)wxCURSOR_WATCH
-                                                              );
-            break;
-
         case wxCURSOR_SPRAYCAN:
             pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
                                                               ,0
         case wxCURSOR_SPRAYCAN:
             pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
                                                               ,0
@@ -313,7 +300,7 @@ wxCursor::wxCursor(
     //
     // No need to destroy the stock cursors
     //
     //
     // No need to destroy the stock cursors
     //
-    ((wxCursorRefData *)m_refData)->m_bDestroyCursor = FALSE;
+    ((wxCursorRefData *)m_refData)->m_bDestroyCursor = false;
 } // end of wxCursor::wxCursor
 
 // Global cursor setting
 } // end of wxCursor::wxCursor
 
 // Global cursor setting
@@ -329,4 +316,3 @@ void wxSetCursor(const wxCursor& cursor)
             (*g_globalCursor) = cursor;
     }
 }
             (*g_globalCursor) = cursor;
     }
 }
-