Fix wxStaticBox label redrawing when "Alt" is pressed in wxMSW.

The default handling for Alt key press in the standard control is to redraw
the label to account for showing of the keyboard queues (i.e. if the mnemonics
were initially hidden, they are shown when Alt is pressed) but it doesn't
redraw it in the correct colour resulting in any custom label colour being
lost whenever Alt is pressed anywhere in the window containing the box.

Fix this by forcing the box refresh which will result in repainting it using
our code which does use the correct colour.

Also update the static page of the widgets sample to allow changing the
colours of all static controls on this page, including the wxStaticBox, and
not just the main wxStaticText.

Closes #12497.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-09-21 11:44:41 +00:00
parent b89b24691e
commit 2af006ebd3
2 changed files with 30 additions and 0 deletions

View File

@@ -94,6 +94,18 @@ public:
virtual ~StaticWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_statText; }
virtual Widgets GetWidgets() const
{
Widgets widgets;
widgets.push_back(m_sizerStatBox->GetStaticBox());
widgets.push_back(m_statText);
widgets.push_back(m_statMarkup);
#if wxUSE_STATLINE
widgets.push_back(m_statLine);
#endif // wxUSE_STATLINE
return widgets;
}
virtual void RecreateWidget() { CreateStatic(); }
// lazy creation of the content