]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
don't show size grip when maximized
[wxWidgets.git] / src / msw / window.cpp
index b47f269cfd1770a7aeeb5b7451c3ceaf64cc2205..d414c9dc3dea3d204391b48b7cd2bad585076218 100644 (file)
@@ -3349,30 +3349,38 @@ WXHBRUSH wxWindowMSW::OnCtlColor(WXHDC WXUNUSED(hDC),
 bool wxWindowMSW::HandlePaletteChanged(WXHWND hWndPalChange)
 {
 #if wxUSE_PALETTE
-        // same as below except we don't respond to our own messages
-        if (hWndPalChange != GetHWND()) {
+    // same as below except we don't respond to our own messages
+    if ( hWndPalChange != GetHWND() )
+    {
         // check to see if we our our parents have a custom palette
         wxWindow *win = this;
-        while (!win->HasCustomPalette() && win->GetParent()) win = win->GetParent();
-        if (win->HasCustomPalette()) {
-            /* realize the palette to see whether redrawing is needed */
-            HDC hdc = GetDC((HWND) hWndPalChange);
-            win->m_palette.SetHPALETTE( (WXHPALETTE)
-                ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), false) );
+        while ( win && !win->HasCustomPalette() )
+        {
+            win = win->GetParent();
+        }
+
+        if ( win && win->HasCustomPalette() )
+        {
+            // realize the palette to see whether redrawing is needed
+            HDC hdc = ::GetDC((HWND) hWndPalChange);
+            win->m_palette.SetHPALETTE((WXHPALETTE)
+                    ::SelectPalette(hdc, GetHpaletteOf(win->m_palette), FALSE));
 
             int result = ::RealizePalette(hdc);
-            /* restore the palette (before releasing the DC) */
-            win->m_palette.SetHPALETTE( (WXHPALETTE)
-                ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), true) );
-            RealizePalette(hdc);
-            ReleaseDC((HWND) hWndPalChange, hdc);
-            /* now check for the need to redraw */
+
+            // restore the palette (before releasing the DC)
+            win->m_palette.SetHPALETTE((WXHPALETTE)
+                    ::SelectPalette(hdc, GetHpaletteOf(win->m_palette), FALSE));
+            ::RealizePalette(hdc);
+            ::ReleaseDC((HWND) hWndPalChange, hdc);
+
+            // now check for the need to redraw
             if (result > 0)
                 InvalidateRect((HWND) hWndPalChange, NULL, TRUE);
-            }
-
         }
-#endif
+
+    }
+#endif // wxUSE_PALETTE
 
     wxPaletteChangedEvent event(GetId());
     event.SetEventObject(this);
@@ -3392,19 +3400,19 @@ bool wxWindowMSW::HandleQueryNewPalette()
         /* realize the palette to see whether redrawing is needed */
         HDC hdc = GetDC((HWND) GetHWND());
         win->m_palette.SetHPALETTE( (WXHPALETTE)
-             ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), false) );
+             ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), FALSE) );
 
         int result = ::RealizePalette(hdc);
         /* restore the palette (before releasing the DC) */
         win->m_palette.SetHPALETTE( (WXHPALETTE)
-             ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), true) );
+             ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), TRUE) );
         ::RealizePalette(hdc);
         ::ReleaseDC((HWND) GetHWND(), hdc);
         /* now check for the need to redraw */
         if (result > 0)
             ::InvalidateRect((HWND) GetHWND(), NULL, TRUE);
         }
-#endif
+#endif // wxUSE_PALETTE
 
     wxQueryNewPaletteEvent event(GetId());
     event.SetEventObject(this);
@@ -3659,28 +3667,33 @@ bool wxWindowMSW::HandleGetMinMaxInfo(void *mmInfo)
     MINMAXINFO *info = (MINMAXINFO *)mmInfo;
 
     bool rc = FALSE;
+    
+    int minWidth = GetMinWidth(),
+        minHeight = GetMinHeight(),
+        maxWidth = GetMaxWidth(),
+        maxHeight = GetMaxHeight();
 
-    if ( m_minWidth != -1 )
+    if ( minWidth != -1 )
     {
-        info->ptMinTrackSize.x = m_minWidth;
+        info->ptMinTrackSize.x = minWidth;
         rc = TRUE;
     }
 
-    if ( m_minHeight != -1 )
+    if ( minHeight != -1 )
     {
-        info->ptMinTrackSize.y = m_minHeight;
+        info->ptMinTrackSize.y = minHeight;
         rc = TRUE;
     }
 
-    if ( m_maxWidth != -1 )
+    if ( maxWidth != -1 )
     {
-        info->ptMaxTrackSize.x = m_maxWidth;
+        info->ptMaxTrackSize.x = maxWidth;
         rc = TRUE;
     }
 
-    if ( m_maxHeight != -1 )
+    if ( maxHeight != -1 )
     {
-        info->ptMaxTrackSize.y = m_maxHeight;
+        info->ptMaxTrackSize.y = maxHeight;
         rc = TRUE;
     }