// Created: 29/07/2002
// RCS-ID: $Id$
// Copyright: (c) Hans Van Leemputten
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ===========================================================================
// headers
// ---------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "mdig.h"
#endif
#ifndef WX_PRECOMP
#include "wx/panel.h"
#include "wx/menu.h"
+ #include "wx/intl.h"
#endif //WX_PRECOMP
#include "wx/generic/mdig.h"
IMPLEMENT_DYNAMIC_CLASS(wxGenericMDIParentFrame, wxFrame)
BEGIN_EVENT_TABLE(wxGenericMDIParentFrame, wxFrame)
+#if wxUSE_MENUS
EVT_MENU (-1, wxGenericMDIParentFrame::DoHandleMenu)
+#endif
END_EVENT_TABLE()
wxGenericMDIParentFrame::wxGenericMDIParentFrame()
#if wxUSE_MENUS
m_pWindowMenu = new wxMenu;
- m_pWindowMenu->Append(wxWINDOWCLOSE, _T("Cl&ose"));
- m_pWindowMenu->Append(wxWINDOWCLOSEALL, _T("Close Al&l"));
+ m_pWindowMenu->Append(wxWINDOWCLOSE, _("Cl&ose"));
+ m_pWindowMenu->Append(wxWINDOWCLOSEALL, _("Close All"));
m_pWindowMenu->AppendSeparator();
- m_pWindowMenu->Append(wxWINDOWNEXT, _T("&Next"));
- m_pWindowMenu->Append(wxWINDOWPREV, _T("&Previouse"));
+ m_pWindowMenu->Append(wxWINDOWNEXT, _("&Next"));
+ m_pWindowMenu->Append(wxWINDOWPREV, _("&Previous"));
#endif // wxUSE_MENUS
}
#if 0
/* This is sure to not give problems... */
&& (event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED ||
- event.GetEventType() == wxEVT_UPDATE_UI ))
+ event.GetEventType() == wxEVT_UPDATE_UI )
#else
/* This was tested on wxMSW and worked... */
&& event.GetEventObject() != m_pClientWindow
event.GetEventType() == wxEVT_KILL_FOCUS ||
event.GetEventType() == wxEVT_CHILD_FOCUS ||
event.GetEventType() == wxEVT_COMMAND_SET_FOCUS ||
- event.GetEventType() == wxEVT_COMMAND_KILL_FOCUS ))
+ event.GetEventType() == wxEVT_COMMAND_KILL_FOCUS )
#endif
+ )
{
res = m_pActiveChild->GetEventHandler()->ProcessEvent(event);
}
{
if (m_pClientWindow && m_pClientWindow->GetSelection() != -1)
{
- int active = m_pClientWindow->GetSelection() + 1;
+ size_t active = m_pClientWindow->GetSelection() + 1;
if (active >= m_pClientWindow->GetPageCount())
active = 0;
if (pMenuBar && m_pWindowMenu)
{
// Remove old window menu
- int pos = pMenuBar->FindMenu(_T("&Window"));
+ int pos = pMenuBar->FindMenu(_("&Window"));
if (pos != wxNOT_FOUND)
{
wxASSERT(m_pWindowMenu == pMenuBar->GetMenu(pos)); // DBG:: We're going to delete the wrong menu!!!
{
if (pMenuBar && m_pWindowMenu)
{
- int pos = pMenuBar->FindMenu(_T("Help"));
+ int pos = pMenuBar->FindMenu(_("Help"));
if (pos == wxNOT_FOUND)
{
- pMenuBar->Append(m_pWindowMenu, _T("&Window"));
+ pMenuBar->Append(m_pWindowMenu, _("&Window"));
}
else
{
- pMenuBar->Insert(pos, m_pWindowMenu, _T("&Window"));
+ pMenuBar->Insert(pos, m_pWindowMenu, _("&Window"));
}
}
}
wxGenericMDIClientWindow *pClientWindow = pParentFrame->GetClientWindow();
// Remove page if still there
- int pos;
+ size_t pos;
for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
{
if (pClientWindow->GetPage(pos) == this)
}
else
{
- if (pClientWindow->GetPageCount() - 1 >= 0)
+ if ((int)pClientWindow->GetPageCount() - 1 >= 0)
pClientWindow->SetSelection(pClientWindow->GetPageCount() - 1);
}
}
{
wxGenericMDIClientWindow* pClientWindow = parent->GetClientWindow();
- wxASSERT_MSG((pClientWindow != (wxWindow*) NULL), "Missing MDI client window.");
+ wxASSERT_MSG((pClientWindow != (wxWindow*) NULL), wxT("Missing MDI client window.") );
wxPanel::Create(pClientWindow, id, wxDefaultPosition, size, style, name);
if (pClientWindow != NULL)
{
- int pos;
+ size_t pos;
for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
{
if (pClientWindow->GetPage(pos) == this)
if (pClientWindow != NULL)
{
- int pos;
+ size_t pos;
for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
{
if (pClientWindow->GetPage(pos) == this)
#endif // wxUSE_STATUSBAR
}
-void wxGenericMDIChildFrame::OnActivate(wxActivateEvent& event)
+void wxGenericMDIChildFrame::OnActivate(wxActivateEvent& WXUNUSED(event))
{
// Do mothing.
}
{
// do we have _exactly_ one child?
wxWindow *child = (wxWindow *)NULL;
- for ( wxWindowList::Node *node = GetChildren().GetFirst();
+ for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
node;
node = node->GetNext() )
{
return FALSE;
}
-int wxGenericMDIClientWindow::SetSelection(int nPage)
+int wxGenericMDIClientWindow::SetSelection(size_t nPage)
{
int oldSelection = wxNotebook::SetSelection(nPage);
{
wxNotebook::OnSize(event);
- int pos;
+ size_t pos;
for (pos = 0; pos < GetPageCount(); pos++)
{
((wxGenericMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect();
#if wxUSE_GENERIC_MDI_AS_NATIVE
+wxMDIChildFrame * wxMDIParentFrame::GetActiveChild() const
+ {
+ wxGenericMDIChildFrame *pGFrame = wxGenericMDIParentFrame::GetActiveChild();
+ wxMDIChildFrame *pFrame = wxDynamicCast(pGFrame, wxMDIChildFrame);
+
+ wxASSERT_MSG(!(pFrame == NULL && pGFrame != NULL), wxT("Active frame is class not derived from wxMDIChildFrame!"));
+
+ return pFrame;
+ }
+
IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxGenericMDIParentFrame)
IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxGenericMDIChildFrame)
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxGenericMDIClientWindow)