X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da78f3b10cfe9447053f32ea4baddf50058eafef..7533ba252ba505f159f504a34877793fb32d8bca:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index b46e7c9b51..e09ed57c34 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -44,6 +44,7 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/statusbr.h" + #include "wx/toolbar.h" #include "wx/dcclient.h" #endif //WX_PRECOMP @@ -215,10 +216,9 @@ wxWindowBase::wxWindowBase() // VZ: this one shouldn't exist... m_isBeingDeleted = false; - - // Can be used in port specific wxWindow derived classes for holding extra - // data memebers. - m_extraData = NULL; + + // Reserved for future use + m_windowReserved = NULL; } // common part of window creation process @@ -495,13 +495,13 @@ void wxWindowBase::Centre(int direction) yNew += posParent.y; // FIXME: This needs to get the client display rect of the display - // the window is (via wxDisplay::GetFromWindow). - + // the window is (via wxDisplay::GetFromWindow). + // Base size of the visible dimensions of the display // to take into account the taskbar. And the Mac menu bar at top. wxRect clientrect = wxGetClientDisplayRect(); - // NB: in wxMSW, negative position may not neccessary mean "out of screen", + // NB: in wxMSW, negative position may not necessarily mean "out of screen", // but it may mean that the window is placed on other than the main // display. Therefore we only make sure centered window is on the main display // if the parent is at least partially present here. @@ -675,13 +675,23 @@ wxSize wxWindowBase::DoGetBestSize() const } else // ! has children { - // For a generic window there is no natural best size - just use - // either the minimum size if there is one, or the current size. - // These are returned as-is, unadjusted by the client size difference. - if ( GetMinSize().IsFullySpecified() ) - return GetMinSize(); - else - return GetSize(); + // for a generic window there is no natural best size so, if the + // minimal size is not set, use the current size but take care to + // remember it as minimal size for the next time because our best size + // should be constant: otherwise we could get into a situation when the + // window is initially at some size, then expanded to a larger size and + // then, when the containing window is shrunk back (because our initial + // best size had been used for computing the parent min size), we can't + // be shrunk back any more because our best size is now bigger + wxSize size = GetMinSize(); + if ( !size.IsFullySpecified() ) + { + size.SetDefaults(GetSize()); + wxConstCast(this, wxWindowBase)->SetMinSize(size); + } + + // return as-is, unadjusted by the client size difference. + return size; } // Add any difference between size and client size @@ -2245,26 +2255,30 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event ) switch ( wxGetOsVersion() ) { - case wxMOTIF_X: port += _T("Motif"); break; + case wxMOTIF_X: port += _T("Motif"); break; case wxMAC: - case wxMAC_DARWIN: port += _T("Mac"); break; - case wxBEOS: port += _T("BeOS"); break; + case wxMAC_DARWIN: port += _T("Mac"); break; + case wxBEOS: port += _T("BeOS"); break; case wxGTK: case wxGTK_WIN32: case wxGTK_OS2: - case wxGTK_BEOS: port += _T("GTK"); break; + case wxGTK_BEOS: port += _T("GTK"); break; case wxWINDOWS: case wxPENWINDOWS: case wxWINDOWS_NT: case wxWIN32S: case wxWIN95: - case wxWIN386: port += _T("MS Windows"); break; + case wxWIN386: port += _T("MS Windows"); break; case wxMGL_UNIX: case wxMGL_X: case wxMGL_WIN32: - case wxMGL_OS2: port += _T("MGL"); break; + case wxMGL_OS2: port += _T("MGL"); break; case wxWINDOWS_OS2: - case wxOS2_PM: port += _T("OS/2"); break; + case wxOS2_PM: port += _T("OS/2"); break; + case wxPALMOS: port += _T("Palm OS"); break; + case wxWINDOWS_CE: port += _T("Windows CE (generic)"); break; + case wxWINDOWS_POCKETPC: port += _T("Windows CE PocketPC"); break; + case wxWINDOWS_SMARTPHONE: port += _T("Windows CE Smartphone"); break; default: port += _T("unknown"); break; }