]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
mac cleanup, pure cgcolor
[wxWidgets.git] / src / msw / window.cpp
index c3b83772f41859620de33b87d3cd0c44184c206d..d8be1a890be8f0ba2332ef232eaccf256994497b 100644 (file)
@@ -1288,28 +1288,11 @@ void wxWindowMSW::MSWUpdateStyle(long flagsOld, long exflagsOld)
 
 wxBorder wxWindowMSW::GetDefaultBorderForControl() const
 {
-    // we want to automatically give controls a sunken style (confusingly,
-    // it may not really mean sunken at all as we map it to WS_EX_CLIENTEDGE
-    // which is not sunken at all under Windows XP -- rather, just the default)
-
-#if defined(__POCKETPC__) || defined(__SMARTPHONE__)
-    return wxBORDER_SIMPLE;
-#else
-#if wxUSE_UXTHEME
-    if (CanApplyThemeBorder())
-    {
-        wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
-        if (theme)
-            return wxBORDER_THEME;
-    }
-#endif
-    return wxBORDER_SUNKEN;
-#endif
+    return wxBORDER_THEME;
 }
 
 wxBorder wxWindowMSW::GetDefaultBorder() const
 {
-    // return GetDefaultBorderForControl();
     return wxWindowBase::GetDefaultBorder();
 }
 
@@ -1336,8 +1319,6 @@ wxBorder wxWindowMSW::TranslateBorder(wxBorder border) const
 #endif
     return border;
 #endif
-
-    return border;
 }
 
 
@@ -2278,9 +2259,13 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
                             wxWindow *win = this;
                             if ( !bCtrlDown )
                             {
-                                while ( win && !win->IsTopLevel() )
+                                // this will contain the dialog code of this
+                                // window and all of its parent windows in turn
+                                LONG lDlgCode2 = lDlgCode;
+
+                                while ( win )
                                 {
-                                    if ( lDlgCode & DLGC_WANTMESSAGE )
+                                    if ( lDlgCode2 & DLGC_WANTMESSAGE )
                                     {
                                         // as it wants to process Enter itself,
                                         // don't call IsDialogMessage() which
@@ -2288,7 +2273,20 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
                                         return false;
                                     }
 
+                                    // don't propagate keyboard messages beyond
+                                    // the first top level window parent
+                                    if ( win->IsTopLevel() )
+                                        break;
+
                                     win = win->GetParent();
+
+                                    lDlgCode2 = ::SendMessage
+                                                  (
+                                                    GetHwndOf(win),
+                                                    WM_GETDLGCODE,
+                                                    0,
+                                                    0
+                                                  );
                                 }
                             }
                             else // bCtrlDown
@@ -5022,7 +5020,7 @@ void wxWindowMSW::InitMouseEvent(wxMouseEvent& event,
     event.m_aux1Down = (flags & MK_XBUTTON1) != 0;
     event.m_aux2Down = (flags & MK_XBUTTON2) != 0;
 #endif // wxHAS_XBUTTON
-    event.m_altDown = ::GetKeyState(VK_MENU) < 0;
+    event.m_altDown = ::wxIsAltDown();
 
 #ifndef __WXWINCE__
     event.SetTimestamp(::GetMessageTime());
@@ -6063,9 +6061,9 @@ wxMouseState wxGetMouseState()
     ms.SetAux2Down(wxIsKeyDown(VK_XBUTTON2));
 #endif // wxHAS_XBUTTON
 
-    ms.SetControlDown(wxIsKeyDown(VK_CONTROL));
-    ms.SetShiftDown(wxIsKeyDown(VK_SHIFT));
-    ms.SetAltDown(wxIsKeyDown(VK_MENU));
+    ms.SetControlDown(wxIsCtrlDown ());
+    ms.SetShiftDown  (wxIsShiftDown());
+    ms.SetAltDown    (wxIsAltDown  ());
 //    ms.SetMetaDown();
 
     return ms;