]>
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 | break; | |
48 | ||
49 | case wxSYS_COLOUR_WINDOWFRAME: | |
50 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
51 | ,SYSCLR_WINDOWFRAME | |
52 | ,0L | |
53 | ); | |
54 | vCol.Set( GetRValue(vRef) | |
55 | ,GetGValue(vRef) | |
56 | ,GetBValue(vRef) | |
57 | ); | |
58 | break; | |
59 | ||
60 | case wxSYS_COLOUR_MENUTEXT: | |
61 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
62 | ,SYSCLR_MENUTEXT | |
63 | ,0L | |
64 | ); | |
65 | vCol.Set( GetRValue(vRef) | |
66 | ,GetGValue(vRef) | |
67 | ,GetBValue(vRef) | |
68 | ); | |
69 | break; | |
70 | ||
71 | case wxSYS_COLOUR_BTNFACE: | |
72 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
73 | ,SYSCLR_BUTTONDEFAULT | |
74 | ,0L | |
75 | ); | |
76 | vCol.Set( GetRValue(vRef) | |
77 | ,GetGValue(vRef) | |
78 | ,GetBValue(vRef) | |
79 | ); | |
80 | break; | |
81 | ||
82 | case wxSYS_COLOUR_BTNSHADOW: | |
83 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
84 | ,SYSCLR_BUTTONMIDDLE | |
85 | ,0L | |
86 | ); | |
87 | vCol.Set( GetRValue(vRef) | |
88 | ,GetGValue(vRef) | |
89 | ,GetBValue(vRef) | |
90 | ); | |
91 | break; | |
92 | ||
93 | case wxSYS_COLOUR_BTNHIGHLIGHT: | |
94 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
95 | ,SYSCLR_BUTTONLIGHT | |
96 | ,0L | |
97 | ); | |
98 | vCol.Set( GetRValue(vRef) | |
99 | ,GetGValue(vRef) | |
100 | ,GetBValue(vRef) | |
101 | ); | |
102 | break; | |
103 | ||
104 | // | |
105 | // We'll have to just give values to these | |
106 | // | |
107 | case wxSYS_COLOUR_LISTBOX: | |
108 | case wxSYS_COLOUR_CAPTIONTEXT: | |
109 | return(*wxWHITE); | |
110 | break; | |
111 | ||
112 | case wxSYS_COLOUR_WINDOWTEXT: | |
113 | case wxSYS_COLOUR_INACTIVECAPTIONTEXT: | |
114 | case wxSYS_COLOUR_BTNTEXT: | |
115 | case wxSYS_COLOUR_INFOTEXT: | |
116 | vCol = (*wxBLACK); | |
117 | break; | |
118 | ||
119 | // | |
120 | // We should customize these to look like other ports | |
121 | // | |
122 | ||
123 | case wxSYS_COLOUR_ACTIVECAPTION: | |
124 | case wxSYS_COLOUR_ACTIVEBORDER: | |
125 | case wxSYS_COLOUR_HIGHLIGHT: | |
126 | vCol = (*wxBLUE); | |
127 | break; | |
128 | ||
129 | case wxSYS_COLOUR_SCROLLBAR: | |
130 | case wxSYS_COLOUR_BACKGROUND: | |
131 | case wxSYS_COLOUR_INACTIVECAPTION: | |
132 | case wxSYS_COLOUR_MENU: | |
133 | case wxSYS_COLOUR_INACTIVEBORDER: | |
134 | case wxSYS_COLOUR_APPWORKSPACE: | |
135 | case wxSYS_COLOUR_HIGHLIGHTTEXT: | |
136 | case wxSYS_COLOUR_GRAYTEXT: | |
137 | case wxSYS_COLOUR_3DDKSHADOW: | |
138 | case wxSYS_COLOUR_3DLIGHT: | |
139 | case wxSYS_COLOUR_INFOBK: | |
140 | vCol = (*wxLIGHT_GREY); | |
141 | break; | |
142 | ||
143 | default: | |
144 | vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP | |
145 | ,SYSCLR_WINDOW | |
146 | ,0L | |
147 | ); | |
148 | vCol.Set( GetRValue(vRef) | |
149 | ,GetGValue(vRef) | |
150 | ,GetBValue(vRef) | |
151 | ); | |
152 | break; | |
153 | } | |
154 | return(vCol); | |
155 | } // end of wxSystemSettings::GetSystemColour | |
156 | ||
157 | wxFont wxSystemSettings::GetSystemFont(int index) | |
158 | { | |
159 | // TODO | |
160 | switch (index) | |
161 | { | |
162 | case wxSYS_DEVICE_DEFAULT_FONT: | |
163 | { | |
164 | break; | |
165 | } | |
166 | case wxSYS_DEFAULT_PALETTE: | |
167 | { | |
168 | break; | |
169 | } | |
170 | case wxSYS_SYSTEM_FIXED_FONT: | |
171 | { | |
172 | break; | |
173 | } | |
174 | case wxSYS_SYSTEM_FONT: | |
175 | { | |
176 | break; | |
177 | } | |
178 | default: | |
179 | case wxSYS_DEFAULT_GUI_FONT: | |
180 | { | |
181 | break; | |
182 | } | |
183 | } | |
184 | if(wxSWISS_FONT) | |
185 | return *wxSWISS_FONT; | |
186 | ||
187 | return wxNullFont; | |
188 | } | |
189 | ||
190 | // Get a system metric, e.g. scrollbar size | |
191 | int wxSystemSettings::GetSystemMetric(int index) | |
192 | { | |
193 | switch ( index) | |
194 | { | |
195 | case wxSYS_MOUSE_BUTTONS: | |
196 | // TODO | |
197 | return 0; | |
198 | case wxSYS_BORDER_X: | |
199 | // TODO | |
200 | return 0; | |
201 | case wxSYS_BORDER_Y: | |
202 | // TODO | |
203 | return 0; | |
204 | case wxSYS_CURSOR_X: | |
205 | // TODO | |
206 | return 0; | |
207 | case wxSYS_CURSOR_Y: | |
208 | // TODO | |
209 | return 0; | |
210 | case wxSYS_DCLICK_X: | |
211 | // TODO | |
212 | return 0; | |
213 | case wxSYS_DCLICK_Y: | |
214 | // TODO | |
215 | return 0; | |
216 | case wxSYS_DRAG_X: | |
217 | // TODO | |
218 | return 0; | |
219 | case wxSYS_DRAG_Y: | |
220 | // TODO | |
221 | return 0; | |
222 | case wxSYS_EDGE_X: | |
223 | // TODO | |
224 | return 0; | |
225 | case wxSYS_EDGE_Y: | |
226 | // TODO | |
227 | return 0; | |
228 | case wxSYS_HSCROLL_ARROW_X: | |
229 | // TODO | |
230 | return 0; | |
231 | case wxSYS_HSCROLL_ARROW_Y: | |
232 | // TODO | |
233 | return 0; | |
234 | case wxSYS_HTHUMB_X: | |
235 | // TODO | |
236 | return 0; | |
237 | case wxSYS_ICON_X: | |
238 | // TODO | |
239 | return 0; | |
240 | case wxSYS_ICON_Y: | |
241 | // TODO | |
242 | return 0; | |
243 | case wxSYS_ICONSPACING_X: | |
244 | // TODO | |
245 | return 0; | |
246 | case wxSYS_ICONSPACING_Y: | |
247 | // TODO | |
248 | return 0; | |
249 | case wxSYS_WINDOWMIN_X: | |
250 | // TODO | |
251 | return 0; | |
252 | case wxSYS_WINDOWMIN_Y: | |
253 | // TODO | |
254 | return 0; | |
255 | case wxSYS_SCREEN_X: | |
256 | // TODO | |
257 | return 0; | |
258 | case wxSYS_SCREEN_Y: | |
259 | // TODO | |
260 | return 0; | |
261 | case wxSYS_FRAMESIZE_X: | |
262 | // TODO | |
263 | return 0; | |
264 | case wxSYS_FRAMESIZE_Y: | |
265 | // TODO | |
266 | return 0; | |
267 | case wxSYS_SMALLICON_X: | |
268 | // TODO | |
269 | return 0; | |
270 | case wxSYS_SMALLICON_Y: | |
271 | // TODO | |
272 | return 0; | |
273 | case wxSYS_HSCROLL_Y: | |
274 | // TODO | |
275 | return 0; | |
276 | case wxSYS_VSCROLL_X: | |
277 | // TODO | |
278 | return 0; | |
279 | case wxSYS_VSCROLL_ARROW_X: | |
280 | // TODO | |
281 | return 0; | |
282 | case wxSYS_VSCROLL_ARROW_Y: | |
283 | // TODO | |
284 | return 0; | |
285 | case wxSYS_VTHUMB_Y: | |
286 | // TODO | |
287 | return 0; | |
288 | case wxSYS_CAPTION_Y: | |
289 | // TODO | |
290 | return 0; | |
291 | case wxSYS_MENU_Y: | |
292 | // TODO | |
293 | return 0; | |
294 | case wxSYS_NETWORK_PRESENT: | |
295 | // TODO | |
296 | return 0; | |
297 | case wxSYS_PENWINDOWS_PRESENT: | |
298 | // TODO | |
299 | return 0; | |
300 | case wxSYS_SHOW_SOUNDS: | |
301 | // TODO | |
302 | return 0; | |
303 | case wxSYS_SWAP_BUTTONS: | |
304 | // TODO | |
305 | return 0; | |
306 | default: | |
307 | return 0; | |
308 | } | |
309 | return 0; | |
310 | } | |
311 |