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