1) minor modifications in fileconf.cpp

2) new MSW function (private.h): wxGetWindowText() which works with wxString
   instead of (horror) fixed size buffers. All calls to ::GetWindowText()
   should be replaced with this!
3) remains of casts to float in different wxControl classes removed,
   (EDIT|BUTTON)_HEIGHT_FROM_CHAR_HEIGHT macros introduced (could be
   made inline functions as well...)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1998-09-20 21:13:46 +00:00
parent 803bf1c581
commit 1c4a764c98
11 changed files with 111 additions and 90 deletions

View File

@@ -54,6 +54,13 @@
// ----------------------------------------------------------------------------
#define CONST_CAST ((wxFileConfig *)this)->
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
#ifndef MAX_PATH
#define MAX_PATH 512
#endif
// ----------------------------------------------------------------------------
// global functions declarations
// ----------------------------------------------------------------------------
@@ -87,15 +94,10 @@ wxString wxFileConfig::GetGlobalDir()
#ifdef __UNIX__
strDir = "/etc/";
#elif defined(__WXSTUBS__)
// TODO
wxASSERT( TRUE ) ;
wxASSERT_MSG( FALSE, "TODO" ) ;
#else // Windows
#ifndef _MAX_PATH
#define _MAX_PATH 512
#endif
char szWinDir[_MAX_PATH];
::GetWindowsDirectory(szWinDir, _MAX_PATH);
char szWinDir[MAX_PATH];
::GetWindowsDirectory(szWinDir, MAX_PATH);
strDir = szWinDir;
strDir << '\\';
@@ -107,30 +109,8 @@ wxString wxFileConfig::GetGlobalDir()
wxString wxFileConfig::GetLocalDir()
{
wxString strDir;
#ifdef __UNIX__
const char *szHome = getenv("HOME");
if ( szHome == NULL ) {
// we're homeless...
wxLogWarning(_("can't find user's HOME, using current directory."));
strDir = ".";
}
else
strDir = szHome;
strDir << '/'; // a double slash is no problem, a missin one yes
#else // Windows
#ifdef __WIN32__
const char *szHome = getenv("HOMEDRIVE");
if ( szHome != NULL )
strDir << szHome;
szHome = getenv("HOMEPATH");
if ( szHome != NULL )
strDir << szHome;
#else // Win16
// Win16 has no idea about home, so use the current directory instead
strDir = ".\\";
#endif // WIN16/32
#endif // UNIX/Win
wxGetHomeDir(&strDir);
return strDir;
}