1 /////////////////////////////////////////////////////////////////////////////
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
20 #include "wx/gdicmn.h"
23 #include "wx/module.h"
24 #include "wx/settings.h"
25 #include "wx/window.h"
26 #include "wx/os2/private.h"
28 // the module which is used to clean up wxSystemSettings data (this is a
29 // singleton class so it can't be done in the dtor)
30 class wxSystemSettingsModule
: public wxModule
32 friend class wxSystemSettings
;
34 virtual bool OnInit();
35 virtual void OnExit();
38 DECLARE_DYNAMIC_CLASS(wxSystemSettingsModule
)
40 static wxArrayString sm_optionNames
;
41 static wxArrayString sm_optionValues
;
44 // ----------------------------------------------------------------------------
46 // ----------------------------------------------------------------------------
48 static wxFont
*gs_fontDefault
= NULL
;
50 // ============================================================================
52 // ============================================================================
54 // ----------------------------------------------------------------------------
55 // wxSystemSettingsModule
56 // ----------------------------------------------------------------------------
58 IMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule
, wxModule
)
60 wxArrayString
wxSystemSettingsModule::sm_optionNames
;
61 wxArrayString
wxSystemSettingsModule::sm_optionValues
;
63 bool wxSystemSettingsModule::OnInit()
68 void wxSystemSettingsModule::OnExit()
70 sm_optionNames
.Clear();
71 sm_optionValues
.Clear();
72 delete gs_fontDefault
;
75 wxColour
wxSystemSettingsNative::GetColour(
84 // PM actually has values for these
86 case wxSYS_COLOUR_WINDOW
:
87 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
91 vCol
.Set( GetRValue(vRef
)
97 case wxSYS_COLOUR_WINDOWFRAME
:
98 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
102 vCol
.Set( GetRValue(vRef
)
108 case wxSYS_COLOUR_MENUTEXT
:
109 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
113 vCol
.Set( GetRValue(vRef
)
119 case wxSYS_COLOUR_BTNFACE
:
120 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
121 ,SYSCLR_BUTTONDEFAULT
124 vCol
.Set( GetRValue(vRef
)
130 case wxSYS_COLOUR_BTNSHADOW
:
131 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
135 vCol
.Set( GetRValue(vRef
)
141 case wxSYS_COLOUR_BTNHIGHLIGHT
:
142 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
146 vCol
.Set( GetRValue(vRef
)
152 case wxSYS_COLOUR_MENUBAR
:
153 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
157 vCol
.Set( GetRValue(vRef
)
164 // We'll have to just give values to these
166 case wxSYS_COLOUR_LISTBOX
:
167 case wxSYS_COLOUR_CAPTIONTEXT
:
170 case wxSYS_COLOUR_WINDOWTEXT
:
171 case wxSYS_COLOUR_INACTIVECAPTIONTEXT
:
172 case wxSYS_COLOUR_BTNTEXT
:
173 case wxSYS_COLOUR_INFOTEXT
:
178 // We should customize these to look like other ports
181 case wxSYS_COLOUR_ACTIVECAPTION
:
182 case wxSYS_COLOUR_ACTIVEBORDER
:
183 case wxSYS_COLOUR_HIGHLIGHT
:
187 case wxSYS_COLOUR_SCROLLBAR
:
188 case wxSYS_COLOUR_BACKGROUND
:
189 case wxSYS_COLOUR_INACTIVECAPTION
:
190 case wxSYS_COLOUR_MENU
:
191 case wxSYS_COLOUR_INACTIVEBORDER
:
192 case wxSYS_COLOUR_APPWORKSPACE
:
193 case wxSYS_COLOUR_HIGHLIGHTTEXT
:
194 case wxSYS_COLOUR_GRAYTEXT
:
195 case wxSYS_COLOUR_3DDKSHADOW
:
196 case wxSYS_COLOUR_3DLIGHT
:
197 case wxSYS_COLOUR_INFOBK
:
198 vCol
= (*wxLIGHT_GREY
);
202 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
206 vCol
.Set( GetRValue(vRef
)
213 } // end of wxSystemSettingsNative::GetColour
215 wxFont
wxSystemSettingsNative::GetFont(
222 case wxSYS_DEVICE_DEFAULT_FONT
:
226 case wxSYS_DEFAULT_PALETTE
:
230 case wxSYS_SYSTEM_FIXED_FONT
:
234 case wxSYS_SYSTEM_FONT
:
239 case wxSYS_DEFAULT_GUI_FONT
:
245 return *wxSWISS_FONT
;
250 // Get a system metric, e.g. scrollbar size
251 int wxSystemSettingsNative::GetMetric( wxSystemMetric index
,
252 wxWindow
* WXUNUSED(win
) )
256 // TODO case wxSYS_MOUSE_BUTTONS:
257 // TODO case wxSYS_BORDER_X:
258 // TODO case wxSYS_BORDER_Y:
259 // TODO case wxSYS_CURSOR_X:
260 // TODO case wxSYS_CURSOR_Y:
261 // TODO case wxSYS_DCLICK_X:
262 // TODO case wxSYS_DCLICK_Y:
263 // TODO case wxSYS_DRAG_X:
264 // TODO case wxSYS_DRAG_Y:
265 // TODO case wxSYS_EDGE_X:
266 // TODO case wxSYS_EDGE_Y:
267 // TODO case wxSYS_HSCROLL_ARROW_X:
268 // TODO case wxSYS_HSCROLL_ARROW_Y:
269 // TODO case wxSYS_HTHUMB_X:
270 // TODO case wxSYS_ICON_X:
271 // TODO case wxSYS_ICON_Y:
272 // TODO case wxSYS_ICONSPACING_X:
273 // TODO case wxSYS_ICONSPACING_Y:
274 // TODO case wxSYS_WINDOWMIN_X:
275 // TODO case wxSYS_WINDOWMIN_Y:
278 return ::WinQuerySysValue(HWND_DESKTOP
,SV_CXSCREEN
);
280 return ::WinQuerySysValue(HWND_DESKTOP
,SV_CYSCREEN
);
282 // TODO case wxSYS_FRAMESIZE_X:
283 // TODO case wxSYS_FRAMESIZE_Y:
284 // TODO case wxSYS_SMALLICON_X:
285 // TODO case wxSYS_SMALLICON_Y:
286 // TODO case wxSYS_HSCROLL_Y:
287 // TODO case wxSYS_VSCROLL_X:
288 // TODO case wxSYS_VSCROLL_ARROW_X:
289 // TODO case wxSYS_VSCROLL_ARROW_Y:
290 // TODO case wxSYS_VTHUMB_Y:
291 // TODO case wxSYS_CAPTION_Y:
292 // TODO case wxSYS_MENU_Y:
293 // TODO case wxSYS_NETWORK_PRESENT:
294 // TODO case wxSYS_PENWINDOWS_PRESENT:
295 // TODO case wxSYS_SHOW_SOUNDS:
296 // TODO case wxSYS_SWAP_BUTTONS:
298 return -1; // unsupported metric
301 bool wxSystemSettingsNative::HasFeature( wxSystemFeature index
)
305 case wxSYS_CAN_ICONIZE_FRAME
:
308 case wxSYS_CAN_DRAW_FRAME_DECORATIONS
: