+#endif // wxUSE_STATUSBAR
+}
+
+void MyFrame::OnSetGravity(wxCommandEvent& WXUNUSED(event) )
+{
+ wxString str;
+ str.Printf( wxT("%g"), m_splitter->GetSashGravity());
+#if wxUSE_TEXTDLG
+ str = wxGetTextFromUser(wxT("Enter sash gravity (0,1):"), wxT(""), str, this);
+#endif
+ if ( str.empty() )
+ return;
+
+ double gravity = wxStrtod( str, (wxChar**)NULL);
+ m_splitter->SetSashGravity(gravity);
+#if wxUSE_STATUSBAR
+ str.Printf( wxT("Gravity = %g"), gravity);
+ SetStatusText(str, 1);
+#endif // wxUSE_STATUSBAR
+}
+
+void MyFrame::OnReplace(wxCommandEvent& WXUNUSED(event) )
+{
+ if (m_replacewindow == NULL) {
+ m_replacewindow = m_splitter->GetWindow2();
+ m_splitter->ReplaceWindow(m_replacewindow, new wxPanel(m_splitter, wxID_ANY));
+ m_replacewindow->Hide();
+ } else {
+ wxWindow *empty = m_splitter->GetWindow2();
+ wxASSERT(empty != m_replacewindow);
+ m_splitter->ReplaceWindow(empty, m_replacewindow);
+ m_replacewindow->Show();
+ m_replacewindow = NULL;
+ empty->Destroy();
+ }