- // create the main application window
- wxEmulatorFrame *frame = new wxEmulatorFrame(_T("wxEmulator"),
- wxPoint(50, 50), wxSize(450, 340));
-
- m_containerWindow = new wxEmulatorContainer(frame, -1);
+ wxString currentDir = wxGetCwd();
+
+ // Use argv to get current app directory
+ m_appDir = wxFindAppPath(argv[0], currentDir, wxT("WXEMUDIR"));
+
+ // If the development version, go up a directory.
+#ifdef __WXMSW__
+ if ((m_appDir.Right(5).CmpNoCase("DEBUG") == 0) ||
+ (m_appDir.Right(11).CmpNoCase("DEBUGSTABLE") == 0) ||
+ (m_appDir.Right(7).CmpNoCase("RELEASE") == 0) ||
+ (m_appDir.Right(13).CmpNoCase("RELEASESTABLE") == 0)
+ )
+ m_appDir = wxPathOnly(m_appDir);
+#endif
+
+ // Parse the command-line parameters and options
+ wxCmdLineParser parser(sg_cmdLineDesc, argc, argv);
+ int res;
+ {
+ wxLogNull log;
+ res = parser.Parse();
+ }
+ if (res == -1 || res > 0 || parser.Found(wxT("h")))
+ {
+#ifdef __X__
+ wxLog::SetActiveTarget(new wxLogStderr);
+#endif
+ parser.Usage();
+ return FALSE;
+ }
+ if (parser.Found(wxT("v")))
+ {
+#ifdef __X__
+ wxLog::SetActiveTarget(new wxLogStderr);
+#endif
+ wxString msg;
+ msg.Printf(wxT("wxWindows PDA Emulator (c) Julian Smart, 2002 Version %.2f, %s"), wxEMULATOR_VERSION, __DATE__);
+ wxLogMessage(msg);
+ return FALSE;
+ }
+ if (parser.Found(wxT("u"), & m_displayNumber))
+ {
+ // Should only be number, so strip out anything before
+ // and including a : character
+ if (m_displayNumber.Find(wxT(':')) != -1)
+ {
+ m_displayNumber = m_displayNumber.AfterFirst(wxT(':'));
+ }
+ }
+ if (parser.GetParamCount() == 0)
+ {
+ m_emulatorInfo.m_emulatorFilename = wxT("default.wxe");
+ }
+ else if (parser.GetParamCount() > 0)
+ {
+ m_emulatorInfo.m_emulatorFilename = parser.GetParam(0);
+ }