} m_statbarKind;
- void OnUpdateSetStatusTexts(wxUpdateUIEvent& event);
- void OnUpdateResetFieldsWidth(wxUpdateUIEvent& event);
- void OnUpdateSetStatusFields(wxUpdateUIEvent& event);
+ void OnUpdateForDefaultStatusbar(wxUpdateUIEvent& event);
void OnUpdateStatusBarToggle(wxUpdateUIEvent& event);
void OnUpdateSetStyleNormal(wxUpdateUIEvent& event);
void OnUpdateSetStyleFlat(wxUpdateUIEvent& event);
{
// menu items
StatusBar_Quit = 1,
+
StatusBar_SetFields,
StatusBar_SetTexts,
StatusBar_ResetFieldsWidth,
+
StatusBar_Recreate,
StatusBar_About,
StatusBar_Toggle,
EVT_MENU(StatusBar_SetStyleFlat, MyFrame::OnSetStyleFlat)
EVT_MENU(StatusBar_SetStyleRaised, MyFrame::OnSetStyleRaised)
- EVT_UPDATE_UI(StatusBar_ResetFieldsWidth, MyFrame::OnUpdateResetFieldsWidth)
+ EVT_UPDATE_UI_RANGE(StatusBar_SetFields, StatusBar_ResetFieldsWidth,
+ MyFrame::OnUpdateForDefaultStatusbar)
EVT_UPDATE_UI(StatusBar_Toggle, MyFrame::OnUpdateStatusBarToggle)
- EVT_UPDATE_UI(StatusBar_SetTexts, MyFrame::OnUpdateSetStatusTexts)
- EVT_UPDATE_UI(StatusBar_SetFields, MyFrame::OnUpdateSetStatusFields)
EVT_UPDATE_UI(StatusBar_SetStyleNormal, MyFrame::OnUpdateSetStyleNormal)
EVT_UPDATE_UI(StatusBar_SetStyleFlat, MyFrame::OnUpdateSetStyleFlat)
EVT_UPDATE_UI(StatusBar_SetStyleRaised, MyFrame::OnUpdateSetStyleRaised)
// main frame - event handlers
// ----------------------------------------------------------------------------
-void MyFrame::OnUpdateSetStatusTexts(wxUpdateUIEvent& event)
+void MyFrame::OnUpdateForDefaultStatusbar(wxUpdateUIEvent& event)
{
- // only allow the settings of the text of status fields for the default
- // status bar
+ // only allow this feature for the default status bar
wxStatusBar *sb = GetStatusBar();
event.Enable(sb == m_statbarDefault);
}
}
}
-void MyFrame::OnUpdateSetStatusFields(wxUpdateUIEvent& event)
-{
- // only allow the settings of the number of status fields for the default
- // status bar
- wxStatusBar *sb = GetStatusBar();
- event.Enable(sb == m_statbarDefault);
-}
-
void MyFrame::OnSetStatusFields(wxCommandEvent& WXUNUSED(event))
{
wxStatusBar *sb = GetStatusBar();
}
}
-void MyFrame::OnUpdateResetFieldsWidth(wxUpdateUIEvent& event)
-{
- // only allow the settings of the number of status fields for the default
- // status bar
- wxStatusBar *sb = GetStatusBar();
- event.Enable(sb == m_statbarDefault);
-}
-
void MyFrame::OnResetFieldsWidth(wxCommandEvent& WXUNUSED(event))
{
wxStatusBar *pStat = GetStatusBar();
#endif
wxRect rect;
- GetFieldRect(Field_Checkbox, rect);
+ if (!GetFieldRect(Field_Checkbox, rect))
+ {
+ event.Skip();
+ return;
+ }
#if wxUSE_CHECKBOX
m_checkbox->SetSize(rect.x + 2, rect.y + 2, rect.width - 4, rect.height - 4);