]> git.saurik.com Git - wxWidgets.git/blob - src/mgl/settings.cpp
2b074eb7134cb479a16a5fd958c83d37fd7cc83c
[wxWidgets.git] / src / mgl / settings.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: settings.h
3 // Author: Vaclav Slavik, Robert Roebling
4 // Id: $Id$
5 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9
10 #ifdef __GNUG__
11 #pragma implementation "settings.h"
12 #endif
13
14 // For compilers that support precompilation, includes "wx.h".
15 #include "wx/wxprec.h"
16
17 #ifdef __BORLANDC__
18 #pragma hdrstop
19 #endif
20
21 #include "wx/settings.h"
22 #include "wx/colour.h"
23 #include "wx/font.h"
24 #include "wx/module.h"
25
26 // ----------------------------------------------------------------------------
27 // global data
28 // ----------------------------------------------------------------------------
29
30 static wxFont *gs_fontDefault = NULL;
31
32 class wxSystemSettingsModule : public wxModule
33 {
34 public:
35 virtual bool OnInit() { return TRUE; }
36 virtual void OnExit()
37 {
38 delete gs_fontDefault;
39 gs_fontDefault = NULL;
40 }
41
42 private:
43 DECLARE_DYNAMIC_CLASS(wxSystemSettingsModule)
44 };
45
46 IMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule, wxModule)
47
48
49
50 wxColour wxSystemSettings::GetSystemColour(int WXUNUSED(index))
51 {
52 // FIXME_MGL
53 return wxColour(0,0,0);
54 }
55
56 wxFont wxSystemSettings::GetSystemFont(int index)
57 {
58 switch (index)
59 {
60 case wxSYS_OEM_FIXED_FONT:
61 case wxSYS_ANSI_FIXED_FONT:
62 case wxSYS_SYSTEM_FIXED_FONT:
63 {
64 return *wxNORMAL_FONT;
65 }
66 case wxSYS_ANSI_VAR_FONT:
67 case wxSYS_SYSTEM_FONT:
68 case wxSYS_DEVICE_DEFAULT_FONT:
69 case wxSYS_DEFAULT_GUI_FONT:
70 {
71 if ( !gs_fontDefault )
72 gs_fontDefault = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, "Arial");
73 return *gs_fontDefault;
74 }
75 default:
76 return wxNullFont;
77 }
78 }
79
80 int wxSystemSettings::GetSystemMetric(int WXUNUSED(index))
81 {
82 int val;
83
84 switch (index)
85 {
86 case wxSYS_SCREEN_X:
87 wxDisplaySize(&val, NULL);
88 return val;
89 case wxSYS_SCREEN_Y:
90 wxDisplaySize(NULL, &val);
91 return val;
92 case wxSYS_VSCROLL_X:
93 case wxSYS_HSCROLL_Y:
94 return 15;
95 break;
96 default:
97 wxCHECK_MSG(index, 0, wxT("wxSystemSettings::GetSystemMetric not fully implemented"));
98 return 0;
99 }
100 }
101
102 bool wxSystemSettings::GetCapability(int index)
103 {
104 switch (index)
105 {
106 case wxSYS_CAN_ICONIZE_FRAME:
107 return FALSE; break;
108 case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
109 return FALSE; break;
110 default:
111 return FALSE;
112 }
113 }