X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7eb4e9cc0f3590fffda78bf02c47b25c41583eba..8128349e81e7052492483b38875df42b6d529115:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 1cbe67838f..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; @@ -176,15 +176,6 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, m_windowId = id == -1 ? NewControlId() : id; SetName(name); - - // if the parent window has wxWS_EX_VALIDATE_RECURSIVELY set, we want to - // have it too - like this it's possible to set it only in the top level - // dialog/frame and all children will inherit it by defult - if ( parent && (parent->GetWindowStyle() & wxWS_EX_VALIDATE_RECURSIVELY) ) - { - style |= wxWS_EX_VALIDATE_RECURSIVELY; - } - SetWindowStyleFlag(style); SetParent(parent); @@ -192,6 +183,14 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, SetValidator(validator); #endif // wxUSE_VALIDATORS + // if the parent window has wxWS_EX_VALIDATE_RECURSIVELY set, we want to + // have it too - like this it's possible to set it only in the top level + // dialog/frame and all children will inherit it by defult + if ( parent && (parent->GetExtraStyle() & wxWS_EX_VALIDATE_RECURSIVELY) ) + { + SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY); + } + return TRUE; } @@ -404,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; @@ -579,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; }