]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/mdig.cpp
fixed STC under Win64: as wxStyledTextCtrl::SendMsg() used (32 bit) long arguments...
[wxWidgets.git] / src / generic / mdig.cpp
index 048d45b41333b091ad760517839bdae99289c5bc..d97213d79744dc19df967ac0afe0092fdb2db8cb 100644 (file)
 // headers
 // ---------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "mdig.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
     #pragma hdrstop
 #endif
 
+#if wxUSE_MDI
+
+#include "wx/generic/mdig.h"
+
 #ifndef WX_PRECOMP
     #include "wx/panel.h"
     #include "wx/menu.h"
     #include "wx/intl.h"
+    #include "wx/log.h"
 #endif //WX_PRECOMP
 
-#include "wx/generic/mdig.h"
+#include "wx/stockitem.h"
 
 enum MDI_MENU_ID
 {
@@ -119,11 +120,12 @@ bool wxGenericMDIParentFrame::Create(wxWindow *parent,
 #endif // wxUSE_MENUS
   }
 
-  wxFrame::Create( parent, id, title, pos, size, style, name );
+  if ( !wxFrame::Create( parent, id, title, pos, size, style, name ) )
+      return false;
 
-  OnCreateClient();
+  m_pClientWindow = OnCreateClient();
 
-  return true;
+  return m_pClientWindow != NULL;
 }
 
 #if wxUSE_MENUS
@@ -247,11 +249,10 @@ wxGenericMDIClientWindow *wxGenericMDIParentFrame::GetClientWindow() const
 wxGenericMDIClientWindow *wxGenericMDIParentFrame::OnCreateClient()
 {
 #if wxUSE_GENERIC_MDI_AS_NATIVE
-    m_pClientWindow = new wxMDIClientWindow( this );
+    return new wxMDIClientWindow( this );
 #else
-    m_pClientWindow = new wxGenericMDIClientWindow( this );
+    return new wxGenericMDIClientWindow( this );
 #endif
-    return m_pClientWindow;
 }
 
 void wxGenericMDIParentFrame::ActivateNext()
@@ -307,7 +308,7 @@ void wxGenericMDIParentFrame::AddWindowMenu(wxMenuBar *pMenuBar)
 {
     if (pMenuBar && m_pWindowMenu)
     {
-        int pos = pMenuBar->FindMenu(_("Help"));
+        int pos = pMenuBar->FindMenu(wxGetStockLabel(wxID_HELP,false));
         if (pos == wxNOT_FOUND)
         {
             pMenuBar->Append(m_pWindowMenu, _("&Window"));
@@ -344,6 +345,7 @@ void wxGenericMDIParentFrame::DoHandleMenu(wxCommandEvent &event)
                 {
 #if 1   // What's best? Delayed deleting or immediate deleting?
                     delete m_pActiveChild;
+                    m_pActiveChild = NULL;
 #else
                     ActivateNext();
 
@@ -401,7 +403,6 @@ wxGenericMDIChildFrame::wxGenericMDIChildFrame( wxGenericMDIParentFrame *parent,
     Create( parent, id, title, wxDefaultPosition, size, style, name );
 }
 
-#include "wx/log.h"
 wxGenericMDIChildFrame::~wxGenericMDIChildFrame()
 {
     wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame();
@@ -568,6 +569,8 @@ void wxGenericMDIChildFrame::OnMenuHighlight(wxMenuEvent& event)
         // but may be the MDI frame does?
         m_pMDIParentFrame->OnMenuHighlight(event);
     }
+#else
+    wxUnusedVar(event);
 #endif // wxUSE_STATUSBAR
 }
 
@@ -697,7 +700,7 @@ bool wxGenericMDIClientWindow::CreateClient( wxGenericMDIParentFrame *parent, lo
 {
     SetWindowStyleFlag(style);
 
-    bool success = wxNotebook::Create(parent, wxID_NOTEBOOK_CLIENT_AREA, wxPoint(0, 0), wxSize(100, 100), 0);
+    bool success = wxNotebook::Create(parent, wxID_NOTEBOOK_CLIENT_AREA, wxPoint(0,0), wxSize(100, 100), 0);
     if (success)
     {
         /*
@@ -811,5 +814,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxGenericMDIParentFrame)
 IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxGenericMDIChildFrame)
 IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxGenericMDIClientWindow)
 
-#endif
+#endif // wxUSE_GENERIC_MDI_AS_NATIVE
+
+#endif // wxUSE_MDI