Finished up utilities testing

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster 1999-11-11 04:40:29 +00:00
parent f28538c5f6
commit 13a4ea8d83
2 changed files with 34 additions and 7 deletions

View File

@ -76,7 +76,7 @@ wxApp *wxTheApp = NULL;
// FIXME why not const? and not static?
// NB: all "NoRedraw" classes must have the same names as the "normal" classes
// with NR suffix - wxWindow::MSWCreate() supposes this
// with NR suffix - wxWindow::OS2Create() supposes this
wxChar wxFrameClassName[] = wxT("wxFrameClass");
wxChar wxFrameClassNameNoRedraw[] = wxT("wxFrameClassNR");
wxChar wxMDIFrameClassName[] = wxT("wxMDIFrameClass");
@ -125,7 +125,7 @@ bool wxApp::Initialize()
// wxRedirectIOToConsole();
#endif
wxBuffer = new wxChar[1500]; // FIXME
wxBuffer = new wxChar[1500]; // FIXME; why?
wxClassInfo::InitializeClasses();

View File

@ -265,6 +265,7 @@ void wxError(
, const wxString& rTitle
)
{
wxBuffer = new wxChar[256];
wxSprintf(wxBuffer, "%s\nContinue?", WXSTRINGCAST rMsg);
if (::WinMessageBox( HWND_DESKTOP
,NULL
@ -273,6 +274,7 @@ void wxError(
,0
,MB_ICONEXCLAMATION | MB_YESNO
) == MBID_YES)
delete[] wxBuffer;
wxExit();
}
@ -469,6 +471,8 @@ bool wxGetResource(
)
{
wxChar* zStr = NULL;
zStr = new wxChar[1000];
bool bSucc = wxGetResource( rSection
,rEntry
,(wxChar **)&zStr
@ -481,7 +485,11 @@ bool wxGetResource(
delete[] zStr;
return TRUE;
}
else return FALSE;
else
{
delete[] zStr;
return FALSE;
}
}
bool wxGetResource(
@ -492,6 +500,8 @@ bool wxGetResource(
)
{
wxChar* zStr = NULL;
zStr = new wxChar[1000];
bool bSucc = wxGetResource( rSection
,rEntry
,(wxChar **)&zStr
@ -504,7 +514,11 @@ bool wxGetResource(
delete[] zStr;
return TRUE;
}
else return FALSE;
else
{
delete[] zStr;
return FALSE;
}
}
bool wxGetResource(
@ -515,6 +529,8 @@ bool wxGetResource(
)
{
wxChar* zStr = NULL;
zStr = new wxChar[1000];
bool bSucc = wxGetResource( rSection
,rEntry
,(wxChar **)&zStr
@ -527,7 +543,11 @@ bool wxGetResource(
delete[] zStr;
return TRUE;
}
else return FALSE;
else
{
delete[] zStr;
return FALSE;
}
}
#endif // wxUSE_RESOURCES
@ -603,6 +623,7 @@ wxChar* wxGetUserHome (
wxChar* zHome;
wxString sUser1(rUser);
wxBuffer = new wxChar[256];
if (sUser1 != _T(""))
{
wxChar zTmp[64];
@ -617,6 +638,7 @@ wxChar* wxGetUserHome (
if ((zHome = wxGetenv(_T("TMP"))) != NULL ||
(zHome = wxGetenv(_T("TMPDIR"))) != NULL ||
(zHome = wxGetenv(_T("TEMP"))) != NULL)
delete[] wxBuffer;
return *zHome ? zHome : (wxChar*)_T("\\");
}
if (wxStricmp(zTmp, WXSTRINGCAST sUser1) == 0)
@ -624,12 +646,17 @@ wxChar* wxGetUserHome (
}
}
if (sUser1 == _T(""))
{
if ((zHome = wxGetenv(_T("HOME"))) != NULL)
{
wxStrcpy(wxBuffer, zHome);
Unix2DosFilename(wxBuffer);
return wxBuffer;
wxStrcpy(zHome, wxBuffer);
delete[] wxBuffer;
return zHome;
}
}
delete[] wxBuffer;
return NULL; // No home known!
}