1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #include "wx/settings.h"
15 #include "wx/gdicmn.h"
18 #include "wx/mac/uma.h"
20 // ----------------------------------------------------------------------------
21 // wxSystemSettingsNative
22 // ----------------------------------------------------------------------------
24 // ----------------------------------------------------------------------------
26 // ----------------------------------------------------------------------------
28 wxColour
wxSystemSettingsNative::GetColour(wxSystemColour index
)
31 wxGetOsVersion( &major
, &minor
);
35 case wxSYS_COLOUR_SCROLLBAR
:
36 case wxSYS_COLOUR_BACKGROUND
:
37 case wxSYS_COLOUR_ACTIVECAPTION
:
38 case wxSYS_COLOUR_INACTIVECAPTION
:
39 case wxSYS_COLOUR_MENU
:
40 case wxSYS_COLOUR_WINDOW
:
41 case wxSYS_COLOUR_WINDOWFRAME
:
42 case wxSYS_COLOUR_ACTIVEBORDER
:
43 case wxSYS_COLOUR_INACTIVEBORDER
:
44 case wxSYS_COLOUR_BTNFACE
:
45 case wxSYS_COLOUR_MENUBAR
:
46 return wxColor( 0xDD , 0xDD , 0xDD ) ;
49 case wxSYS_COLOUR_LISTBOX
:
54 return wxColor( 0xEE , 0xEE , 0xEE ) ;
57 case wxSYS_COLOUR_BTNSHADOW
:
59 return wxColor( 0xBE , 0xBE , 0xBE ) ;
61 return wxColor( 0x44 , 0x44 , 0x44 ) ;
64 case wxSYS_COLOUR_BTNTEXT
:
65 case wxSYS_COLOUR_MENUTEXT
:
66 case wxSYS_COLOUR_WINDOWTEXT
:
67 case wxSYS_COLOUR_CAPTIONTEXT
:
68 case wxSYS_COLOUR_INFOTEXT
:
69 case wxSYS_COLOUR_INACTIVECAPTIONTEXT
:
72 case wxSYS_COLOUR_HIGHLIGHT
:
75 GetThemeBrushAsColor( kThemeBrushPrimaryHighlightColor
, 32, true, &hilite
);
76 return wxColor( hilite
.red
>> 8 , hilite
.green
>> 8 , hilite
.blue
>> 8 ) ;
79 case wxSYS_COLOUR_BTNHIGHLIGHT
:
80 case wxSYS_COLOUR_GRAYTEXT
:
81 return wxColor( 0xCC , 0xCC , 0xCC ) ;
84 case wxSYS_COLOUR_3DDKSHADOW
:
85 return wxColor( 0x44 , 0x44 , 0x44 ) ;
87 case wxSYS_COLOUR_3DLIGHT
:
88 return wxColor( 0xCC , 0xCC , 0xCC ) ;
90 case wxSYS_COLOUR_HIGHLIGHTTEXT
:
93 GetThemeBrushAsColor( kThemeBrushPrimaryHighlightColor
, 32, true, &hilite
);
94 if ( ( hilite
.red
+ hilite
.green
+ hilite
.blue
) == 0 )
100 case wxSYS_COLOUR_INFOBK
:
101 case wxSYS_COLOUR_APPWORKSPACE
:
105 case wxSYS_COLOUR_HOTLIGHT
:
106 case wxSYS_COLOUR_GRADIENTACTIVECAPTION
:
107 case wxSYS_COLOUR_GRADIENTINACTIVECAPTION
:
108 case wxSYS_COLOUR_MENUHILIGHT
:
112 case wxSYS_COLOUR_MAX
:
113 wxFAIL_MSG( _T("unknown system colour index") );
119 // ----------------------------------------------------------------------------
121 // ----------------------------------------------------------------------------
123 wxFont
wxSystemSettingsNative::GetFont(wxSystemFont index
)
127 case wxSYS_ANSI_VAR_FONT
:
128 case wxSYS_SYSTEM_FONT
:
129 case wxSYS_DEVICE_DEFAULT_FONT
:
130 case wxSYS_DEFAULT_GUI_FONT
:
132 return *wxSMALL_FONT
;
139 return *wxNORMAL_FONT
;
142 // ----------------------------------------------------------------------------
143 // system metrics/features
144 // ----------------------------------------------------------------------------
146 // Get a system metric, e.g. scrollbar size
147 int wxSystemSettingsNative::GetMetric(wxSystemMetric index
, wxWindow
* WXUNUSED(win
))
153 case wxSYS_MOUSE_BUTTONS
:
154 // we emulate a two button mouse (ctrl + click = right button )
157 // TODO case wxSYS_BORDER_X:
158 // TODO case wxSYS_BORDER_Y:
159 // TODO case wxSYS_CURSOR_X:
160 // TODO case wxSYS_CURSOR_Y:
161 // TODO case wxSYS_DCLICK_X:
162 // TODO case wxSYS_DCLICK_Y:
163 // TODO case wxSYS_DRAG_X:
164 // TODO case wxSYS_DRAG_Y:
165 // TODO case wxSYS_EDGE_X:
166 // TODO case wxSYS_EDGE_Y:
168 case wxSYS_HSCROLL_ARROW_X
:
170 case wxSYS_HSCROLL_ARROW_Y
:
175 // TODO case wxSYS_ICON_X:
176 // TODO case wxSYS_ICON_Y:
177 // TODO case wxSYS_ICONSPACING_X:
178 // TODO case wxSYS_ICONSPACING_Y:
179 // TODO case wxSYS_WINDOWMIN_X:
180 // TODO case wxSYS_WINDOWMIN_Y:
183 wxDisplaySize(&value
, NULL
);
186 wxDisplaySize(NULL
, &value
);
189 // TODO case wxSYS_FRAMESIZE_X:
190 // TODO case wxSYS_FRAMESIZE_Y:
191 // TODO case wxSYS_SMALLICON_X:
192 // TODO case wxSYS_SMALLICON_Y:
194 case wxSYS_HSCROLL_Y
:
196 case wxSYS_VSCROLL_X
:
198 case wxSYS_VSCROLL_ARROW_X
:
200 case wxSYS_VSCROLL_ARROW_Y
:
205 // TODO case wxSYS_CAPTION_Y:
206 // TODO case wxSYS_MENU_Y:
207 // TODO case wxSYS_NETWORK_PRESENT:
209 case wxSYS_PENWINDOWS_PRESENT
:
212 // TODO case wxSYS_SHOW_SOUNDS:
214 case wxSYS_SWAP_BUTTONS
:
218 break; // unsupported metric
223 bool wxSystemSettingsNative::HasFeature(wxSystemFeature index
)
227 case wxSYS_CAN_ICONIZE_FRAME
:
228 case wxSYS_CAN_DRAW_FRAME_DECORATIONS
: