+const char * const MDI = "mdi";
+const char * const SDI = "sdi";
+const char * const SINGLE = "single";
+
+} // namespace CmdLineOption
+
+void MyApp::OnInitCmdLine(wxCmdLineParser& parser)
+{
+ wxApp::OnInitCmdLine(parser);
+
+ parser.AddSwitch("", CmdLineOption::MDI,
+ "run in MDI mode: multiple documents, single window");
+ parser.AddSwitch("", CmdLineOption::SDI,
+ "run in SDI mode: multiple documents, multiple windows");
+ parser.AddSwitch("", CmdLineOption::SINGLE,
+ "run in single document mode");
+}
+
+bool MyApp::OnCmdLineParsed(wxCmdLineParser& parser)
+{
+ int numModeOptions = 0;
+
+#if wxUSE_MDI_ARCHITECTURE
+ if ( parser.Found(CmdLineOption::MDI) )
+ {
+ m_mode = Mode_MDI;
+ numModeOptions++;
+ }
+#endif // wxUSE_MDI_ARCHITECTURE
+
+ if ( parser.Found(CmdLineOption::SDI) )
+ {
+ m_mode = Mode_SDI;
+ numModeOptions++;
+ }
+
+ if ( parser.Found(CmdLineOption::SINGLE) )
+ {
+ m_mode = Mode_Single;
+ numModeOptions++;
+ }