]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: settings.cpp | |
3 | // Purpose: wxSettings | |
409c9842 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
409c9842 | 6 | // Created: 10/15/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
409c9842 DW |
8 | // Copyright: (c) David Webster |
9 | // Licence: wxWindows licence | |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
409c9842 DW |
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" | |
0e320a79 DW |
21 | #endif |
22 | ||
23 | #include "wx/settings.h" | |
409c9842 DW |
24 | #include "wx/window.h" |
25 | #include "wx/os2/private.h" | |
0e320a79 | 26 | |
a0606634 DW |
27 | wxColour wxSystemSettings::GetSystemColour( |
28 | int nIndex | |
29 | ) | |
0e320a79 | 30 | { |
a0606634 DW |
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 | |
0e320a79 DW |
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 wxFont(); | |
192 | } | |
193 | ||
194 | // Get a system metric, e.g. scrollbar size | |
195 | int wxSystemSettings::GetSystemMetric(int index) | |
196 | { | |
409c9842 DW |
197 | switch ( index) |
198 | { | |
0e320a79 DW |
199 | case wxSYS_MOUSE_BUTTONS: |
200 | // TODO | |
409c9842 | 201 | return 0; |
0e320a79 DW |
202 | case wxSYS_BORDER_X: |
203 | // TODO | |
409c9842 | 204 | return 0; |
0e320a79 DW |
205 | case wxSYS_BORDER_Y: |
206 | // TODO | |
409c9842 | 207 | return 0; |
0e320a79 DW |
208 | case wxSYS_CURSOR_X: |
209 | // TODO | |
409c9842 | 210 | return 0; |
0e320a79 DW |
211 | case wxSYS_CURSOR_Y: |
212 | // TODO | |
409c9842 | 213 | return 0; |
0e320a79 DW |
214 | case wxSYS_DCLICK_X: |
215 | // TODO | |
409c9842 | 216 | return 0; |
0e320a79 DW |
217 | case wxSYS_DCLICK_Y: |
218 | // TODO | |
409c9842 | 219 | return 0; |
0e320a79 DW |
220 | case wxSYS_DRAG_X: |
221 | // TODO | |
409c9842 | 222 | return 0; |
0e320a79 DW |
223 | case wxSYS_DRAG_Y: |
224 | // TODO | |
409c9842 | 225 | return 0; |
0e320a79 DW |
226 | case wxSYS_EDGE_X: |
227 | // TODO | |
409c9842 | 228 | return 0; |
0e320a79 DW |
229 | case wxSYS_EDGE_Y: |
230 | // TODO | |
409c9842 | 231 | return 0; |
0e320a79 DW |
232 | case wxSYS_HSCROLL_ARROW_X: |
233 | // TODO | |
409c9842 | 234 | return 0; |
0e320a79 DW |
235 | case wxSYS_HSCROLL_ARROW_Y: |
236 | // TODO | |
409c9842 | 237 | return 0; |
0e320a79 DW |
238 | case wxSYS_HTHUMB_X: |
239 | // TODO | |
409c9842 | 240 | return 0; |
0e320a79 DW |
241 | case wxSYS_ICON_X: |
242 | // TODO | |
409c9842 | 243 | return 0; |
0e320a79 DW |
244 | case wxSYS_ICON_Y: |
245 | // TODO | |
409c9842 | 246 | return 0; |
0e320a79 DW |
247 | case wxSYS_ICONSPACING_X: |
248 | // TODO | |
409c9842 | 249 | return 0; |
0e320a79 DW |
250 | case wxSYS_ICONSPACING_Y: |
251 | // TODO | |
409c9842 | 252 | return 0; |
0e320a79 DW |
253 | case wxSYS_WINDOWMIN_X: |
254 | // TODO | |
409c9842 | 255 | return 0; |
0e320a79 DW |
256 | case wxSYS_WINDOWMIN_Y: |
257 | // TODO | |
409c9842 | 258 | return 0; |
0e320a79 DW |
259 | case wxSYS_SCREEN_X: |
260 | // TODO | |
409c9842 | 261 | return 0; |
0e320a79 DW |
262 | case wxSYS_SCREEN_Y: |
263 | // TODO | |
409c9842 | 264 | return 0; |
0e320a79 DW |
265 | case wxSYS_FRAMESIZE_X: |
266 | // TODO | |
409c9842 | 267 | return 0; |
0e320a79 DW |
268 | case wxSYS_FRAMESIZE_Y: |
269 | // TODO | |
409c9842 | 270 | return 0; |
0e320a79 DW |
271 | case wxSYS_SMALLICON_X: |
272 | // TODO | |
409c9842 | 273 | return 0; |
0e320a79 DW |
274 | case wxSYS_SMALLICON_Y: |
275 | // TODO | |
409c9842 | 276 | return 0; |
0e320a79 DW |
277 | case wxSYS_HSCROLL_Y: |
278 | // TODO | |
409c9842 | 279 | return 0; |
0e320a79 DW |
280 | case wxSYS_VSCROLL_X: |
281 | // TODO | |
409c9842 | 282 | return 0; |
0e320a79 DW |
283 | case wxSYS_VSCROLL_ARROW_X: |
284 | // TODO | |
409c9842 | 285 | return 0; |
0e320a79 DW |
286 | case wxSYS_VSCROLL_ARROW_Y: |
287 | // TODO | |
409c9842 | 288 | return 0; |
0e320a79 DW |
289 | case wxSYS_VTHUMB_Y: |
290 | // TODO | |
409c9842 | 291 | return 0; |
0e320a79 DW |
292 | case wxSYS_CAPTION_Y: |
293 | // TODO | |
409c9842 | 294 | return 0; |
0e320a79 DW |
295 | case wxSYS_MENU_Y: |
296 | // TODO | |
409c9842 | 297 | return 0; |
0e320a79 DW |
298 | case wxSYS_NETWORK_PRESENT: |
299 | // TODO | |
409c9842 | 300 | return 0; |
0e320a79 DW |
301 | case wxSYS_PENWINDOWS_PRESENT: |
302 | // TODO | |
409c9842 | 303 | return 0; |
0e320a79 DW |
304 | case wxSYS_SHOW_SOUNDS: |
305 | // TODO | |
409c9842 | 306 | return 0; |
0e320a79 DW |
307 | case wxSYS_SWAP_BUTTONS: |
308 | // TODO | |
409c9842 DW |
309 | return 0; |
310 | default: | |
311 | return 0; | |
312 | } | |
313 | return 0; | |
0e320a79 DW |
314 | } |
315 |