// Created: 29/07/2002
// RCS-ID: $Id$
// Copyright: (c) Hans Van Leemputten
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ===========================================================================
// 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
{
BEGIN_EVENT_TABLE(wxGenericMDIParentFrame, wxFrame)
#if wxUSE_MENUS
- EVT_MENU (-1, wxGenericMDIParentFrame::DoHandleMenu)
+ EVT_MENU (wxID_ANY, wxGenericMDIParentFrame::DoHandleMenu)
#endif
END_EVENT_TABLE()
OnCreateClient();
- return TRUE;
+ return true;
}
#if wxUSE_MENUS
// Stops the same event being processed repeatedly
static wxEventType inEvent = wxEVT_NULL;
if (inEvent == event.GetEventType())
- return FALSE;
+ return false;
inEvent = event.GetEventType();
// Let the active child (if any) process the event first.
- bool res = FALSE;
+ bool res = false;
if (m_pActiveChild && event.IsKindOf(CLASSINFO(wxCommandEvent))
#if 0
/* This is sure to not give problems... */
{
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"));
{
#if 1 // What's best? Delayed deleting or immediate deleting?
delete m_pActiveChild;
+ m_pActiveChild = NULL;
#else
ActivateNext();
Create( parent, id, title, wxDefaultPosition, size, style, name );
}
-#include "wx/log.h"
wxGenericMDIChildFrame::~wxGenericMDIChildFrame()
{
wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame();
if (pParentFrame != NULL)
{
- bool bActive = FALSE;
+ bool bActive = false;
if (pParentFrame->GetActiveChild() == this)
{
pParentFrame->SetActiveChild((wxGenericMDIChildFrame*) NULL);
pParentFrame->SetChildMenuBar((wxGenericMDIChildFrame*) NULL);
- bActive = TRUE;
+ bActive = true;
}
wxGenericMDIClientWindow *pClientWindow = pParentFrame->GetClientWindow();
m_Title = title;
- pClientWindow->AddPage(this, title, TRUE);
+ pClientWindow->AddPage(this, title, true);
ApplyMDIChildFrameRect(); // Ok confirme the size change!
pClientWindow->Refresh();
- return TRUE;
+ return true;
}
#if wxUSE_MENUS
// but may be the MDI frame does?
m_pMDIParentFrame->OnMenuHighlight(event);
}
+#else
+ wxUnusedVar(event);
#endif // wxUSE_STATUSBAR
}
{
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)
{
/*
GetTabView()->SetTabSize(120, 18);
GetTabView()->SetTabSelectionHeight(20);
*/
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
int wxGenericMDIClientWindow::SetSelection(size_t nPage)
wxGenericMDIChildFrame* oldChild = (wxGenericMDIChildFrame *)GetPage(OldSelection);
if (oldChild)
{
- wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldChild->GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, false, oldChild->GetId());
event.SetEventObject( oldChild );
oldChild->GetEventHandler()->ProcessEvent(event);
}
wxGenericMDIChildFrame* activeChild = (wxGenericMDIChildFrame *)GetPage(newSelection);
if (activeChild)
{
- wxActivateEvent event(wxEVT_ACTIVATE, TRUE, activeChild->GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, true, activeChild->GetId());
event.SetEventObject( activeChild );
activeChild->GetEventHandler()->ProcessEvent(event);
IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxGenericMDIChildFrame)
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxGenericMDIClientWindow)
-#endif
+#endif // wxUSE_GENERIC_MDI_AS_NATIVE
+#endif // wxUSE_MDI
\ No newline at end of file