Allow testing hiding the widget in the widgets sample.
This provides a convenient way for testing that it actually works, which is currently not quite the case for wxSlider under OS X, see #2388.
This commit is contained in:
@@ -78,6 +78,7 @@ enum
|
||||
Widgets_SetPageBg,
|
||||
Widgets_SetFont,
|
||||
Widgets_Enable,
|
||||
Widgets_Show,
|
||||
|
||||
Widgets_BorderNone,
|
||||
Widgets_BorderStatic,
|
||||
@@ -172,6 +173,7 @@ protected:
|
||||
void OnSetPageBg(wxCommandEvent& event);
|
||||
void OnSetFont(wxCommandEvent& event);
|
||||
void OnEnable(wxCommandEvent& event);
|
||||
void OnShow(wxCommandEvent &event);
|
||||
void OnSetBorder(wxCommandEvent& event);
|
||||
void OnSetVariant(wxCommandEvent& event);
|
||||
|
||||
@@ -297,6 +299,7 @@ wxBEGIN_EVENT_TABLE(WidgetsFrame, wxFrame)
|
||||
EVT_MENU(Widgets_SetPageBg, WidgetsFrame::OnSetPageBg)
|
||||
EVT_MENU(Widgets_SetFont, WidgetsFrame::OnSetFont)
|
||||
EVT_MENU(Widgets_Enable, WidgetsFrame::OnEnable)
|
||||
EVT_MENU(Widgets_Show, WidgetsFrame::OnShow)
|
||||
|
||||
EVT_MENU_RANGE(Widgets_BorderNone, Widgets_BorderDefault,
|
||||
WidgetsFrame::OnSetBorder)
|
||||
@@ -396,6 +399,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
|
||||
menuWidget->Append(Widgets_SetPageBg, wxT("Set &page background...\tShift-Ctrl-B"));
|
||||
menuWidget->Append(Widgets_SetFont, wxT("Set f&ont...\tCtrl-O"));
|
||||
menuWidget->AppendCheckItem(Widgets_Enable, wxT("&Enable/disable\tCtrl-E"));
|
||||
menuWidget->AppendCheckItem(Widgets_Show, wxT("Show/Hide"));
|
||||
|
||||
wxMenu *menuBorders = new wxMenu;
|
||||
menuBorders->AppendRadioItem(Widgets_BorderDefault, wxT("De&fault\tCtrl-Shift-9"));
|
||||
@@ -447,6 +451,8 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
|
||||
SetMenuBar(mbar);
|
||||
|
||||
mbar->Check(Widgets_Enable, true);
|
||||
mbar->Check(Widgets_Show, true);
|
||||
|
||||
mbar->Check(Widgets_VariantNormal, true);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
@@ -880,6 +886,13 @@ void WidgetsFrame::OnEnable(wxCommandEvent& event)
|
||||
CurrentPage()->SetUpWidget();
|
||||
}
|
||||
|
||||
void WidgetsFrame::OnShow(wxCommandEvent &event)
|
||||
{
|
||||
WidgetsPage::GetAttrs().m_show = event.IsChecked();
|
||||
|
||||
CurrentPage()->SetUpWidget();
|
||||
}
|
||||
|
||||
void WidgetsFrame::OnSetBorder(wxCommandEvent& event)
|
||||
{
|
||||
int border;
|
||||
@@ -1276,6 +1289,7 @@ void WidgetsPage::SetUpWidget()
|
||||
|
||||
(*it)->SetLayoutDirection(GetAttrs().m_dir);
|
||||
(*it)->Enable(GetAttrs().m_enabled);
|
||||
(*it)->Show(GetAttrs().m_show);
|
||||
|
||||
if ( GetAttrs().m_cursor.IsOk() )
|
||||
{
|
||||
|
Reference in New Issue
Block a user