]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/frame.cpp
* Fixed Apple IEEE conversion
[wxWidgets.git] / src / msw / frame.cpp
index 48d39d7495fec4abaac98db6b01904a94277195b..82d435e254251ba93ba0b0e248d8645e0a38e4a8 100644 (file)
@@ -86,9 +86,6 @@ bool wxFrame::Create(wxWindow *parent,
     m_hwndToolTip = 0;
 #endif
 
-  if (!parent)
-    wxTopLevelWindows.Append(this);
-
   SetName(name);
   m_windowStyle = style;
   m_frameMenuBar = NULL;
@@ -119,6 +116,9 @@ bool wxFrame::Create(wxWindow *parent,
   if ((m_windowStyle & wxFRAME_FLOAT_ON_PARENT) == 0)
     parent = NULL;
 
+  if (!parent)
+    wxTopLevelWindows.Append(this);
+
   MSWCreate(m_windowId, parent, wxFrameClassName, this, title,
             x, y, width, height, style);
 
@@ -609,17 +609,29 @@ void wxFrame::OnSize(wxSizeEvent& event)
 // subwindow found.
 void wxFrame::OnActivate(wxActivateEvent& event)
 {
-  for(wxNode *node = GetChildren().First(); node; node = node->Next())
-  {
-    // Find a child that's a subwindow, but not a dialog box.
-    wxWindow *child = (wxWindow *)node->Data();
-    if (!child->IsKindOf(CLASSINFO(wxFrame)) &&
-         !child->IsKindOf(CLASSINFO(wxDialog)))
+    for ( wxWindowList::Node *node = GetChildren().GetFirst();
+          node;
+          node = node->GetNext() )
     {
-      child->SetFocus();
-      return;
+        // FIXME all this is totally bogus - we need to do the same as wxPanel,
+        //       but how to do it without duplicating the code?
+
+        // restore focus
+        wxWindow *child = node->GetData();
+
+        if ( !child->IsTopLevel()
+#if wxUSE_TOOLBAR
+             && !wxDynamicCast(child, wxToolBar)
+#endif // wxUSE_TOOLBAR
+#if wxUSE_STATUSBAR
+             && !wxDynamicCast(child, wxStatusBar)
+#endif // wxUSE_STATUSBAR
+           )
+        {
+            child->SetFocus();
+            return;
+        }
     }
-  }
 }
 
 // The default implementation for the close window event.
@@ -834,10 +846,7 @@ bool wxFrame::MSWTranslateMessage(WXMSG* pMsg)
         return FALSE;
 
     const wxAcceleratorTable& acceleratorTable = menuBar->GetAccelTable();
-    return acceleratorTable.Ok() &&
-           ::TranslateAccelerator(GetHwnd(),
-                                  GetTableHaccel(acceleratorTable),
-                                  (MSG *)pMsg);
+    return acceleratorTable.Translate(this, pMsg);
 }
 
 // ---------------------------------------------------------------------------
@@ -851,7 +860,7 @@ bool wxFrame::HandlePaint()
     {
         if ( m_iconized )
         {
-            HICON hIcon = m_icon.Ok() ? GetIconHicon(m_icon)
+            HICON hIcon = m_icon.Ok() ? GetHiconOf(m_icon)
                                       : (HICON)m_defaultIcon;
 
             // Hold a pointer to the dc so long as the OnPaint() message
@@ -1047,7 +1056,7 @@ long wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
 
         case WM_QUERYDRAGICON:
             {
-                HICON hIcon = m_icon.Ok() ? GetIconHicon(m_icon)
+                HICON hIcon = m_icon.Ok() ? GetHiconOf(m_icon)
                                           : (HICON)(m_defaultIcon);
                 rc = (long)hIcon;
                 processed = rc != 0;