1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "settings.h"
16 #include "wx/wxprec.h"
18 #include "wx/settings.h"
19 #include "wx/gdicmn.h"
22 #include "wx/mac/uma.h"
24 // ----------------------------------------------------------------------------
25 // wxSystemSettingsNative
26 // ----------------------------------------------------------------------------
28 // ----------------------------------------------------------------------------
30 // ----------------------------------------------------------------------------
32 wxColour
wxSystemSettingsNative::GetColour(wxSystemColour index
)
35 wxGetOsVersion( &major
, &minor
);
39 case wxSYS_COLOUR_SCROLLBAR
:
40 case wxSYS_COLOUR_BACKGROUND
:
41 case wxSYS_COLOUR_ACTIVECAPTION
:
42 case wxSYS_COLOUR_INACTIVECAPTION
:
43 case wxSYS_COLOUR_MENU
:
44 case wxSYS_COLOUR_WINDOW
:
45 case wxSYS_COLOUR_WINDOWFRAME
:
46 case wxSYS_COLOUR_ACTIVEBORDER
:
47 case wxSYS_COLOUR_INACTIVEBORDER
:
48 case wxSYS_COLOUR_BTNFACE
:
49 case wxSYS_COLOUR_MENUBAR
:
50 return wxColor( 0xDD , 0xDD , 0xDD ) ;
53 case wxSYS_COLOUR_LISTBOX
:
58 return wxColor( 0xEE , 0xEE , 0xEE ) ;
61 case wxSYS_COLOUR_BTNSHADOW
:
63 return wxColor( 0xBE , 0xBE , 0xBE ) ;
65 return wxColor( 0x44 , 0x44 , 0x44 ) ;
68 case wxSYS_COLOUR_BTNTEXT
:
69 case wxSYS_COLOUR_MENUTEXT
:
70 case wxSYS_COLOUR_WINDOWTEXT
:
71 case wxSYS_COLOUR_CAPTIONTEXT
:
72 case wxSYS_COLOUR_INFOTEXT
:
73 case wxSYS_COLOUR_INACTIVECAPTIONTEXT
:
76 case wxSYS_COLOUR_HIGHLIGHT
:
79 LMGetHiliteRGB(&hilite
) ;
80 return wxColor( hilite
.red
>> 8 , hilite
.green
>> 8 , hilite
.blue
>> 8 ) ;
83 case wxSYS_COLOUR_BTNHIGHLIGHT
:
84 case wxSYS_COLOUR_GRAYTEXT
:
85 return wxColor( 0xCC , 0xCC , 0xCC ) ;
88 case wxSYS_COLOUR_3DDKSHADOW
:
89 return wxColor( 0x44 , 0x44 , 0x44 ) ;
91 case wxSYS_COLOUR_3DLIGHT
:
92 return wxColor( 0xCC , 0xCC , 0xCC ) ;
94 case wxSYS_COLOUR_HIGHLIGHTTEXT
:
97 LMGetHiliteRGB(&hilite
) ;
98 if ( ( hilite
.red
+ hilite
.green
+ hilite
.blue
) == 0 )
104 case wxSYS_COLOUR_INFOBK
:
105 case wxSYS_COLOUR_APPWORKSPACE
:
109 case wxSYS_COLOUR_HOTLIGHT
:
110 case wxSYS_COLOUR_GRADIENTACTIVECAPTION
:
111 case wxSYS_COLOUR_GRADIENTINACTIVECAPTION
:
112 case wxSYS_COLOUR_MENUHILIGHT
:
116 case wxSYS_COLOUR_MAX
:
117 wxFAIL_MSG( _T("unknown system colour index") );
123 // ----------------------------------------------------------------------------
125 // ----------------------------------------------------------------------------
127 wxFont
wxSystemSettingsNative::GetFont(wxSystemFont index
)
131 case wxSYS_ANSI_VAR_FONT
:
132 case wxSYS_SYSTEM_FONT
:
133 case wxSYS_DEVICE_DEFAULT_FONT
:
134 case wxSYS_DEFAULT_GUI_FONT
:
136 return *wxSMALL_FONT
;
139 case wxSYS_OEM_FIXED_FONT
:
140 case wxSYS_ANSI_FIXED_FONT
:
141 case wxSYS_SYSTEM_FIXED_FONT
:
144 return *wxNORMAL_FONT
;
149 return *wxNORMAL_FONT
;
152 // ----------------------------------------------------------------------------
153 // system metrics/features
154 // ----------------------------------------------------------------------------
156 // Get a system metric, e.g. scrollbar size
157 int wxSystemSettingsNative::GetMetric(wxSystemMetric index
)
163 case wxSYS_MOUSE_BUTTONS
:
164 // we emulate a two button mouse (ctrl + click = right button )
167 // TODO case wxSYS_BORDER_X:
168 // TODO case wxSYS_BORDER_Y:
169 // TODO case wxSYS_CURSOR_X:
170 // TODO case wxSYS_CURSOR_Y:
171 // TODO case wxSYS_DCLICK_X:
172 // TODO case wxSYS_DCLICK_Y:
173 // TODO case wxSYS_DRAG_X:
174 // TODO case wxSYS_DRAG_Y:
175 // TODO case wxSYS_EDGE_X:
176 // TODO case wxSYS_EDGE_Y:
178 case wxSYS_HSCROLL_ARROW_X
:
180 case wxSYS_HSCROLL_ARROW_Y
:
185 // TODO case wxSYS_ICON_X:
186 // TODO case wxSYS_ICON_Y:
187 // TODO case wxSYS_ICONSPACING_X:
188 // TODO case wxSYS_ICONSPACING_Y:
189 // TODO case wxSYS_WINDOWMIN_X:
190 // TODO case wxSYS_WINDOWMIN_Y:
193 wxDisplaySize(&value
, NULL
);
196 wxDisplaySize(NULL
, &value
);
199 // TODO case wxSYS_FRAMESIZE_X:
200 // TODO case wxSYS_FRAMESIZE_Y:
201 // TODO case wxSYS_SMALLICON_X:
202 // TODO case wxSYS_SMALLICON_Y:
204 case wxSYS_HSCROLL_Y
:
206 case wxSYS_VSCROLL_X
:
208 case wxSYS_VSCROLL_ARROW_X
:
210 case wxSYS_VSCROLL_ARROW_Y
:
215 // TODO case wxSYS_CAPTION_Y:
216 // TODO case wxSYS_MENU_Y:
217 // TODO case wxSYS_NETWORK_PRESENT:
219 case wxSYS_PENWINDOWS_PRESENT
:
222 // TODO case wxSYS_SHOW_SOUNDS:
224 case wxSYS_SWAP_BUTTONS
:
228 return -1; // unsupported metric
233 bool wxSystemSettingsNative::HasFeature(wxSystemFeature index
)
237 case wxSYS_CAN_ICONIZE_FRAME
:
238 case wxSYS_CAN_DRAW_FRAME_DECORATIONS
: