]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/settings.cpp
added missing include file for Apple DevTools
[wxWidgets.git] / src / mac / carbon / settings.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: settings.cpp
3 // Purpose: wxSettings
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "settings.h"
14 #endif
15
16 #include "wx/settings.h"
17 #include "wx/gdicmn.h"
18 #include "wx/utils.h"
19
20 wxColour wxSystemSettings::GetSystemColour(int index)
21 {
22 int major,minor;
23 wxGetOsVersion( &major, &minor );
24
25 switch( index )
26 {
27 case wxSYS_COLOUR_SCROLLBAR :
28 case wxSYS_COLOUR_BACKGROUND:
29 case wxSYS_COLOUR_ACTIVECAPTION:
30 case wxSYS_COLOUR_INACTIVECAPTION:
31 case wxSYS_COLOUR_MENU:
32 case wxSYS_COLOUR_WINDOW:
33 case wxSYS_COLOUR_WINDOWFRAME:
34 case wxSYS_COLOUR_ACTIVEBORDER:
35 case wxSYS_COLOUR_INACTIVEBORDER:
36 case wxSYS_COLOUR_BTNFACE:
37 return wxColor( 0xDD , 0xDD , 0xDD ) ;
38 break ;
39
40 case wxSYS_COLOUR_LISTBOX :
41 {
42 if (major >= 10)
43 return *wxWHITE ;
44 else
45 return wxColor( 0xEE , 0xEE , 0xEE ) ;
46 break ;
47 }
48 case wxSYS_COLOUR_BTNSHADOW:
49 return wxColor( 0x44 , 0x44 , 0x44 ) ;
50 break ;
51
52 case wxSYS_COLOUR_BTNTEXT:
53 case wxSYS_COLOUR_MENUTEXT:
54 case wxSYS_COLOUR_WINDOWTEXT:
55 case wxSYS_COLOUR_CAPTIONTEXT:
56 case wxSYS_COLOUR_INFOTEXT:
57 case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
58 return *wxBLACK;
59 break ;
60 case wxSYS_COLOUR_HIGHLIGHT:
61 {
62 RGBColor hilite ;
63 LMGetHiliteRGB(&hilite) ;
64 return wxColor( hilite.red >> 8 , hilite.green >> 8 , hilite.blue >> 8 ) ;
65 }
66 break ;
67 case wxSYS_COLOUR_BTNHIGHLIGHT:
68 case wxSYS_COLOUR_GRAYTEXT:
69 return wxColor( 0xCC , 0xCC , 0xCC ) ;
70 break ;
71
72 case wxSYS_COLOUR_3DDKSHADOW:
73 return wxColor( 0x44 , 0x44 , 0x44 ) ;
74 break ;
75 case wxSYS_COLOUR_3DLIGHT:
76 return wxColor( 0xCC , 0xCC , 0xCC ) ;
77 break ;
78 case wxSYS_COLOUR_HIGHLIGHTTEXT :
79 {
80 RGBColor hilite ;
81 LMGetHiliteRGB(&hilite) ;
82 if ( ( hilite.red + hilite.green + hilite.blue ) == 0 )
83 return *wxWHITE ;
84 else
85 return *wxBLACK ;
86 }
87 break ;
88 case wxSYS_COLOUR_INFOBK :
89 case wxSYS_COLOUR_APPWORKSPACE:
90 return *wxWHITE ;
91 break ;
92 }
93 return *wxWHITE;
94 }
95
96 wxFont wxSystemSettings::GetSystemFont(int index)
97 {
98 switch (index)
99 {
100 case wxSYS_ANSI_VAR_FONT :
101 case wxSYS_SYSTEM_FONT :
102 case wxSYS_DEVICE_DEFAULT_FONT :
103 case wxSYS_DEFAULT_GUI_FONT :
104 {
105 return *wxSMALL_FONT ;
106 } ;
107 break ;
108 case wxSYS_OEM_FIXED_FONT :
109 case wxSYS_ANSI_FIXED_FONT :
110 case wxSYS_SYSTEM_FIXED_FONT :
111 default :
112 {
113 return *wxNORMAL_FONT ;
114 } ;
115 break ;
116
117 }
118 return *wxNORMAL_FONT;
119 }
120
121 // Get a system metric, e.g. scrollbar size
122 int wxSystemSettings::GetSystemMetric(int index)
123 {
124 switch ( index)
125 {
126 case wxSYS_MOUSE_BUTTONS:
127 return 2; // we emulate a two button mouse (ctrl + click = right button )
128 case wxSYS_BORDER_X:
129 // TODO
130 return 0;
131 case wxSYS_BORDER_Y:
132 // TODO
133 return 0;
134 case wxSYS_CURSOR_X:
135 // TODO
136 return 0;
137 case wxSYS_CURSOR_Y:
138 // TODO
139 return 0;
140 case wxSYS_DCLICK_X:
141 // TODO
142 return 0;
143 case wxSYS_DCLICK_Y:
144 // TODO
145 return 0;
146 case wxSYS_DRAG_X:
147 // TODO
148 return 0;
149 case wxSYS_DRAG_Y:
150 // TODO
151 return 0;
152 case wxSYS_EDGE_X:
153 // TODO
154 return 0;
155 case wxSYS_EDGE_Y:
156 // TODO
157 return 0;
158 case wxSYS_HSCROLL_ARROW_X:
159 return 16;
160 case wxSYS_HSCROLL_ARROW_Y:
161 return 16;
162 case wxSYS_HTHUMB_X:
163 return 16;
164 case wxSYS_ICON_X:
165 // TODO
166 return 0;
167 case wxSYS_ICON_Y:
168 // TODO
169 return 0;
170 case wxSYS_ICONSPACING_X:
171 // TODO
172 return 0;
173 case wxSYS_ICONSPACING_Y:
174 // TODO
175 return 0;
176 case wxSYS_WINDOWMIN_X:
177 // TODO
178 return 0;
179 case wxSYS_WINDOWMIN_Y:
180 // TODO
181 return 0;
182 case wxSYS_SCREEN_X:
183 // TODO
184 return 0;
185 case wxSYS_SCREEN_Y:
186 // TODO
187 return 0;
188 case wxSYS_FRAMESIZE_X:
189 // TODO
190 return 0;
191 case wxSYS_FRAMESIZE_Y:
192 // TODO
193 return 0;
194 case wxSYS_SMALLICON_X:
195 // TODO
196 return 0;
197 case wxSYS_SMALLICON_Y:
198 // TODO
199 return 0;
200 case wxSYS_HSCROLL_Y:
201 return 16;
202 case wxSYS_VSCROLL_X:
203 return 16;
204 case wxSYS_VSCROLL_ARROW_X:
205 return 16;
206 case wxSYS_VSCROLL_ARROW_Y:
207 return 16;
208 case wxSYS_VTHUMB_Y:
209 return 16;
210 case wxSYS_CAPTION_Y:
211 // TODO
212 return 0;
213 case wxSYS_MENU_Y:
214 // TODO
215 return 0;
216 case wxSYS_NETWORK_PRESENT:
217 // TODO
218 return 0;
219 case wxSYS_PENWINDOWS_PRESENT:
220 return 0;
221 case wxSYS_SHOW_SOUNDS:
222 // TODO
223 return 0;
224 case wxSYS_SWAP_BUTTONS:
225 return 0;
226 default:
227 return 0;
228 }
229 return 0;
230 }
231
232 bool wxSystemSettings::GetCapability(int index)
233 {
234 switch (index)
235 {
236 case wxSYS_CAN_ICONIZE_FRAME:
237 case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
238 return TRUE; break;
239 default:
240 return FALSE;
241 }
242 }