]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mdi.cpp
Added OnEraseBackground to wxNotebook on wxMSW to avoid black background;
[wxWidgets.git] / src / msw / mdi.cpp
index 774b215ca1810175fa455384ad2d284cf85d674b..d33807a73a72108b1e553791b5f138d49d34b407 100644 (file)
 #include "wx/mdi.h"
 #include "wx/msw/private.h"
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
 #include <wx/msw/statbr95.h>
 #endif
 
 #include <string.h>
 
 extern wxList wxModelessWindows;
+extern wxMenu *wxCurrentPopupMenu;
 
 #define IDM_WINDOWTILE  4001
 #define IDM_WINDOWCASCADE 4002
@@ -265,7 +266,7 @@ void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar)
 
 void wxMDIParentFrame::OnSize(wxSizeEvent& event)
 {
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
     if (GetAutoLayout())
       Layout();
 #endif
@@ -279,7 +280,7 @@ void wxMDIParentFrame::OnSize(wxSizeEvent& event)
 
 /* Already done in MSWOnSize
   // forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
   if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
     ((wxStatusBar95 *)m_frameStatusBar)->OnSize(event);
 #endif
@@ -302,7 +303,7 @@ void wxMDIParentFrame::OldOnSize(int x, int y)
   GetEventHandler()->ProcessEvent(event);
 #else
 
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
   if (GetAutoLayout())
     Layout();
 #endif
@@ -442,7 +443,7 @@ void wxMDIParentFrame::MSWOnSize(int x, int y, WXUINT id)
  if (!m_iconized)
  {
   // forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
   if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
   {
     wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
@@ -486,6 +487,16 @@ bool wxMDIParentFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
     if (win)
       return win->MSWCommand(cmd, id);
 
+/*
+    if (wxCurrentPopupMenu)
+    {
+        wxMenu *popupMenu = wxCurrentPopupMenu;
+        wxCurrentPopupMenu = NULL;
+        if (!popupMenu->MSWCommand(cmd, id))
+            return TRUE;
+    }
+*/
+
     switch (id)
     {
       case IDM_WINDOWCASCADE:
@@ -907,7 +918,7 @@ void wxMDIChildFrame::MSWOnSize(int x, int y, WXUINT id)
   if (!m_iconized)
   {
     // forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
     if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
     {
       wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
@@ -937,6 +948,14 @@ bool wxMDIChildFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
     if (win)
       return win->MSWCommand(cmd, id);
 
+    if (wxCurrentPopupMenu)
+    {
+        wxMenu *popupMenu = wxCurrentPopupMenu;
+        wxCurrentPopupMenu = NULL;
+        if (popupMenu->MSWCommand(cmd, id))
+            return TRUE;
+    }
+
     if (GetMenuBar() && GetMenuBar()->FindItemForId(id))
     {
       ProcessCommand(id);
@@ -1206,7 +1225,7 @@ long wxMDIClientWindow::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPa
 long wxMDIClientWindow::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
 {
        if ( MSWGetOldWndProc() != 0)
-               return ::CallWindowProc(CASTWNDPROC (FARPROC) MSWGetOldWndProc(), (HWND) GetHWND(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
+               return ::CallWindowProc(CASTWNDPROC MSWGetOldWndProc(), (HWND) GetHWND(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
        else
                return ::DefWindowProc((HWND) m_hWnd, (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
 }