From: Vadim Zeitlin Date: Sun, 26 Nov 2000 23:13:04 +0000 (+0000) Subject: wxSetEnv for Win32 (doesn't really work) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1fb454751dc73befe13142c56778a3dcfcaed561?ds=sidebyside wxSetEnv for Win32 (doesn't really work) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index 3af65ba2e0..4a95094a5e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,6 +1,13 @@ wxWindows 2 Change Log ---------------------- +2.3.0 +----- + +wxMSW: + +- threads: bug in wxCondition::Broadcast fixed (Pieter van der Meulen) + 2.2.0 ----- diff --git a/src/common/stream.cpp b/src/common/stream.cpp index c0e0594851..189916814b 100644 --- a/src/common/stream.cpp +++ b/src/common/stream.cpp @@ -1024,7 +1024,8 @@ wxBufferedInputStream::wxBufferedInputStream(wxInputStream& s, wxBufferedInputStream::~wxBufferedInputStream() { - m_parent_i_stream->SeekI(-m_i_streambuf->GetBytesLeft(), wxFromCurrent); + m_parent_i_stream->SeekI(-(off_t)m_i_streambuf->GetBytesLeft(), + wxFromCurrent); delete m_i_streambuf; } diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index c838a433cb..3e10a30ec2 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -156,10 +156,7 @@ wxSize wxCheckBox::DoGetBestSize() const wxScreenDC dc; dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); - // the height of a standard button in the dialog units is 8, - // translate this to pixels (as one dialog unit is precisely equal to - // 8 character heights, it's just the char height) - s_checkSize = dc.GetCharHeight(); + s_checkSize = (3*dc.GetCharHeight())/2; } wxString str = wxGetWindowText(GetHWND()); diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 634668dd77..0c647be3b5 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -457,6 +457,24 @@ bool wxDirExists(const wxString& dir) #endif // Win32/16 } +bool wxSetEnv(const wxString& var, const wxChar *value) +{ + // some compilers have putenv() or _putenv() or _wputenv() but it's better + // to always use Win32 function directly instead of dealing with them +#if defined(__WIN32__) + if ( !::SetEnvironmentVariable(var, value) ) + { + wxLogLastError(_T("SetEnvironmentVariable")); + + return FALSE; + } + + return TRUE; +#else // no way to set env vars + return FALSE; +#endif +} + // ---------------------------------------------------------------------------- // process management // ----------------------------------------------------------------------------