]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Add wxUSE_ARCSTREAM so that other archive classes can be used without wxZip
[wxWidgets.git] / src / msw / window.cpp
index f7b7c2f9820aab85e2d3f43ded62876c0d5b37bb..dc99d7cf4d1f73937aa08ca6a647f0851c5bce96 100644 (file)
@@ -54,6 +54,7 @@
 #endif
 
 #include "wx/module.h"
+#include "wx/sysopt.h"
 
 #if wxUSE_DRAG_AND_DROP
     #include "wx/dnd.h"
@@ -1146,7 +1147,8 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
     // using this flag results in very significant reduction in flicker,
     // especially with controls inside the static boxes (as the interior of the
     // box is not redrawn twice)
-    style |= WS_CLIPCHILDREN;
+    if (!wxSystemOptions::GetOptionInt(wxT("msw.window.no-clip-children")) == 1)
+        style |= WS_CLIPCHILDREN;
 
     // it doesn't seem useful to use WS_CLIPSIBLINGS here as we officially
     // don't support overlapping windows and it only makes sense for them and,
@@ -1651,13 +1653,6 @@ void wxWindowMSW::DoSetClientSize(int width, int height)
     }
 }
 
-// For implementation purposes - sometimes decorations make the client area
-// smaller
-wxPoint wxWindowMSW::GetClientAreaOrigin() const
-{
-    return wxPoint(0, 0);
-}
-
 // ---------------------------------------------------------------------------
 // text metrics
 // ---------------------------------------------------------------------------
@@ -2230,49 +2225,6 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
             (void)HandleDestroy();
             break;
 
-#ifndef __SMARTPHONE__ // or wxWinCE in general ?
-        case WM_WINDOWPOSCHANGING:
-            {
-                WINDOWPOS *wp = wx_reinterpret_cast(WINDOWPOS *, lParam);
-
-                if ( wp->flags & SWP_NOSIZE )
-                    break;
-
-                // when we resize this window, its children are probably going
-                // to be repositioned as well, prepare to use DeferWindowPos()
-                // for them
-                const int numChildren = GetChildren().GetCount();
-                if ( numChildren > 1 )
-                {
-                    m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
-                    if ( !m_hDWP )
-                    {
-                        wxLogLastError(_T("BeginDeferWindowPos"));
-                    }
-                }
-            }
-            break;
-
-        case WM_WINDOWPOSCHANGED:
-            // first let DefWindowProc() handle the message: it will generate
-            // WM_MOVE and WM_SIZE as needed
-            processed = MSWDefWindowProc(message, wParam, lParam) == 0;
-
-            // then change the positions of all child windows at once
-            if ( m_hDWP )
-            {
-                HDWP hDWP = (HDWP)m_hDWP;
-                m_hDWP = NULL;
-
-                // put all child controls in place at once now
-                if ( !::EndDeferWindowPos(hDWP) )
-                {
-                    wxLogLastError(_T("EndDeferWindowPos"));
-                }
-            }
-            break;
-#endif // __SMARTPHONE__
-
         case WM_SIZE:
             processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
             break;
@@ -2282,7 +2234,6 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
             break;
 
 #if !defined(__WXWINCE__)
-        // TODO: move those in WM_WINDOWPOSCHANGING case above
         case WM_MOVING:
             {
                 LPRECT pRect = (LPRECT)lParam;
@@ -3083,42 +3034,22 @@ bool wxWindowMSW::MSWCreate(const wxChar *wclass,
     // do create the window
     wxWindowCreationHook hook(this);
 
-    // VZ: anyone care to explain why this is done for CE?
-#ifdef __WXWINCE__
-    if (extendedStyle == 0)
-    {
-        m_hWnd = (WXHWND)::CreateWindow
-            (
-            className,
-            title ? title : wxEmptyString,
-            style,
-            x, y, w, h,
-            (HWND)MSWGetParent(),
-            (HMENU)controlId,
-            wxGetInstance(),
-            NULL                        // no extra data
-            );
-    }
-    else
-#endif // __WXWINCE__
-    {
-        m_hWnd = (WXHWND)::CreateWindowEx
-            (
-            extendedStyle,
-            className,
-            title ? title : wxEmptyString,
-            style,
-            x, y, w, h,
-            (HWND)MSWGetParent(),
-            (HMENU)controlId,
-            wxGetInstance(),
-            NULL                        // no extra data
-            );
-    }
+    m_hWnd = (WXHWND)::CreateWindowEx
+                       (
+                        extendedStyle,
+                        className,
+                        title ? title : m_windowName.c_str(),
+                        style,
+                        x, y, w, h,
+                        (HWND)MSWGetParent(),
+                        (HMENU)controlId,
+                        wxGetInstance(),
+                        NULL                        // no extra data
+                       );
 
     if ( !m_hWnd )
     {
-        wxLogSysError(_("Can't create window of class %s"), wclass);
+        wxLogSysError(_("Can't create window of class %s"), className.c_str());
 
         return false;
     }
@@ -4151,8 +4082,20 @@ bool wxWindowMSW::HandleMoving(wxRect& rect)
 
 bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
 {
-    bool processed = false;
+    // when we resize this window, its children are probably going to be
+    // repositioned as well, prepare to use DeferWindowPos() for them
+    const int numChildren = GetChildren().GetCount();
+    if ( numChildren > 1 )
+    {
+        m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
+        if ( !m_hDWP )
+        {
+            wxLogLastError(_T("BeginDeferWindowPos"));
+        }
+    }
 
+    // update this window size
+    bool processed = false;
     switch ( wParam )
     {
         default:
@@ -4182,6 +4125,23 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
             processed = GetEventHandler()->ProcessEvent(event);
     }
 
+    // and finally change the positions of all child windows at once
+    if ( m_hDWP )
+    {
+        // reset m_hDWP to NULL so that child windows don't try to use our
+        // m_hDWP after we call EndDeferWindowPos() on it (this shouldn't
+        // happen anyhow normally but who knows what weird flow of control we
+        // may have depending on what the users EVT_SIZE handler does...)
+        HDWP hDWP = (HDWP)m_hDWP;
+        m_hDWP = NULL;
+
+        // do put all child controls in place at once
+        if ( !::EndDeferWindowPos(hDWP) )
+        {
+            wxLogLastError(_T("EndDeferWindowPos"));
+        }
+    }
+
     return processed;
 }