]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: cursor.cpp | |
3 | // Purpose: wxCursor class | |
4 | // Author: AUTHOR | |
5 | // Modified by: | |
6 | // Created: ??/??/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) AUTHOR | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifdef __GNUG__ | |
13 | #pragma implementation "cursor.h" | |
14 | #endif | |
15 | ||
16 | #include "wx/cursor.h" | |
17 | ||
18 | #if !USE_SHARED_LIBRARIES | |
19 | IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap) | |
20 | #endif | |
21 | ||
22 | wxCursorRefData::wxCursorRefData() | |
23 | { | |
24 | m_width = 32; m_height = 32; | |
25 | ||
26 | /* TODO | |
27 | m_hCursor = 0 ; | |
28 | */ | |
29 | } | |
30 | ||
31 | wxCursorRefData::~wxCursorRefData() | |
32 | { | |
33 | // TODO: destroy cursor | |
34 | } | |
35 | ||
36 | // Cursors | |
37 | wxCursor::wxCursor() | |
38 | { | |
39 | } | |
40 | ||
41 | wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height), | |
42 | int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), const char WXUNUSED(maskBits)[]) | |
43 | { | |
44 | } | |
45 | ||
46 | wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY) | |
47 | { | |
48 | m_refData = new wxIconRefData; | |
49 | ||
50 | // TODO: create cursor from a file | |
51 | } | |
52 | ||
53 | // Cursors by stock number | |
54 | wxCursor::wxCursor(int cursor_type) | |
55 | { | |
56 | m_refData = new wxIconRefData; | |
57 | ||
58 | /* TODO | |
59 | switch (cursor_type) | |
60 | { | |
61 | case wxCURSOR_WAIT: | |
62 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_WAIT); | |
63 | break; | |
64 | case wxCURSOR_IBEAM: | |
65 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_IBEAM); | |
66 | break; | |
67 | case wxCURSOR_CROSS: | |
68 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_CROSS); | |
69 | break; | |
70 | case wxCURSOR_SIZENWSE: | |
71 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENWSE); | |
72 | break; | |
73 | case wxCURSOR_SIZENESW: | |
74 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENESW); | |
75 | break; | |
76 | case wxCURSOR_SIZEWE: | |
77 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZEWE); | |
78 | break; | |
79 | case wxCURSOR_SIZENS: | |
80 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENS); | |
81 | break; | |
82 | case wxCURSOR_CHAR: | |
83 | { | |
84 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); | |
85 | break; | |
86 | } | |
87 | case wxCURSOR_HAND: | |
88 | { | |
89 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_HAND"); | |
90 | break; | |
91 | } | |
92 | case wxCURSOR_BULLSEYE: | |
93 | { | |
94 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_BULLSEYE"); | |
95 | break; | |
96 | } | |
97 | case wxCURSOR_PENCIL: | |
98 | { | |
99 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PENCIL"); | |
100 | break; | |
101 | } | |
102 | case wxCURSOR_MAGNIFIER: | |
103 | { | |
104 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_MAGNIFIER"); | |
105 | break; | |
106 | } | |
107 | case wxCURSOR_NO_ENTRY: | |
108 | { | |
109 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_NO_ENTRY"); | |
110 | break; | |
111 | } | |
112 | case wxCURSOR_LEFT_BUTTON: | |
113 | { | |
114 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); | |
115 | break; | |
116 | } | |
117 | case wxCURSOR_RIGHT_BUTTON: | |
118 | { | |
119 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); | |
120 | break; | |
121 | } | |
122 | case wxCURSOR_MIDDLE_BUTTON: | |
123 | { | |
124 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); | |
125 | break; | |
126 | } | |
127 | case wxCURSOR_SIZING: | |
128 | { | |
129 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_SIZING"); | |
130 | break; | |
131 | } | |
132 | case wxCURSOR_WATCH: | |
133 | { | |
134 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_WATCH"); | |
135 | break; | |
136 | } | |
137 | case wxCURSOR_SPRAYCAN: | |
138 | { | |
139 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_ROLLER"); | |
140 | break; | |
141 | } | |
142 | case wxCURSOR_PAINT_BRUSH: | |
143 | { | |
144 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PBRUSH"); | |
145 | break; | |
146 | } | |
147 | case wxCURSOR_POINT_LEFT: | |
148 | { | |
149 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PLEFT"); | |
150 | break; | |
151 | } | |
152 | case wxCURSOR_POINT_RIGHT: | |
153 | { | |
154 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PRIGHT"); | |
155 | break; | |
156 | } | |
157 | case wxCURSOR_QUESTION_ARROW: | |
158 | { | |
159 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_QARROW"); | |
160 | break; | |
161 | } | |
162 | case wxCURSOR_BLANK: | |
163 | { | |
164 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_BLANK"); | |
165 | break; | |
166 | } | |
167 | default: | |
168 | case wxCURSOR_ARROW: | |
169 | M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); | |
170 | break; | |
171 | } | |
172 | */ | |
173 | ||
174 | } | |
175 | ||
176 | wxCursor::~wxCursor() | |
177 | { | |
178 | } | |
179 | ||
180 | // Global cursor setting | |
181 | void wxSetCursor(const wxCursor& cursor) | |
182 | { | |
183 | // TODO (optional on platforms with no global cursor) | |
184 | } | |
185 | ||
186 |