1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/settingsuniv.cpp
3 // Purpose: wxSystemSettings wxUniv-specific parts
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
28 #include "wx/settings.h"
29 #include "wx/gdicmn.h"
32 #include "wx/univ/colschem.h"
33 #include "wx/univ/theme.h"
34 #include "wx/univ/renderer.h"
36 // ============================================================================
38 // ============================================================================
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 wxColour
wxSystemSettings::GetColour(wxSystemColour index
)
46 // the elements of this enum must be kept in sync with wxSystemColour
47 static const wxColourScheme::StdColour s_mapSysToThemeCol
[] =
49 wxColourScheme::SCROLLBAR
/* wxSYS_COLOUR_SCROLLBAR */,
50 wxColourScheme::WINDOW
/* wxSYS_COLOUR_BACKGROUND */,
51 wxColourScheme::TITLEBAR_ACTIVE_TEXT
/* wxSYS_COLOUR_ACTIVECAPTION */,
52 wxColourScheme::TITLEBAR_TEXT
/* wxSYS_COLOUR_INACTIVECAPTION */,
53 wxColourScheme::MAX
/* wxSYS_COLOUR_MENU */,
54 wxColourScheme::MAX
/* wxSYS_COLOUR_WINDOW */,
55 wxColourScheme::MAX
/* wxSYS_COLOUR_WINDOWFRAME */,
56 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_MENUTEXT */,
57 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_WINDOWTEXT */,
58 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_CAPTIONTEXT */,
59 wxColourScheme::MAX
/* wxSYS_COLOUR_ACTIVEBORDER */,
60 wxColourScheme::MAX
/* wxSYS_COLOUR_INACTIVEBORDER */,
61 wxColourScheme::FRAME
/* wxSYS_COLOUR_APPWORKSPACE */,
62 wxColourScheme::HIGHLIGHT
/* wxSYS_COLOUR_HIGHLIGHT */,
63 wxColourScheme::HIGHLIGHT_TEXT
/* wxSYS_COLOUR_HIGHLIGHTTEXT */,
64 wxColourScheme::CONTROL
/* wxSYS_COLOUR_BTNFACE */,
65 wxColourScheme::SHADOW_DARK
/* wxSYS_COLOUR_BTNSHADOW */,
66 wxColourScheme::CONTROL_TEXT_DISABLED
/* wxSYS_COLOUR_GRAYTEXT */,
67 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_BTNTEXT */,
68 wxColourScheme::MAX
/* wxSYS_COLOUR_INACTIVECAPTIONTEXT */,
69 wxColourScheme::SHADOW_HIGHLIGHT
/* wxSYS_COLOUR_BTNHIGHLIGHT */,
70 wxColourScheme::SHADOW_DARK
/* wxSYS_COLOUR_3DDKSHADOW */,
71 wxColourScheme::SHADOW_OUT
/* wxSYS_COLOUR_3DLIGHT */,
72 wxColourScheme::MAX
/* wxSYS_COLOUR_INFOTEXT */,
73 wxColourScheme::MAX
/* wxSYS_COLOUR_INFOBK */,
74 wxColourScheme::WINDOW
/* wxSYS_COLOUR_LISTBOX */,
77 wxCHECK_MSG( index
< (int)WXSIZEOF(s_mapSysToThemeCol
), wxNullColour
,
78 wxT("invalid wxSystemColour") );
80 wxColourScheme::StdColour col
= s_mapSysToThemeCol
[index
];
81 if ( col
== wxColourScheme::MAX
)
83 // we don't have theme-equivalent for this colour
84 return wxSystemSettingsNative::GetColour(index
);
87 return wxTheme::Get()->GetColourScheme()->Get(col
);
90 int wxSystemSettings::GetMetric(wxSystemMetric index
, wxWindow
*win
)
95 return wxTheme::Get()->GetRenderer()->GetScrollbarArrowSize().x
;
97 return wxTheme::Get()->GetRenderer()->GetScrollbarArrowSize().y
;
100 return wxSystemSettingsNative::GetMetric(index
, win
);