X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ceb8f94a9603ac6fc1778799587af3b0ac215aa9..f8405d6e6fc2a361d9710dfdaea0b158952803aa:/src/os2/utils.cpp diff --git a/src/os2/utils.cpp b/src/os2/utils.cpp index 1d01ee094f..9a91d673ab 100644 --- a/src/os2/utils.cpp +++ b/src/os2/utils.cpp @@ -45,7 +45,7 @@ #include #endif -static const wxChar WX_SECTION[] = _T("wxWindows"); +static const wxChar WX_SECTION[] = _T("wxWidgets"); static const wxChar eHOSTNAME[] = _T("HostName"); static const wxChar eUSERID[] = _T("UserId"); static const wxChar eUSERNAME[] = _T("UserName"); @@ -83,13 +83,13 @@ bool wxGetHostName( if ((zSysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL) { - ULONG n = ::PrfQueryProfileString( HINI_PROFILE - ,(PSZ)WX_SECTION - ,(PSZ)eHOSTNAME - ,(PSZ)zDefaultHost - ,(void*)zBuf - ,(ULONG)nMaxSize - 1 - ); + ::PrfQueryProfileString( HINI_PROFILE + ,(PSZ)WX_SECTION + ,(PSZ)eHOSTNAME + ,(PSZ)zDefaultHost + ,(void*)zBuf + ,(ULONG)nMaxSize - 1 + ); } else wxStrncpy(zBuf, zSysname, nMaxSize - 1); @@ -303,7 +303,7 @@ void wxError( , const wxString& rTitle ) { - wxBuffer = new wxChar[256]; + wxChar *wxBuffer = new wxChar[256]; wxSprintf(wxBuffer, "%s\nContinue?", WXSTRINGCAST rMsg); if (::WinMessageBox( HWND_DESKTOP ,NULL @@ -342,6 +342,15 @@ void wxBell() DosBeep(1000,1000); // 1kHz during 1 sec. } + +void wxAppTraits::InitializeGui(unsigned long &ulHab) +{ +} + +void wxAppTraits::TerminateGui(unsigned long ulHab) +{ +} + wxToolkitInfo & wxConsoleAppTraits::GetToolkitInfo() { static wxToolkitInfo vInfo; @@ -371,18 +380,24 @@ const wxChar* wxGetHomeDir( wxString& rStrDir = *pStr; // OS/2 has no idea about home, - // so use the working directory instead? + // so use the working directory instead. + // However, we might have a valid HOME directory, + // as is used on many machines that have unix utilities + // on them, so we should use that, if available. // 256 was taken from os2def.h #ifndef MAX_PATH # define MAX_PATH 256 #endif - char zDirName[256]; - ULONG ulDirLen; + const wxChar *szHome = wxGetenv("HOME"); + if ( szHome == NULL ) { + // we're homeless, use current directory. + rStrDir = wxT("."); + } + else + rStrDir = szHome; - ::DosQueryCurrentDir(0, zDirName, &ulDirLen); - rStrDir = zDirName; return rStrDir.c_str(); } @@ -394,7 +409,7 @@ wxChar* wxGetUserHome ( wxChar* zHome; wxString sUser1(rUser); - wxBuffer = new wxChar[256]; + char *wxBuffer = new wxChar[256]; #ifndef __EMX__ if (sUser1 != _T("")) {