X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8ae6ce07de7a5e9dde887ef82a69606108c5e09b..e5b502f3a610d5d72b0fb6ca4b9cf9034d0d271b:/src/common/wincmn.cpp?ds=sidebyside diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 4df298217e..b6a2178167 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -123,12 +123,12 @@ void wxWindowBase::InitBase() // m_foregroundColour = *wxBLACK; // TODO take this from sys settings too? m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOWTEXT); -#if !defined(__WXMAC__) && !defined(__WXGTK__) + // GRG, changed Mar/2000 +#if 0 // !defined(__WXMAC__) && !defined(__WXGTK__) m_font = *wxSWISS_FONT; // and this? #else m_font = settings.GetSystemFont(wxSYS_DEFAULT_GUI_FONT); #endif - // no style bits m_exStyle = m_windowStyle = 0; @@ -403,6 +403,14 @@ wxSize wxWindowBase::DoGetBestSize() const int wx, wy, ww, wh; win->GetPosition(&wx, &wy); + + // if the window hadn't been positioned yet, assume that it is in + // the origin + if ( wx == -1 ) + wx = 0; + if ( wy == -1 ) + wy = 0; + win->GetSize(&ww, &wh); if ( wx + ww > maxX ) maxX = wx + ww; @@ -578,16 +586,15 @@ bool wxWindowBase::SetForegroundColour( const wxColour &colour ) bool wxWindowBase::SetCursor(const wxCursor& cursor) { - // don't try to set invalid cursor, always fall back to the default - const wxCursor& cursorOk = cursor.Ok() ? cursor : *wxSTANDARD_CURSOR; - - if ( (wxCursor&)cursorOk == m_cursor ) + // setting an invalid cursor is ok, it means that we don't have any special + // cursor + if ( m_cursor == cursor ) { // no change return FALSE; } - m_cursor = cursorOk; + m_cursor = cursor; return TRUE; }