Define colours for all wxSYS_COLOUR_XXX values in wxUniv.

Ensure that we have enough elements in the array used by
wxSystemSettings::GetColour() in wxUniv to avoid the assert which happened
when e.g. wxSYS_COLOUR_LISTBOXTEXT was requested from it. This resulted in
an infinite stream of asserts and a crash when trying to use wxTreeCtrl in
wxUniv.

Closes #11702.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-07-23 23:32:35 +00:00
parent e22fa4d7b2
commit 8121433030

View File

@ -72,8 +72,17 @@ wxColour wxSystemSettings::GetColour(wxSystemColour index)
wxColourScheme::MAX /* wxSYS_COLOUR_INFOTEXT */,
wxColourScheme::MAX /* wxSYS_COLOUR_INFOBK */,
wxColourScheme::WINDOW /* wxSYS_COLOUR_LISTBOX */,
wxColourScheme::MAX /* wxSYS_COLOUR_HOTLIGHT */,
wxColourScheme::TITLEBAR_ACTIVE_TEXT /* wxSYS_COLOUR_GRADIENTACTIVECAPTION */,
wxColourScheme::TITLEBAR_TEXT /* wxSYS_COLOUR_GRADIENTINACTIVECAPTION */,
wxColourScheme::MAX /* wxSYS_COLOUR_MENUHILIGHT */,
wxColourScheme::MAX /* wxSYS_COLOUR_MENUBAR */,
wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_LISTBOXTEXT */,
};
wxCOMPILE_TIME_ASSERT( WXSIZEOF(s_mapSysToThemeCol) == wxSYS_COLOUR_MAX,
StdColDefsMismatch );
wxCHECK_MSG( index < (int)WXSIZEOF(s_mapSysToThemeCol), wxNullColour,
wxT("invalid wxSystemColour") );