]> git.saurik.com Git - wxWidgets.git/blame - src/mgl/settings.cpp
making generic file dialog less Unixcentric
[wxWidgets.git] / src / mgl / settings.cpp
CommitLineData
32b8ec41 1/////////////////////////////////////////////////////////////////////////////
7bdc1879 2// Name: settings.h
5acaf196 3// Author: Vaclav Slavik, Robert Roebling
32b8ec41 4// Id: $Id$
7bdc1879 5// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
32b8ec41
VZ
6// Licence: wxWindows licence
7/////////////////////////////////////////////////////////////////////////////
8
9
10#ifdef __GNUG__
11#pragma implementation "settings.h"
12#endif
13
a246f95e
VS
14// For compilers that support precompilation, includes "wx.h".
15#include "wx/wxprec.h"
16
17#ifdef __BORLANDC__
18 #pragma hdrstop
19#endif
20
32b8ec41 21#include "wx/settings.h"
7bdc1879
VS
22#include "wx/colour.h"
23#include "wx/font.h"
8fbdfa4f
VS
24#include "wx/module.h"
25
26// ----------------------------------------------------------------------------
27// global data
28// ----------------------------------------------------------------------------
29
30static wxFont *gs_fontDefault = NULL;
31
32class wxSystemSettingsModule : public wxModule
33{
34public:
35 virtual bool OnInit() { return TRUE; }
36 virtual void OnExit()
37 {
38 delete gs_fontDefault;
39 gs_fontDefault = NULL;
40 }
41
42private:
43 DECLARE_DYNAMIC_CLASS(wxSystemSettingsModule)
44};
45
46IMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule, wxModule)
47
48
32b8ec41 49
7bdc1879
VS
50wxColour wxSystemSettings::GetSystemColour(int WXUNUSED(index))
51{
52 // FIXME_MGL
ef344ff8 53 return wxColour(0,0,0);
7bdc1879
VS
54}
55
8fbdfa4f 56wxFont wxSystemSettings::GetSystemFont(int index)
7bdc1879 57{
5acaf196 58 switch (index)
8fbdfa4f 59 {
5acaf196
VS
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;
8fbdfa4f 77 }
7bdc1879
VS
78}
79
80int wxSystemSettings::GetSystemMetric(int WXUNUSED(index))
81{
5acaf196
VS
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 }
7bdc1879 100}
253293c1
VS
101
102bool 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}