]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/win32.cpp
fixes to focus handling in menus
[wxWidgets.git] / src / univ / themes / win32.cpp
index 50d699434311d9a67a140972a061a41037bd4603..911234b009304cfa77c767afb8366194604947f1 100644 (file)
@@ -3153,7 +3153,7 @@ int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int fla
             btnRect.x -= FRAME_BUTTON_WIDTH;
         }
 
-        if ( pt.y < client.y + FRAME_TITLEBAR_HEIGHT )
+        if ( pt.y >= client.y && pt.y < client.y + FRAME_TITLEBAR_HEIGHT )
             return wxHT_TOPLEVEL_TITLEBAR;
     }
 
@@ -3161,17 +3161,15 @@ int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int fla
     {
         // we are certainly at one of borders, lets decide which one:
         
-        wxCoord midX = client.x + client.width/2,
-                midY = client.y + client.height/2;
         int border = 0;
         // dirty trick, relies on the way wxHT_TOPLEVEL_XXX are defined!
-        if ( pt.x < midX )
+        if ( pt.x < client.x )
             border |= wxHT_TOPLEVEL_BORDER_W;
-        else
+        else if ( pt.x >= client.width + client.x )
             border |= wxHT_TOPLEVEL_BORDER_E;
-        if ( pt.y < midY )
+        if ( pt.y < client.y )
             border |= wxHT_TOPLEVEL_BORDER_N;
-        else
+        else if ( pt.y >= client.height + client.y )
             border |= wxHT_TOPLEVEL_BORDER_S;
         return border;
     }
@@ -3294,8 +3292,11 @@ void wxWin32Renderer::DrawFrameIcon(wxDC& dc,
                                     const wxIcon& icon,
                                     int flags)
 {
-    wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
-    dc.DrawIcon(icon, r.x, r.y);
+    if ( icon.Ok() )
+    {
+        wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
+        dc.DrawIcon(icon, r.x, r.y);
+    }
 }
 
 void wxWin32Renderer::DrawFrameButton(wxDC& dc,