]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/topluniv.cpp
Reverted bogus fix for bogus bug report #13402.
[wxWidgets.git] / src / univ / topluniv.cpp
index 89c2cfb0c7d8279f3945a1d54f45c32a6db3212b..06afa0f3039a726ee5f445c2f745dbb589f576fd 100644 (file)
@@ -163,7 +163,7 @@ void wxTopLevelWindow::UseNativeDecorationsByDefault(bool 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;
 }
@@ -184,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 )
@@ -206,7 +208,7 @@ long wxTopLevelWindow::GetDecorationsStyle() const
 
     if ( IsMaximized() )
         style |= wxTOPLEVEL_MAXIMIZED;
-    if ( GetIcon().Ok() )
+    if ( GetIcon().IsOk() )
         style |= wxTOPLEVEL_ICON;
     if ( m_isActive )
         style |= wxTOPLEVEL_ACTIVE;
@@ -303,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;
 }
 
 // ----------------------------------------------------------------------------
@@ -338,13 +329,13 @@ void wxTopLevelWindow::SetIcons(const wxIconBundle& icons)
         wxSize size = m_renderer->GetFrameIconSize();
         const wxIcon& icon = icons.GetIcon( size );
 
-        if ( !icon.Ok() || size.x == wxDefaultCoord  )
+        if ( !icon.IsOk() || size.x == wxDefaultCoord  )
             m_titlebarIcon = icon;
         else
         {
             wxBitmap bmp1;
             bmp1.CopyFromIcon(icon);
-            if ( !bmp1.Ok() )
+            if ( !bmp1.IsOk() )
                 m_titlebarIcon = wxNullIcon;
             else if ( bmp1.GetWidth() == size.x && bmp1.GetHeight() == size.y )
                 m_titlebarIcon = icon;