- CreateStatusBar(2);
-
- // Make a menubar
- wxMenu *fileMenu = new wxMenu;
- fileMenu->Append(SPLIT_VERTICAL, "Split &Vertically\tCtrl-V", "Split vertically");
- fileMenu->Append(SPLIT_HORIZONTAL, "Split &Horizontally\tCtrl-H", "Split horizontally");
- fileMenu->Append(SPLIT_UNSPLIT, "&Unsplit\tCtrl-U", "Unsplit");
- fileMenu->AppendSeparator();
- fileMenu->Append(SPLIT_SETMINSIZE, "Set &min size", "Set minimum pane size");
- fileMenu->AppendSeparator();
- fileMenu->Append(SPLIT_QUIT, "E&xit\tAlt-X", "Exit");
-
- wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(fileMenu, "&File");
-
- SetMenuBar(menuBar);
-
- m_splitter = new MySplitterWindow(this, SPLITTER_WINDOW);
+ SetIcon(wxICON(sample));
+
+#if wxUSE_STATUSBAR
+ CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
+
+ // Make a menubar
+ wxMenu *splitMenu = new wxMenu;
+ splitMenu->Append(SPLIT_VERTICAL,
+ wxT("Split &Vertically\tCtrl-V"),
+ wxT("Split vertically"));
+ splitMenu->Append(SPLIT_HORIZONTAL,
+ wxT("Split &Horizontally\tCtrl-H"),
+ wxT("Split horizontally"));
+ splitMenu->Append(SPLIT_UNSPLIT,
+ wxT("&Unsplit\tCtrl-U"),
+ wxT("Unsplit"));
+ splitMenu->AppendCheckItem(SPLIT_INVISIBLE,
+ wxT("Toggle sash &invisibility\tCtrl-I"),
+ wxT("Toggle sash invisibility"));
+ splitMenu->AppendSeparator();
+
+ splitMenu->AppendCheckItem(SPLIT_LIVE,
+ wxT("&Live update\tCtrl-L"),
+ wxT("Toggle live update mode"));
+ splitMenu->AppendCheckItem(SPLIT_BORDER,
+ wxT("3D &Border"),
+ wxT("Toggle wxSP_BORDER flag"));
+ splitMenu->Check(SPLIT_BORDER, true);
+ splitMenu->AppendCheckItem(SPLIT_3DSASH,
+ wxT("&3D Sash"),
+ wxT("Toggle wxSP_3DSASH flag"));
+ splitMenu->Check(SPLIT_3DSASH, true);
+ splitMenu->Append(SPLIT_SETPOSITION,
+ wxT("Set splitter &position\tCtrl-P"),
+ wxT("Set the splitter position"));
+ splitMenu->Append(SPLIT_SETMINSIZE,
+ wxT("Set &min size\tCtrl-M"),
+ wxT("Set minimum pane size"));
+ splitMenu->Append(SPLIT_SETGRAVITY,
+ wxT("Set &gravity\tCtrl-G"),
+ wxT("Set gravity of sash"));
+ splitMenu->AppendSeparator();
+
+ splitMenu->Append(SPLIT_REPLACE,
+ wxT("&Replace right window"),
+ wxT("Replace right window"));
+ splitMenu->AppendSeparator();
+
+ splitMenu->Append(SPLIT_QUIT, wxT("E&xit\tAlt-X"), wxT("Exit"));
+
+ wxMenuBar *menuBar = new wxMenuBar;
+ menuBar->Append(splitMenu, wxT("&Splitter"));
+
+ SetMenuBar(menuBar);
+
+ menuBar->Check(SPLIT_LIVE, true);
+ m_splitter = new MySplitterWindow(this);
+
+ // If you use non-zero gravity you must initialize the splitter with its
+ // correct initial size, otherwise it will change the sash position by a
+ // huge amount when it's resized from its initial default size to its real
+ // size when the frame lays it out. This wouldn't be necessary if default
+ // zero gravity were used (although it would do no harm neither).
+ m_splitter->SetSize(GetClientSize());
+ m_splitter->SetSashGravity(1.0);