X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be5a51fb592f3fa2ba38ac6cd1e488d6d806058c..6ce8b8484654b5ab073951373c93d9bdd8221881:/utils/emulator/src/emulator.cpp diff --git a/utils/emulator/src/emulator.cpp b/utils/emulator/src/emulator.cpp index 7b8e35d6ea..d316d3a146 100644 --- a/utils/emulator/src/emulator.cpp +++ b/utils/emulator/src/emulator.cpp @@ -13,10 +13,6 @@ // declarations // ============================================================================ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "emulator.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -77,14 +73,14 @@ IMPLEMENT_APP(wxEmulatorApp) static const wxCmdLineEntryDesc sg_cmdLineDesc[] = { - { wxCMD_LINE_OPTION, _T("u"), _T("use-display"), _T("display number to use (default 100)") }, + { wxCMD_LINE_OPTION, _T("u"), _T("use-display"), _T("display number to use (default 100)"), (wxCmdLineParamType)0, 0 }, - { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("displays help on the command line parameters") }, - { wxCMD_LINE_SWITCH, _T("v"), _T("version"), _T("print version") }, + { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("displays help on the command line parameters"), (wxCmdLineParamType)0, 0 }, + { wxCMD_LINE_SWITCH, _T("v"), _T("version"), _T("print version"), (wxCmdLineParamType)0, 0 }, { wxCMD_LINE_PARAM, NULL, NULL, _T("config file 1"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, - { wxCMD_LINE_NONE } + { wxCMD_LINE_NONE, NULL, NULL, NULL, (wxCmdLineParamType)0, 0 } }; @@ -108,7 +104,9 @@ wxEmulatorApp::wxEmulatorApp() // 'Main program' equivalent: the program execution "starts" here bool wxEmulatorApp::OnInit() { +#if wxUSE_LOG wxLog::SetTimestamp(NULL); +#endif // wxUSE_LOG wxInitAllImageHandlers(); wxString currentDir = wxGetCwd(); @@ -180,12 +178,14 @@ bool wxEmulatorApp::OnInit() wxEmulatorFrame *frame = new wxEmulatorFrame(_T("wxEmulator"), wxPoint(50, 50), wxSize(450, 340)); +#if wxUSE_STATUSBAR frame->SetStatusText(m_emulatorInfo.m_emulatorTitle, 0); wxString sizeStr; sizeStr.Printf(wxT("Screen: %dx%d"), (int) m_emulatorInfo.m_emulatorScreenSize.x, (int) m_emulatorInfo.m_emulatorScreenSize.y); frame->SetStatusText(sizeStr, 1); +#endif // wxUSE_STATUSBAR m_containerWindow = new wxEmulatorContainer(frame, wxID_ANY); @@ -483,7 +483,7 @@ bool wxEmulatorInfo::Load(const wxString& appDir) m_emulatorScreenSize = wxSize(w, h); } - if (!m_emulatorBackgroundBitmapName.IsEmpty()) + if (!m_emulatorBackgroundBitmapName.empty()) { wxString absoluteBackgroundBitmapName = rootPath + wxString(wxFILE_SEP_PATH) + m_emulatorBackgroundBitmapName; if ( !wxFile::Exists(absoluteBackgroundBitmapName) ) @@ -553,9 +553,9 @@ wxString wxColourToHexString(const wxColour& col) // Convert 6-digit hex string to a colour wxColour wxHexStringToColour(const wxString& hex) { - unsigned int r = wxHexToDec(hex.Mid(0, 2)); - unsigned int g = wxHexToDec(hex.Mid(2, 2)); - unsigned int b = wxHexToDec(hex.Mid(4, 2)); + unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2)); + unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2)); + unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2)); return wxColour(r, g, b); } @@ -571,10 +571,10 @@ wxString wxFindAppPath(const wxString& argv0, const wxString& cwd, const wxStrin wxString str; // Try appVariableName - if (!appVariableName.IsEmpty()) + if (!appVariableName.empty()) { str = wxGetenv(appVariableName); - if (!str.IsEmpty()) + if (!str.empty()) return str; } @@ -598,7 +598,7 @@ wxString wxFindAppPath(const wxString& argv0, const wxString& cwd, const wxStrin wxPathList pathList; pathList.AddEnvList(wxT("PATH")); str = pathList.FindAbsoluteValidPath(argv0); - if (!str.IsEmpty()) + if (!str.empty()) return wxPathOnly(str); // Failed