+void MyFrame::OnUpdateSetStyleNormal(wxUpdateUIEvent &event)
+{
+ event.Check(m_statbarStyle == wxSB_NORMAL);
+}
+
+void MyFrame::OnUpdateSetStyleFlat(wxUpdateUIEvent &event)
+{
+ event.Check(m_statbarStyle == wxSB_FLAT);
+}
+
+void MyFrame::OnUpdateSetStyleRaised(wxUpdateUIEvent &event)
+{
+ event.Check(m_statbarStyle == wxSB_RAISED);
+}
+
+void MyFrame::OnSetStyleNormal(wxCommandEvent & WXUNUSED(event))
+{
+ m_statbarStyle = wxSB_NORMAL;
+ ApplyStyle();
+}
+
+void MyFrame::OnSetStyleFlat(wxCommandEvent & WXUNUSED(event))
+{
+ m_statbarStyle = wxSB_FLAT;
+ ApplyStyle();
+}
+
+void MyFrame::OnSetStyleRaised(wxCommandEvent & WXUNUSED(event))
+{
+ m_statbarStyle = wxSB_RAISED;
+ ApplyStyle();
+}
+
+void MyFrame::ApplyStyle()
+{
+ wxStatusBar *sb = GetStatusBar();
+ int fields = sb->GetFieldsCount();
+ int *styles = new int[fields];
+
+ for (int i = 1; i < fields; i++)
+ styles[i] = wxSB_NORMAL;
+
+ styles[0] = m_statbarStyle;
+
+ sb->SetStatusStyles(fields, styles);
+
+ delete [] styles;
+}
+