X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b48f51ca745c5d3dfd704947812bbea90a44a1eb..059d234d4176165d975048eaa5436ef40af7d037:/src/univ/topluniv.cpp diff --git a/src/univ/topluniv.cpp b/src/univ/topluniv.cpp index fa5ecced11..cc90efba41 100644 --- a/src/univ/topluniv.cpp +++ b/src/univ/topluniv.cpp @@ -155,14 +155,15 @@ bool wxTopLevelWindow::ShowFullScreen(bool show, long style) return wxTopLevelWindowNative::ShowFullScreen(show, style); } -/* static */ wxTopLevelWindow::UseNativeDecorationsByDefault(bool native) +/* static */ +void wxTopLevelWindow::UseNativeDecorationsByDefault(bool native) { ms_drawDecorations = !native; } void wxTopLevelWindow::UseNativeDecorations(bool native) { - wxASSERT_MSG( !m_windowStyle, _T("must be called before Create()") ); + wxASSERT_MSG( !m_windowStyle, wxT("must be called before Create()") ); m_usingNativeDecorations = native; } @@ -183,7 +184,9 @@ long wxTopLevelWindow::GetDecorationsStyle() const ms_canIconize = wxSystemSettings::HasFeature(wxSYS_CAN_ICONIZE_FRAME); } - style |= wxTOPLEVEL_TITLEBAR | wxTOPLEVEL_BUTTON_CLOSE; + style |= wxTOPLEVEL_TITLEBAR; + if ( m_windowStyle & wxCLOSE_BOX ) + style |= wxTOPLEVEL_BUTTON_CLOSE; if ( (m_windowStyle & wxMINIMIZE_BOX) && ms_canIconize ) style |= wxTOPLEVEL_BUTTON_ICONIZE; if ( m_windowStyle & wxMAXIMIZE_BOX ) @@ -302,26 +305,15 @@ long wxTopLevelWindow::HitTest(const wxPoint& pt) const return m_renderer->HitTestFrame(rect, pt+GetClientAreaOrigin(), GetDecorationsStyle()); } -int wxTopLevelWindow::GetMinWidth() const +wxSize wxTopLevelWindow::GetMinSize() const { + wxSize size = wxTopLevelWindowNative::GetMinSize(); if ( !m_usingNativeDecorations ) { - return wxMax(wxTopLevelWindowNative::GetMinWidth(), - m_renderer->GetFrameMinSize(GetDecorationsStyle()).x); + size.IncTo(m_renderer->GetFrameMinSize(GetDecorationsStyle())); } - else - return wxTopLevelWindowNative::GetMinWidth(); -} -int wxTopLevelWindow::GetMinHeight() const -{ - if ( !m_usingNativeDecorations ) - { - return wxMax(wxTopLevelWindowNative::GetMinHeight(), - m_renderer->GetFrameMinSize(GetDecorationsStyle()).y); - } - else - return wxTopLevelWindowNative::GetMinHeight(); + return size; } // ----------------------------------------------------------------------------