]> git.saurik.com Git - wxWidgets.git/blame - src/common/settcmn.cpp
applying OSAF patch for "toolbar selection not correct on Mac after calling Realize...
[wxWidgets.git] / src / common / settcmn.cpp
CommitLineData
c15521c6
RR
1/////////////////////////////////////////////////////////////////////////////
2// Name: common/settcmn.cpp
3// Purpose: common (to all ports) wxWindow functions
4// Author: Robert Roebling
5// RCS-ID: $Id$
77ffb593 6// Copyright: (c) wxWidgets team
65571936 7// Licence: wxWindows licence
c15521c6
RR
8/////////////////////////////////////////////////////////////////////////////
9
10// ============================================================================
11// declarations
12// ============================================================================
13
14// ----------------------------------------------------------------------------
15// headers
16// ----------------------------------------------------------------------------
17
14f355c2 18#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
c15521c6
RR
19 #pragma implementation "settings.h"
20#endif
21
22// For compilers that support precompilation, includes "wx.h".
23#include "wx/wxprec.h"
24
25#ifdef __BORLANDC__
26 #pragma hdrstop
27#endif
28
29#ifndef WX_PRECOMP
30 #include "wx/defs.h"
31 #include "wx/utils.h"
32 #include "wx/settings.h"
33#endif //WX_PRECOMP
34
35// ----------------------------------------------------------------------------
36// static data
37// ----------------------------------------------------------------------------
38
41fecb44 39wxSystemScreenType wxSystemSettings::ms_screen = wxSYS_SCREEN_NONE;
c15521c6
RR
40
41// ----------------------------------------------------------------------------
42// ----------------------------------------------------------------------------
43
41fecb44 44wxSystemScreenType wxSystemSettings::GetScreenType()
c15521c6
RR
45{
46 if (ms_screen == wxSYS_SCREEN_NONE)
c15521c6
RR
47 {
48 // wxUniv will be used on small devices, too.
2b5f62a0 49 int x = GetMetric( wxSYS_SCREEN_X );
c15521c6
RR
50
51 ms_screen = wxSYS_SCREEN_DESKTOP;
d775fa82 52
c15521c6
RR
53 if (x < 800)
54 ms_screen = wxSYS_SCREEN_SMALL;
d775fa82 55
c15521c6
RR
56 if (x < 640)
57 ms_screen = wxSYS_SCREEN_PDA;
d775fa82 58
c15521c6
RR
59 if (x < 200)
60 ms_screen = wxSYS_SCREEN_TINY;
d775fa82 61
ca06ee0d
RR
62 // This is probably a bug, but VNC seems to report 0
63 if (x < 10)
64 ms_screen = wxSYS_SCREEN_DESKTOP;
c15521c6 65 }
c15521c6
RR
66
67 return ms_screen;
68}
d775fa82 69
41fecb44 70void wxSystemSettings::SetScreenType( wxSystemScreenType screen )
c15521c6
RR
71{
72 ms_screen = screen;
73}
74
ec157c8f
WS
75#if WXWIN_COMPATIBILITY_2_4
76
77wxColour wxSystemSettings::GetSystemColour(int index)
78{
79 return GetColour((wxSystemColour)index);
80}
81
82wxFont wxSystemSettings::GetSystemFont(int index)
83{
84 return GetFont((wxSystemFont)index);
85}
86
87int wxSystemSettings::GetSystemMetric(int index)
88{
89 return GetMetric((wxSystemMetric)index);
90}
91
92#endif // WXWIN_COMPATIBILITY_2_4