]> git.saurik.com Git - wxWidgets.git/blame - src/mgl/settings.cpp
initialize send_event field of GdkEventExpose we generate (bug 1245864) (Robert,...
[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$
c41c20a5 5// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
65571936 6// Licence: wxWindows licence
32b8ec41
VZ
7/////////////////////////////////////////////////////////////////////////////
8
9
14f355c2 10#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
32b8ec41
VZ
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"
0ab5e0e8 24#include "wx/gdicmn.h"
8fbdfa4f
VS
25#include "wx/module.h"
26
27// ----------------------------------------------------------------------------
28// global data
29// ----------------------------------------------------------------------------
30
31static wxFont *gs_fontDefault = NULL;
32
33class wxSystemSettingsModule : public wxModule
34{
35public:
36 virtual bool OnInit() { return TRUE; }
37 virtual void OnExit()
38 {
39 delete gs_fontDefault;
40 gs_fontDefault = NULL;
41 }
42
43private:
44 DECLARE_DYNAMIC_CLASS(wxSystemSettingsModule)
45};
46
47IMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule, wxModule)
48
49
32b8ec41 50
0ab5e0e8 51wxColour wxSystemSettingsNative::GetColour(wxSystemColour WXUNUSED(index))
7bdc1879 52{
0ab5e0e8 53 // not implemented, the mean is in wxUniversal
ef344ff8 54 return wxColour(0,0,0);
7bdc1879
VS
55}
56
0ab5e0e8 57wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
7bdc1879 58{
5acaf196 59 switch (index)
8fbdfa4f 60 {
5acaf196
VS
61 case wxSYS_OEM_FIXED_FONT:
62 case wxSYS_ANSI_FIXED_FONT:
63 case wxSYS_SYSTEM_FIXED_FONT:
64 {
65 return *wxNORMAL_FONT;
66 }
67 case wxSYS_ANSI_VAR_FONT:
68 case wxSYS_SYSTEM_FONT:
69 case wxSYS_DEVICE_DEFAULT_FONT:
70 case wxSYS_DEFAULT_GUI_FONT:
71 {
72 if ( !gs_fontDefault )
73 gs_fontDefault = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, "Arial");
74 return *gs_fontDefault;
75 }
76 default:
77 return wxNullFont;
8fbdfa4f 78 }
7bdc1879
VS
79}
80
9b0b5ba7 81int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win))
7bdc1879 82{
5acaf196
VS
83 int val;
84
85 switch (index)
86 {
87 case wxSYS_SCREEN_X:
88 wxDisplaySize(&val, NULL);
89 return val;
90 case wxSYS_SCREEN_Y:
91 wxDisplaySize(NULL, &val);
92 return val;
93 case wxSYS_VSCROLL_X:
94 case wxSYS_HSCROLL_Y:
95 return 15;
96 break;
97 default:
1d451c5b 98 return -1; // unsupported metric
5acaf196 99 }
7bdc1879 100}
253293c1 101
0ab5e0e8 102bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
253293c1
VS
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}