]> git.saurik.com Git - wxWidgets.git/blame - src/os2/settings.cpp
fixed incorrect GetTextExtent for wxTELETYPE font
[wxWidgets.git] / src / os2 / settings.cpp
CommitLineData
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
27wxColour 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 );
a0606634
DW
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 );
a0606634
DW
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 );
a0606634
DW
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 );
a0606634
DW
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 );
a0606634
DW
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:
7e99520b 116 vCol = (*wxBLACK);
a0606634
DW
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:
7e99520b 126 vCol = (*wxBLUE);
a0606634
DW
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:
7e99520b 140 vCol = (*wxLIGHT_GREY);
a0606634
DW
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 );
a0606634
DW
152 break;
153 }
154 return(vCol);
155} // end of wxSystemSettings::GetSystemColour
0e320a79
DW
156
157wxFont 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 }
7e99520b
DW
184 if(wxSWISS_FONT)
185 return *wxSWISS_FONT;
0e320a79 186
7e99520b 187 return wxNullFont;
0e320a79
DW
188}
189
190// Get a system metric, e.g. scrollbar size
191int wxSystemSettings::GetSystemMetric(int index)
192{
409c9842
DW
193 switch ( index)
194 {
0e320a79
DW
195 case wxSYS_MOUSE_BUTTONS:
196 // TODO
409c9842 197 return 0;
0e320a79
DW
198 case wxSYS_BORDER_X:
199 // TODO
409c9842 200 return 0;
0e320a79
DW
201 case wxSYS_BORDER_Y:
202 // TODO
409c9842 203 return 0;
0e320a79
DW
204 case wxSYS_CURSOR_X:
205 // TODO
409c9842 206 return 0;
0e320a79
DW
207 case wxSYS_CURSOR_Y:
208 // TODO
409c9842 209 return 0;
0e320a79
DW
210 case wxSYS_DCLICK_X:
211 // TODO
409c9842 212 return 0;
0e320a79
DW
213 case wxSYS_DCLICK_Y:
214 // TODO
409c9842 215 return 0;
0e320a79
DW
216 case wxSYS_DRAG_X:
217 // TODO
409c9842 218 return 0;
0e320a79
DW
219 case wxSYS_DRAG_Y:
220 // TODO
409c9842 221 return 0;
0e320a79
DW
222 case wxSYS_EDGE_X:
223 // TODO
409c9842 224 return 0;
0e320a79
DW
225 case wxSYS_EDGE_Y:
226 // TODO
409c9842 227 return 0;
0e320a79
DW
228 case wxSYS_HSCROLL_ARROW_X:
229 // TODO
409c9842 230 return 0;
0e320a79
DW
231 case wxSYS_HSCROLL_ARROW_Y:
232 // TODO
409c9842 233 return 0;
0e320a79
DW
234 case wxSYS_HTHUMB_X:
235 // TODO
409c9842 236 return 0;
0e320a79
DW
237 case wxSYS_ICON_X:
238 // TODO
409c9842 239 return 0;
0e320a79
DW
240 case wxSYS_ICON_Y:
241 // TODO
409c9842 242 return 0;
0e320a79
DW
243 case wxSYS_ICONSPACING_X:
244 // TODO
409c9842 245 return 0;
0e320a79
DW
246 case wxSYS_ICONSPACING_Y:
247 // TODO
409c9842 248 return 0;
0e320a79
DW
249 case wxSYS_WINDOWMIN_X:
250 // TODO
409c9842 251 return 0;
0e320a79
DW
252 case wxSYS_WINDOWMIN_Y:
253 // TODO
409c9842 254 return 0;
0e320a79
DW
255 case wxSYS_SCREEN_X:
256 // TODO
409c9842 257 return 0;
0e320a79
DW
258 case wxSYS_SCREEN_Y:
259 // TODO
409c9842 260 return 0;
0e320a79
DW
261 case wxSYS_FRAMESIZE_X:
262 // TODO
409c9842 263 return 0;
0e320a79
DW
264 case wxSYS_FRAMESIZE_Y:
265 // TODO
409c9842 266 return 0;
0e320a79
DW
267 case wxSYS_SMALLICON_X:
268 // TODO
409c9842 269 return 0;
0e320a79
DW
270 case wxSYS_SMALLICON_Y:
271 // TODO
409c9842 272 return 0;
0e320a79
DW
273 case wxSYS_HSCROLL_Y:
274 // TODO
409c9842 275 return 0;
0e320a79
DW
276 case wxSYS_VSCROLL_X:
277 // TODO
409c9842 278 return 0;
0e320a79
DW
279 case wxSYS_VSCROLL_ARROW_X:
280 // TODO
409c9842 281 return 0;
0e320a79
DW
282 case wxSYS_VSCROLL_ARROW_Y:
283 // TODO
409c9842 284 return 0;
0e320a79
DW
285 case wxSYS_VTHUMB_Y:
286 // TODO
409c9842 287 return 0;
0e320a79
DW
288 case wxSYS_CAPTION_Y:
289 // TODO
409c9842 290 return 0;
0e320a79
DW
291 case wxSYS_MENU_Y:
292 // TODO
409c9842 293 return 0;
0e320a79
DW
294 case wxSYS_NETWORK_PRESENT:
295 // TODO
409c9842 296 return 0;
0e320a79
DW
297 case wxSYS_PENWINDOWS_PRESENT:
298 // TODO
409c9842 299 return 0;
0e320a79
DW
300 case wxSYS_SHOW_SOUNDS:
301 // TODO
409c9842 302 return 0;
0e320a79
DW
303 case wxSYS_SWAP_BUTTONS:
304 // TODO
409c9842
DW
305 return 0;
306 default:
307 return 0;
308 }
309 return 0;
0e320a79
DW
310}
311