it is not possible to show/hide the window from the UpdateUI event handler; refactored the code by moving control-specific parts into the derived classes (patch 1338350)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37536 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -124,6 +124,32 @@ bool wxControlBase::SetFont(const wxFont& font)
|
||||
return wxWindow::SetFont(font);
|
||||
}
|
||||
|
||||
// wxControl-specific processing after processing the update event
|
||||
void wxControlBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
|
||||
{
|
||||
// call inherited
|
||||
wxWindowBase::DoUpdateWindowUI(event);
|
||||
|
||||
// update label
|
||||
if ( event.GetSetText() )
|
||||
{
|
||||
if ( event.GetText() != GetLabel() )
|
||||
SetLabel(event.GetText());
|
||||
}
|
||||
|
||||
// Unfortunately we don't yet have common base class for
|
||||
// wxRadioButton, so we handle updates of radiobuttons here.
|
||||
// TODO: If once wxRadioButtonBase will exist, move this code there.
|
||||
#if wxUSE_RADIOBTN
|
||||
if ( event.GetSetChecked() )
|
||||
{
|
||||
wxRadioButton *radiobtn = wxDynamicCastThis(wxRadioButton);
|
||||
if ( radiobtn )
|
||||
radiobtn->SetValue(event.GetChecked());
|
||||
}
|
||||
#endif // wxUSE_RADIOBTN
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStaticBitmap
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user