]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: settings.cpp | |
3 | // Purpose: wxSettings | |
4 | // Author: David Webster | |
5 | // Modified by: | |
6 | // Created: 10/15/99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) David Webster | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | // For compilers that support precompilation, includes "wx.h". | |
13 | #include "wx/wxprec.h" | |
14 | ||
15 | #ifndef WX_PRECOMP | |
16 | #include <stdio.h> | |
17 | #include "wx/defs.h" | |
18 | #include "wx/pen.h" | |
19 | #include "wx/brush.h" | |
20 | #include "wx/gdicmn.h" | |
21 | #endif | |
22 | ||
23 | #include "wx/settings.h" | |
24 | #include "wx/window.h" | |
25 | #include "wx/os2/private.h" | |
26 | ||
27 | wxColour wxSystemSettings::GetSystemColour( | |
28 | int nIndex | |
29 | ) | |
30 | { | |
31 | COLORREF vRef; | |
32 | wxColour vCol; | |
33 | switch (nIndex) | |
34 | { | |
35 | // | |
36 | // PM actually has values for these | |
37 | // | |
38 | case wxSYS_COLOUR_WINDOW: | |
39 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
40 | ,SYSCLR_WINDOW | |
41 | ,0L | |
42 | ); | |
43 | vCol.Set( GetRValue(vRef) | |
44 | ,GetGValue(vRef) | |
45 | ,GetBValue(vRef) | |
46 | ); | |
47 | return vCol; | |
48 | break; | |
49 | ||
50 | case wxSYS_COLOUR_WINDOWFRAME: | |
51 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
52 | ,SYSCLR_WINDOWFRAME | |
53 | ,0L | |
54 | ); | |
55 | vCol.Set( GetRValue(vRef) | |
56 | ,GetGValue(vRef) | |
57 | ,GetBValue(vRef) | |
58 | ); | |
59 | return vCol; | |
60 | break; | |
61 | ||
62 | case wxSYS_COLOUR_MENUTEXT: | |
63 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
64 | ,SYSCLR_MENUTEXT | |
65 | ,0L | |
66 | ); | |
67 | vCol.Set( GetRValue(vRef) | |
68 | ,GetGValue(vRef) | |
69 | ,GetBValue(vRef) | |
70 | ); | |
71 | break; | |
72 | ||
73 | case wxSYS_COLOUR_BTNFACE: | |
74 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
75 | ,SYSCLR_BUTTONDEFAULT | |
76 | ,0L | |
77 | ); | |
78 | vCol.Set( GetRValue(vRef) | |
79 | ,GetGValue(vRef) | |
80 | ,GetBValue(vRef) | |
81 | ); | |
82 | return vCol; | |
83 | break; | |
84 | ||
85 | case wxSYS_COLOUR_BTNSHADOW: | |
86 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
87 | ,SYSCLR_BUTTONMIDDLE | |
88 | ,0L | |
89 | ); | |
90 | vCol.Set( GetRValue(vRef) | |
91 | ,GetGValue(vRef) | |
92 | ,GetBValue(vRef) | |
93 | ); | |
94 | return vCol; | |
95 | break; | |
96 | ||
97 | case wxSYS_COLOUR_BTNHIGHLIGHT: | |
98 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
99 | ,SYSCLR_BUTTONLIGHT | |
100 | ,0L | |
101 | ); | |
102 | vCol.Set( GetRValue(vRef) | |
103 | ,GetGValue(vRef) | |
104 | ,GetBValue(vRef) | |
105 | ); | |
106 | return vCol; | |
107 | break; | |
108 | ||
109 | // | |
110 | // We'll have to just give values to these | |
111 | // | |
112 | case wxSYS_COLOUR_LISTBOX: | |
113 | case wxSYS_COLOUR_CAPTIONTEXT: | |
114 | return(*wxWHITE); | |
115 | break; | |
116 | ||
117 | case wxSYS_COLOUR_WINDOWTEXT: | |
118 | case wxSYS_COLOUR_INACTIVECAPTIONTEXT: | |
119 | case wxSYS_COLOUR_BTNTEXT: | |
120 | case wxSYS_COLOUR_INFOTEXT: | |
121 | return(*wxBLACK); | |
122 | break; | |
123 | ||
124 | // | |
125 | // We should customize these to look like other ports | |
126 | // | |
127 | ||
128 | case wxSYS_COLOUR_ACTIVECAPTION: | |
129 | case wxSYS_COLOUR_ACTIVEBORDER: | |
130 | case wxSYS_COLOUR_HIGHLIGHT: | |
131 | return(*wxBLUE); | |
132 | break; | |
133 | ||
134 | case wxSYS_COLOUR_SCROLLBAR: | |
135 | case wxSYS_COLOUR_BACKGROUND: | |
136 | case wxSYS_COLOUR_INACTIVECAPTION: | |
137 | case wxSYS_COLOUR_MENU: | |
138 | case wxSYS_COLOUR_INACTIVEBORDER: | |
139 | case wxSYS_COLOUR_APPWORKSPACE: | |
140 | case wxSYS_COLOUR_HIGHLIGHTTEXT: | |
141 | case wxSYS_COLOUR_GRAYTEXT: | |
142 | case wxSYS_COLOUR_3DDKSHADOW: | |
143 | case wxSYS_COLOUR_3DLIGHT: | |
144 | case wxSYS_COLOUR_INFOBK: | |
145 | return(*wxLIGHT_GREY); | |
146 | break; | |
147 | ||
148 | default: | |
149 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
150 | ,SYSCLR_WINDOW | |
151 | ,0L | |
152 | ); | |
153 | vCol.Set( GetRValue(vRef) | |
154 | ,GetGValue(vRef) | |
155 | ,GetBValue(vRef) | |
156 | ); | |
157 | return vCol; | |
158 | break; | |
159 | } | |
160 | return(vCol); | |
161 | } // end of wxSystemSettings::GetSystemColour | |
162 | ||
163 | wxFont wxSystemSettings::GetSystemFont(int index) | |
164 | { | |
165 | // TODO | |
166 | switch (index) | |
167 | { | |
168 | case wxSYS_DEVICE_DEFAULT_FONT: | |
169 | { | |
170 | break; | |
171 | } | |
172 | case wxSYS_DEFAULT_PALETTE: | |
173 | { | |
174 | break; | |
175 | } | |
176 | case wxSYS_SYSTEM_FIXED_FONT: | |
177 | { | |
178 | break; | |
179 | } | |
180 | case wxSYS_SYSTEM_FONT: | |
181 | { | |
182 | break; | |
183 | } | |
184 | default: | |
185 | case wxSYS_DEFAULT_GUI_FONT: | |
186 | { | |
187 | break; | |
188 | } | |
189 | } | |
190 | ||
191 | return *wxSWISS_FONT; | |
192 | } | |
193 | ||
194 | // Get a system metric, e.g. scrollbar size | |
195 | int wxSystemSettings::GetSystemMetric(int index) | |
196 | { | |
197 | switch ( index) | |
198 | { | |
199 | case wxSYS_MOUSE_BUTTONS: | |
200 | // TODO | |
201 | return 0; | |
202 | case wxSYS_BORDER_X: | |
203 | // TODO | |
204 | return 0; | |
205 | case wxSYS_BORDER_Y: | |
206 | // TODO | |
207 | return 0; | |
208 | case wxSYS_CURSOR_X: | |
209 | // TODO | |
210 | return 0; | |
211 | case wxSYS_CURSOR_Y: | |
212 | // TODO | |
213 | return 0; | |
214 | case wxSYS_DCLICK_X: | |
215 | // TODO | |
216 | return 0; | |
217 | case wxSYS_DCLICK_Y: | |
218 | // TODO | |
219 | return 0; | |
220 | case wxSYS_DRAG_X: | |
221 | // TODO | |
222 | return 0; | |
223 | case wxSYS_DRAG_Y: | |
224 | // TODO | |
225 | return 0; | |
226 | case wxSYS_EDGE_X: | |
227 | // TODO | |
228 | return 0; | |
229 | case wxSYS_EDGE_Y: | |
230 | // TODO | |
231 | return 0; | |
232 | case wxSYS_HSCROLL_ARROW_X: | |
233 | // TODO | |
234 | return 0; | |
235 | case wxSYS_HSCROLL_ARROW_Y: | |
236 | // TODO | |
237 | return 0; | |
238 | case wxSYS_HTHUMB_X: | |
239 | // TODO | |
240 | return 0; | |
241 | case wxSYS_ICON_X: | |
242 | // TODO | |
243 | return 0; | |
244 | case wxSYS_ICON_Y: | |
245 | // TODO | |
246 | return 0; | |
247 | case wxSYS_ICONSPACING_X: | |
248 | // TODO | |
249 | return 0; | |
250 | case wxSYS_ICONSPACING_Y: | |
251 | // TODO | |
252 | return 0; | |
253 | case wxSYS_WINDOWMIN_X: | |
254 | // TODO | |
255 | return 0; | |
256 | case wxSYS_WINDOWMIN_Y: | |
257 | // TODO | |
258 | return 0; | |
259 | case wxSYS_SCREEN_X: | |
260 | // TODO | |
261 | return 0; | |
262 | case wxSYS_SCREEN_Y: | |
263 | // TODO | |
264 | return 0; | |
265 | case wxSYS_FRAMESIZE_X: | |
266 | // TODO | |
267 | return 0; | |
268 | case wxSYS_FRAMESIZE_Y: | |
269 | // TODO | |
270 | return 0; | |
271 | case wxSYS_SMALLICON_X: | |
272 | // TODO | |
273 | return 0; | |
274 | case wxSYS_SMALLICON_Y: | |
275 | // TODO | |
276 | return 0; | |
277 | case wxSYS_HSCROLL_Y: | |
278 | // TODO | |
279 | return 0; | |
280 | case wxSYS_VSCROLL_X: | |
281 | // TODO | |
282 | return 0; | |
283 | case wxSYS_VSCROLL_ARROW_X: | |
284 | // TODO | |
285 | return 0; | |
286 | case wxSYS_VSCROLL_ARROW_Y: | |
287 | // TODO | |
288 | return 0; | |
289 | case wxSYS_VTHUMB_Y: | |
290 | // TODO | |
291 | return 0; | |
292 | case wxSYS_CAPTION_Y: | |
293 | // TODO | |
294 | return 0; | |
295 | case wxSYS_MENU_Y: | |
296 | // TODO | |
297 | return 0; | |
298 | case wxSYS_NETWORK_PRESENT: | |
299 | // TODO | |
300 | return 0; | |
301 | case wxSYS_PENWINDOWS_PRESENT: | |
302 | // TODO | |
303 | return 0; | |
304 | case wxSYS_SHOW_SOUNDS: | |
305 | // TODO | |
306 | return 0; | |
307 | case wxSYS_SWAP_BUTTONS: | |
308 | // TODO | |
309 | return 0; | |
310 | default: | |
311 | return 0; | |
312 | } | |
313 | return 0; | |
314 | } | |
315 |