1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/settingsuniv.cpp
3 // Purpose: wxSystemSettings wxUniv-specific parts
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ===========================================================================
13 // ===========================================================================
15 // ---------------------------------------------------------------------------
17 // ---------------------------------------------------------------------------
19 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
27 #include "wx/settings.h"
28 #include "wx/gdicmn.h"
31 #include "wx/univ/colschem.h"
32 #include "wx/univ/theme.h"
33 #include "wx/univ/renderer.h"
35 // ============================================================================
37 // ============================================================================
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
43 wxColour
wxSystemSettings::GetColour(wxSystemColour index
)
45 // the elements of this enum must be kept in sync with wxSystemColour
46 static const wxColourScheme::StdColour s_mapSysToThemeCol
[] =
48 wxColourScheme::SCROLLBAR
/* wxSYS_COLOUR_SCROLLBAR */,
49 wxColourScheme::WINDOW
/* wxSYS_COLOUR_BACKGROUND */,
50 wxColourScheme::TITLEBAR_ACTIVE_TEXT
/* wxSYS_COLOUR_ACTIVECAPTION */,
51 wxColourScheme::TITLEBAR_TEXT
/* wxSYS_COLOUR_INACTIVECAPTION */,
52 wxColourScheme::MAX
/* wxSYS_COLOUR_MENU */,
53 wxColourScheme::MAX
/* wxSYS_COLOUR_WINDOW */,
54 wxColourScheme::MAX
/* wxSYS_COLOUR_WINDOWFRAME */,
55 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_MENUTEXT */,
56 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_WINDOWTEXT */,
57 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_CAPTIONTEXT */,
58 wxColourScheme::MAX
/* wxSYS_COLOUR_ACTIVEBORDER */,
59 wxColourScheme::MAX
/* wxSYS_COLOUR_INACTIVEBORDER */,
60 wxColourScheme::FRAME
/* wxSYS_COLOUR_APPWORKSPACE */,
61 wxColourScheme::HIGHLIGHT
/* wxSYS_COLOUR_HIGHLIGHT */,
62 wxColourScheme::HIGHLIGHT_TEXT
/* wxSYS_COLOUR_HIGHLIGHTTEXT */,
63 wxColourScheme::CONTROL
/* wxSYS_COLOUR_BTNFACE */,
64 wxColourScheme::SHADOW_DARK
/* wxSYS_COLOUR_BTNSHADOW */,
65 wxColourScheme::CONTROL_TEXT_DISABLED
/* wxSYS_COLOUR_GRAYTEXT */,
66 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_BTNTEXT */,
67 wxColourScheme::MAX
/* wxSYS_COLOUR_INACTIVECAPTIONTEXT */,
68 wxColourScheme::SHADOW_HIGHLIGHT
/* wxSYS_COLOUR_BTNHIGHLIGHT */,
69 wxColourScheme::SHADOW_DARK
/* wxSYS_COLOUR_3DDKSHADOW */,
70 wxColourScheme::SHADOW_OUT
/* wxSYS_COLOUR_3DLIGHT */,
71 wxColourScheme::MAX
/* wxSYS_COLOUR_INFOTEXT */,
72 wxColourScheme::MAX
/* wxSYS_COLOUR_INFOBK */,
73 wxColourScheme::WINDOW
/* wxSYS_COLOUR_LISTBOX */,
74 wxColourScheme::MAX
/* wxSYS_COLOUR_HOTLIGHT */,
75 wxColourScheme::TITLEBAR_ACTIVE_TEXT
/* wxSYS_COLOUR_GRADIENTACTIVECAPTION */,
76 wxColourScheme::TITLEBAR_TEXT
/* wxSYS_COLOUR_GRADIENTINACTIVECAPTION */,
77 wxColourScheme::MAX
/* wxSYS_COLOUR_MENUHILIGHT */,
78 wxColourScheme::MAX
/* wxSYS_COLOUR_MENUBAR */,
79 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_LISTBOXTEXT */,
80 wxColourScheme::HIGHLIGHT_TEXT
/* wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT */
83 wxCOMPILE_TIME_ASSERT( WXSIZEOF(s_mapSysToThemeCol
) == wxSYS_COLOUR_MAX
,
86 wxCHECK_MSG( index
< (int)WXSIZEOF(s_mapSysToThemeCol
), wxNullColour
,
87 wxT("invalid wxSystemColour") );
89 wxColourScheme::StdColour col
= s_mapSysToThemeCol
[index
];
90 if ( col
== wxColourScheme::MAX
)
92 // we don't have theme-equivalent for this colour
93 return wxSystemSettingsNative::GetColour(index
);
96 return wxTheme::Get()->GetColourScheme()->Get(col
);
99 int wxSystemSettings::GetMetric(wxSystemMetric index
, wxWindow
*win
)
103 case wxSYS_VSCROLL_X
:
104 return wxTheme::Get()->GetRenderer()->GetScrollbarArrowSize().x
;
105 case wxSYS_HSCROLL_Y
:
106 return wxTheme::Get()->GetRenderer()->GetScrollbarArrowSize().y
;
109 return wxSystemSettingsNative::GetMetric(index
, win
);