]>
git.saurik.com Git - wxWidgets.git/blob - src/stubs/cursor.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCursor class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "cursor.h"
16 #include "wx/cursor.h"
19 IMPLEMENT_DYNAMIC_CLASS(wxCursor
, wxBitmap
)
21 wxCursorRefData::wxCursorRefData()
23 m_width
= 32; m_height
= 32;
30 wxCursorRefData::~wxCursorRefData()
32 // TODO: destroy cursor
40 wxCursor::wxCursor(const char WXUNUSED(bits
)[], int WXUNUSED(width
), int WXUNUSED(height
),
41 int WXUNUSED(hotSpotX
), int WXUNUSED(hotSpotY
), const char WXUNUSED(maskBits
)[])
45 wxCursor::wxCursor(const wxString
& cursor_file
, long flags
, int hotSpotX
, int hotSpotY
)
47 m_refData
= new wxCursorRefData
;
49 // TODO: create cursor from a file
52 // Cursors by stock number
53 wxCursor::wxCursor(int cursor_type
)
55 m_refData
= new wxCursorRefData
;
61 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_WAIT);
64 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_IBEAM);
67 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_CROSS);
69 case wxCURSOR_SIZENWSE:
70 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENWSE);
72 case wxCURSOR_SIZENESW:
73 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENESW);
76 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZEWE);
79 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENS);
83 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
88 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_HAND");
91 case wxCURSOR_BULLSEYE:
93 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_BULLSEYE");
98 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PENCIL");
101 case wxCURSOR_MAGNIFIER:
103 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_MAGNIFIER");
106 case wxCURSOR_NO_ENTRY:
108 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_NO_ENTRY");
111 case wxCURSOR_LEFT_BUTTON:
113 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
116 case wxCURSOR_RIGHT_BUTTON:
118 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
121 case wxCURSOR_MIDDLE_BUTTON:
123 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
126 case wxCURSOR_SIZING:
128 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_SIZING");
133 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_WATCH");
136 case wxCURSOR_SPRAYCAN:
138 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_ROLLER");
141 case wxCURSOR_PAINT_BRUSH:
143 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PBRUSH");
146 case wxCURSOR_POINT_LEFT:
148 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PLEFT");
151 case wxCURSOR_POINT_RIGHT:
153 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PRIGHT");
156 case wxCURSOR_QUESTION_ARROW:
158 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_QARROW");
163 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_BLANK");
168 M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
175 wxCursor::~wxCursor()
179 // Global cursor setting
180 void wxSetCursor(const wxCursor
& cursor
)
182 // TODO (optional on platforms with no global cursor)