]> git.saurik.com Git - wxWidgets.git/blob - src/motif/settings.cpp
Prevent crash when m_defGridAttr is NULL
[wxWidgets.git] / src / motif / settings.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: settings.cpp
3 // Purpose: wxSettings
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // TODO: these settings should probably be configurable from some central or
13 // per-user file, which can be edited using a Windows-control-panel clone.
14 // Also they should be documented better. Some are very MS Windows-ish.
15
16 #ifdef __GNUG__
17 #pragma implementation "settings.h"
18 #endif
19
20 #include "wx/settings.h"
21 #include "wx/gdicmn.h"
22
23 wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
24 {
25 switch (index)
26 {
27 case wxSYS_COLOUR_WINDOW:
28 {
29 return *wxWHITE;
30 }
31 case wxSYS_COLOUR_SCROLLBAR:
32 // case wxSYS_COLOUR_DESKTOP: // Same as wxSYS_COLOUR_BACKGROUND
33 case wxSYS_COLOUR_BACKGROUND:
34 case wxSYS_COLOUR_ACTIVECAPTION:
35 case wxSYS_COLOUR_INACTIVECAPTION:
36 case wxSYS_COLOUR_MENU:
37 case wxSYS_COLOUR_WINDOWFRAME:
38 case wxSYS_COLOUR_ACTIVEBORDER:
39 case wxSYS_COLOUR_INACTIVEBORDER:
40 case wxSYS_COLOUR_BTNFACE:
41 // case wxSYS_COLOUR_3DFACE: // Same as wxSYS_COLOUR_BTNFACE
42 case wxSYS_COLOUR_GRAYTEXT:
43 {
44 return wxColour("LIGHT GREY");
45 }
46 case wxSYS_COLOUR_BTNSHADOW:
47 // case wxSYS_COLOUR_3DSHADOW: // Same as wxSYS_COLOUR_BTNSHADOW
48 {
49 return wxColour("GREY");
50 }
51 case wxSYS_COLOUR_3DDKSHADOW:
52 {
53 return *wxBLACK;
54 }
55 case wxSYS_COLOUR_HIGHLIGHT:
56 {
57 return *wxBLUE;
58 }
59 case wxSYS_COLOUR_BTNHIGHLIGHT:
60 case wxSYS_COLOUR_LISTBOX:
61 // case wxSYS_COLOUR_3DHIGHLIGHT: // Same as wxSYS_COLOUR_BTNHIGHLIGHT
62 {
63 return *wxWHITE;
64 }
65 case wxSYS_COLOUR_3DLIGHT:
66 {
67 return wxColour("LIGHT GREY");
68 }
69 case wxSYS_COLOUR_MENUTEXT:
70 case wxSYS_COLOUR_WINDOWTEXT:
71 case wxSYS_COLOUR_CAPTIONTEXT:
72 case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
73 case wxSYS_COLOUR_BTNTEXT:
74 case wxSYS_COLOUR_INFOTEXT:
75 {
76 return *wxBLACK;
77 }
78 case wxSYS_COLOUR_HIGHLIGHTTEXT:
79 {
80 return *wxWHITE;
81 }
82 case wxSYS_COLOUR_INFOBK:
83 case wxSYS_COLOUR_APPWORKSPACE:
84 {
85 return wxColour("LIGHT GREY");
86 // return *wxWHITE;
87 }
88 }
89 return *wxWHITE;
90 }
91
92 wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
93 {
94 switch (index)
95 {
96 case wxSYS_SYSTEM_FIXED_FONT:
97 {
98 return wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, FALSE);
99 break;
100 }
101 case wxSYS_DEVICE_DEFAULT_FONT:
102 case wxSYS_SYSTEM_FONT:
103 case wxSYS_DEFAULT_GUI_FONT:
104 default:
105 {
106 return wxFont(12, wxSWISS, wxNORMAL, wxNORMAL, FALSE);
107 break;
108 }
109 }
110
111 return wxFont();
112 }
113
114 // Get a system metric, e.g. scrollbar size
115 int wxSystemSettingsNative::GetMetric(wxSystemMetric index)
116 {
117 switch ( index)
118 {
119 case wxSYS_MOUSE_BUTTONS:
120 // TODO
121 return 0;
122 case wxSYS_BORDER_X:
123 // TODO
124 return 0;
125 case wxSYS_BORDER_Y:
126 // TODO
127 return 0;
128 case wxSYS_CURSOR_X:
129 // TODO
130 return 0;
131 case wxSYS_CURSOR_Y:
132 // TODO
133 return 0;
134 case wxSYS_DCLICK_X:
135 // TODO
136 return 0;
137 case wxSYS_DCLICK_Y:
138 // TODO
139 return 0;
140 case wxSYS_DRAG_X:
141 // TODO
142 return 0;
143 case wxSYS_DRAG_Y:
144 // TODO
145 return 0;
146 case wxSYS_EDGE_X:
147 // TODO
148 return 0;
149 case wxSYS_EDGE_Y:
150 // TODO
151 return 0;
152 case wxSYS_HSCROLL_ARROW_X:
153 // TODO
154 return 0;
155 case wxSYS_HSCROLL_ARROW_Y:
156 // TODO
157 return 0;
158 case wxSYS_HTHUMB_X:
159 // TODO
160 return 0;
161 case wxSYS_ICON_X:
162 // TODO
163 return 0;
164 case wxSYS_ICON_Y:
165 // TODO
166 return 0;
167 case wxSYS_ICONSPACING_X:
168 // TODO
169 return 0;
170 case wxSYS_ICONSPACING_Y:
171 // TODO
172 return 0;
173 case wxSYS_WINDOWMIN_X:
174 // TODO
175 return 0;
176 case wxSYS_WINDOWMIN_Y:
177 // TODO
178 return 0;
179 case wxSYS_SCREEN_X:
180 // TODO
181 return 0;
182 case wxSYS_SCREEN_Y:
183 // TODO
184 return 0;
185 case wxSYS_FRAMESIZE_X:
186 // TODO
187 return 0;
188 case wxSYS_FRAMESIZE_Y:
189 // TODO
190 return 0;
191 case wxSYS_SMALLICON_X:
192 // TODO
193 return 0;
194 case wxSYS_SMALLICON_Y:
195 // TODO
196 return 0;
197 case wxSYS_HSCROLL_Y:
198 // TODO
199 return 0;
200 case wxSYS_VSCROLL_X:
201 // TODO
202 return 0;
203 case wxSYS_VSCROLL_ARROW_X:
204 // TODO
205 return 0;
206 case wxSYS_VSCROLL_ARROW_Y:
207 // TODO
208 return 0;
209 case wxSYS_VTHUMB_Y:
210 // TODO
211 return 0;
212 case wxSYS_CAPTION_Y:
213 // TODO
214 return 0;
215 case wxSYS_MENU_Y:
216 // TODO
217 return 0;
218 case wxSYS_NETWORK_PRESENT:
219 // TODO
220 return 0;
221 case wxSYS_PENWINDOWS_PRESENT:
222 // TODO
223 return 0;
224 case wxSYS_SHOW_SOUNDS:
225 // TODO
226 return 0;
227 case wxSYS_SWAP_BUTTONS:
228 // TODO
229 return 0;
230 default:
231 return 0;
232 }
233 }
234
235 bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
236 {
237 switch (index)
238 {
239 case wxSYS_CAN_ICONIZE_FRAME:
240 case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
241 return TRUE;
242
243 default:
244 return FALSE;
245 }
246 }