From: Francesco Montorsi Date: Wed, 24 Sep 2008 19:40:13 +0000 (+0000) Subject: use wxStockCursor (as documented and as already implemented in wxMotif) instead of... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d4f392ea20e048c68626a14181cbf78c8baff3a5 use wxStockCursor (as documented and as already implemented in wxMotif) instead of a plain 'int' git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/cocoa/cursor.h b/include/wx/cocoa/cursor.h index eb220b9fa7..df2c381ca1 100644 --- a/include/wx/cocoa/cursor.h +++ b/include/wx/cocoa/cursor.h @@ -46,7 +46,7 @@ public: wxCursor(const wxString& name, long flags = 0, int hotSpotX = 0, int hotSpotY = 0); - wxCursor(int cursor_type); + wxCursor(wxStockCursor cursor_type); virtual ~wxCursor(); // FIXME: operator==() is wrong! diff --git a/include/wx/dfb/cursor.h b/include/wx/dfb/cursor.h index 102fab41a9..118d856716 100644 --- a/include/wx/dfb/cursor.h +++ b/include/wx/dfb/cursor.h @@ -24,7 +24,7 @@ class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject { public: wxCursor() {} - wxCursor(int cursorId); + wxCursor(wxStockCursor cursorId); wxCursor(const char bits[], int width, int height, int hotSpotX=-1, int hotSpotY=-1, const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0); diff --git a/include/wx/gtk/cursor.h b/include/wx/gtk/cursor.h index 8269c07048..c721480dde 100644 --- a/include/wx/gtk/cursor.h +++ b/include/wx/gtk/cursor.h @@ -23,7 +23,7 @@ class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject { public: wxCursor(); - wxCursor( int cursorId ); + wxCursor( wxStockCursor cursorId ); #if wxUSE_IMAGE wxCursor( const wxImage & image ); #endif diff --git a/include/wx/gtk1/cursor.h b/include/wx/gtk1/cursor.h index 2612a6c8d2..361f3e997e 100644 --- a/include/wx/gtk1/cursor.h +++ b/include/wx/gtk1/cursor.h @@ -25,7 +25,7 @@ class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject { public: wxCursor(); - wxCursor( int cursorId ); + wxCursor( wxStockCursor cursorId ); #if wxUSE_IMAGE wxCursor( const wxImage & image ); #endif diff --git a/include/wx/mgl/cursor.h b/include/wx/mgl/cursor.h index 31109db152..cb26186fad 100644 --- a/include/wx/mgl/cursor.h +++ b/include/wx/mgl/cursor.h @@ -24,7 +24,7 @@ class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject public: wxCursor(); - wxCursor(int cursorId); + wxCursor(wxStockCursor cursorId); wxCursor(const char bits[], int width, int height, int hotSpotX=-1, int hotSpotY=-1, const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0); diff --git a/include/wx/msw/cursor.h b/include/wx/msw/cursor.h index 2249736838..559390b92e 100644 --- a/include/wx/msw/cursor.h +++ b/include/wx/msw/cursor.h @@ -29,7 +29,7 @@ public: wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_CUR_RESOURCE, int hotSpotX = 0, int hotSpotY = 0); - wxCursor(int idCursor); + wxCursor(wxStockCursor idCursor); virtual ~wxCursor(); // implementation only diff --git a/include/wx/os2/cursor.h b/include/wx/os2/cursor.h index f91cb7dd04..02956942e2 100644 --- a/include/wx/os2/cursor.h +++ b/include/wx/os2/cursor.h @@ -46,7 +46,7 @@ public: ,int nHotSpotX = 0 ,int nHotSpotY = 0 ); - wxCursor(int nCursorType); + wxCursor(wxStockCursor nCursorType); inline ~wxCursor() { } inline WXHCURSOR GetHCURSOR(void) const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); } diff --git a/include/wx/osx/carbon/cursor.h b/include/wx/osx/carbon/cursor.h index 9a7b05715a..97c3a0a2df 100644 --- a/include/wx/osx/carbon/cursor.h +++ b/include/wx/osx/carbon/cursor.h @@ -30,7 +30,7 @@ public: wxBitmapType flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE, int hotSpotX = 0, int hotSpotY = 0); - wxCursor(int cursor_type); + wxCursor(wxStockCursor cursor_type); virtual ~wxCursor(); bool CreateFromXpm(const char* const* bits); diff --git a/include/wx/palmos/cursor.h b/include/wx/palmos/cursor.h index 4f76be6560..0281f344ec 100644 --- a/include/wx/palmos/cursor.h +++ b/include/wx/palmos/cursor.h @@ -29,7 +29,7 @@ public: wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_CUR_RESOURCE, int hotSpotX = 0, int hotSpotY = 0); - wxCursor(int idCursor); + wxCursor(wxStockCursor idCursor); virtual ~wxCursor(); // implementation only diff --git a/include/wx/x11/cursor.h b/include/wx/x11/cursor.h index 01849e8085..a674fe4696 100644 --- a/include/wx/x11/cursor.h +++ b/include/wx/x11/cursor.h @@ -25,7 +25,7 @@ class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject { public: wxCursor(); - wxCursor( int cursorId ); + wxCursor( wxStockCursor cursorId ); #if wxUSE_IMAGE wxCursor( const wxImage & image ); #endif diff --git a/src/dfb/cursor.cpp b/src/dfb/cursor.cpp index 0751f9ae4e..a7dcccf3ec 100644 --- a/src/dfb/cursor.cpp +++ b/src/dfb/cursor.cpp @@ -43,7 +43,7 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxObject) -wxCursor::wxCursor(int cursorId) +wxCursor::wxCursor(wxStockCursor cursorId) { #warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)" } diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 8e9c50a44e..21f9023d29 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -56,7 +56,7 @@ wxCursor::wxCursor() { } -wxCursor::wxCursor( int cursorId ) +wxCursor::wxCursor( wxStockCursor cursorId ) { m_refData = new wxCursorRefData(); diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index 3b14510edb..64bd429662 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -61,7 +61,7 @@ wxCursor::wxCursor() } -wxCursor::wxCursor( int cursorId ) +wxCursor::wxCursor( wxStockCursor cursorId ) { m_refData = new wxCursorRefData(); diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp index b43d0b254b..0f5a9a3811 100644 --- a/src/mgl/cursor.cpp +++ b/src/mgl/cursor.cpp @@ -65,7 +65,7 @@ wxCursor::wxCursor() { } -wxCursor::wxCursor(int cursorId) +wxCursor::wxCursor(wxStockCursor cursorId) { if ( !gs_cursorsHash ) gs_cursorsHash = new wxCursorsHash; diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 5e0bb783f9..11515894a7 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -292,7 +292,7 @@ wxCursor::wxCursor(const wxString& filename, } // Cursors by stock number -wxCursor::wxCursor(int idCursor) +wxCursor::wxCursor(wxStockCursor idCursor) { // all wxWidgets standard cursors static const struct StdCursor diff --git a/src/os2/cursor.cpp b/src/os2/cursor.cpp index 24fbc16ea1..b932b204ef 100644 --- a/src/os2/cursor.cpp +++ b/src/os2/cursor.cpp @@ -113,7 +113,7 @@ wxCursor::wxCursor( const wxString& WXUNUSED(rsCursorFile), } // end of wxCursor::wxCursor // Cursors by stock number -wxCursor::wxCursor(int nCursorType) +wxCursor::wxCursor(wxStockCursor nCursorType) { wxCursorRefData* pRefData = new wxCursorRefData; diff --git a/src/osx/carbon/cursor.cpp b/src/osx/carbon/cursor.cpp index 4b39a42024..89c524a32b 100644 --- a/src/osx/carbon/cursor.cpp +++ b/src/osx/carbon/cursor.cpp @@ -355,7 +355,7 @@ void wxCursor::CreateFromImage(const wxImage & image) CGImageRef cgimage = wxMacCreateCGImageFromBitmap(bmp); if ( cgimage ) { - M_CURSORDATA->m_hCursor = wxMacCocoaCreateCursorFromCGImage( cgimage, hotSpotX, hotSpotY ); + M_CURSORDATA->m_hCursor = wxMacCocoaCreateCursorFromCGImage( cgimage, hotSpotX, hotSpotY ); CFRelease( cgimage ); } #elif wxOSX_USE_CARBON @@ -556,7 +556,7 @@ wxCursor::wxCursor(const wxString& cursor_file, wxBitmapType flags, int hotSpotX } // Cursors by stock number -wxCursor::wxCursor(int cursor_type) +wxCursor::wxCursor(wxStockCursor cursor_type) { m_refData = new wxCursorRefData; #if wxOSX_USE_COCOA diff --git a/src/palmos/cursor.cpp b/src/palmos/cursor.cpp index 9bb3776db3..ca22a20e54 100644 --- a/src/palmos/cursor.cpp +++ b/src/palmos/cursor.cpp @@ -96,7 +96,7 @@ wxCursor::wxCursor(const wxString& filename, } // Cursors by stock number -wxCursor::wxCursor(int idCursor) +wxCursor::wxCursor(wxStockCursor idCursor) { } diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index f7e2de3c0c..a58a60d8f5 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -677,7 +677,7 @@ void Window::SetFont(Font &font) { } void Window::SetCursor(Cursor curs) { - int cursorId; + wxStockCursor cursorId; switch (curs) { case cursorText: @@ -708,16 +708,13 @@ void Window::SetCursor(Cursor curs) { cursorId = wxCURSOR_ARROW; break; } -#ifdef __WXMOTIF__ - wxCursor wc = wxStockCursor(cursorId) ; -#else - wxCursor wc = wxCursor(cursorId) ; -#endif - if(curs != cursorLast) - { - GETWIN(id)->SetCursor(wc); - cursorLast = curs; - } + + wxCursor wc = wxCursor(cursorId); + if(curs != cursorLast) + { + GETWIN(id)->SetCursor(wc); + cursorLast = curs; + } } diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp index f1b2a9dc89..2650afcfab 100644 --- a/src/x11/cursor.cpp +++ b/src/x11/cursor.cpp @@ -66,7 +66,7 @@ wxCursor::wxCursor() } -wxCursor::wxCursor( int cursorId ) +wxCursor::wxCursor( wxStockCursor cursorId ) { m_refData = new wxCursorRefData();