OS/2 fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include "wx/generic/mdig.h"
|
#include "wx/generic/mdig.h"
|
||||||
|
|
||||||
enum MDI_MENU_ID
|
enum MDI_MENU_ID
|
||||||
{
|
{
|
||||||
wxWINDOWCLOSE = 4001,
|
wxWINDOWCLOSE = 4001,
|
||||||
wxWINDOWCLOSEALL,
|
wxWINDOWCLOSEALL,
|
||||||
@@ -53,9 +53,9 @@ BEGIN_EVENT_TABLE(wxGenericMDIParentFrame, wxFrame)
|
|||||||
EVT_MENU (-1, wxGenericMDIParentFrame::DoHandleMenu)
|
EVT_MENU (-1, wxGenericMDIParentFrame::DoHandleMenu)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxGenericMDIParentFrame::wxGenericMDIParentFrame()
|
wxGenericMDIParentFrame::wxGenericMDIParentFrame()
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGenericMDIParentFrame::wxGenericMDIParentFrame(wxWindow *parent,
|
wxGenericMDIParentFrame::wxGenericMDIParentFrame(wxWindow *parent,
|
||||||
@@ -67,22 +67,22 @@ wxGenericMDIParentFrame::wxGenericMDIParentFrame(wxWindow *parent,
|
|||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
(void)Create(parent, id, title, pos, size, style, name);
|
(void)Create(parent, id, title, pos, size, style, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGenericMDIParentFrame::~wxGenericMDIParentFrame()
|
wxGenericMDIParentFrame::~wxGenericMDIParentFrame()
|
||||||
{
|
{
|
||||||
// Make sure the client window is destructed before the menu bars are!
|
// Make sure the client window is destructed before the menu bars are!
|
||||||
wxDELETE(m_pClientWindow);
|
wxDELETE(m_pClientWindow);
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
if (m_pMyMenuBar)
|
if (m_pMyMenuBar)
|
||||||
{
|
{
|
||||||
delete m_pMyMenuBar;
|
delete m_pMyMenuBar;
|
||||||
m_pMyMenuBar = (wxMenuBar *) NULL;
|
m_pMyMenuBar = (wxMenuBar *) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveWindowMenu(GetMenuBar());
|
RemoveWindowMenu(GetMenuBar());
|
||||||
|
|
||||||
if (m_pWindowMenu)
|
if (m_pWindowMenu)
|
||||||
@@ -162,7 +162,7 @@ void wxGenericMDIParentFrame::SetChildMenuBar(wxGenericMDIChildFrame *pChild)
|
|||||||
{
|
{
|
||||||
// No Child, set Our menu bar back.
|
// No Child, set Our menu bar back.
|
||||||
SetMenuBar(m_pMyMenuBar);
|
SetMenuBar(m_pMyMenuBar);
|
||||||
|
|
||||||
// Make sure we know our menu bar is in use
|
// Make sure we know our menu bar is in use
|
||||||
m_pMyMenuBar = (wxMenuBar*) NULL;
|
m_pMyMenuBar = (wxMenuBar*) NULL;
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ bool wxGenericMDIParentFrame::ProcessEvent(wxEvent& event)
|
|||||||
|
|
||||||
// Let the active child (if any) process the event first.
|
// Let the active child (if any) process the event first.
|
||||||
bool res = FALSE;
|
bool res = FALSE;
|
||||||
if (m_pActiveChild && event.IsKindOf(CLASSINFO(wxCommandEvent))
|
if (m_pActiveChild && event.IsKindOf(CLASSINFO(wxCommandEvent))
|
||||||
#if 0
|
#if 0
|
||||||
/* This is sure to not give problems... */
|
/* This is sure to not give problems... */
|
||||||
&& (event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED ||
|
&& (event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED ||
|
||||||
@@ -302,8 +302,8 @@ void wxGenericMDIParentFrame::RemoveWindowMenu(wxMenuBar *pMenuBar)
|
|||||||
void wxGenericMDIParentFrame::AddWindowMenu(wxMenuBar *pMenuBar)
|
void wxGenericMDIParentFrame::AddWindowMenu(wxMenuBar *pMenuBar)
|
||||||
{
|
{
|
||||||
if (pMenuBar && m_pWindowMenu)
|
if (pMenuBar && m_pWindowMenu)
|
||||||
{
|
{
|
||||||
int pos = pMenuBar->FindMenu(_T("Help"));
|
int pos = pMenuBar->FindMenu(_T("Help"));
|
||||||
if (pos == wxNOT_FOUND)
|
if (pos == wxNOT_FOUND)
|
||||||
{
|
{
|
||||||
pMenuBar->Append(m_pWindowMenu, _T("&Window"));
|
pMenuBar->Append(m_pWindowMenu, _T("&Window"));
|
||||||
@@ -319,7 +319,7 @@ void wxGenericMDIParentFrame::DoHandleMenu(wxCommandEvent &event)
|
|||||||
{
|
{
|
||||||
switch (event.GetId())
|
switch (event.GetId())
|
||||||
{
|
{
|
||||||
case wxWINDOWCLOSE:
|
case wxWINDOWCLOSE:
|
||||||
if (m_pActiveChild)
|
if (m_pActiveChild)
|
||||||
{
|
{
|
||||||
m_pActiveChild->Close();
|
m_pActiveChild->Close();
|
||||||
@@ -327,7 +327,7 @@ void wxGenericMDIParentFrame::DoHandleMenu(wxCommandEvent &event)
|
|||||||
break;
|
break;
|
||||||
case wxWINDOWCLOSEALL:
|
case wxWINDOWCLOSEALL:
|
||||||
{
|
{
|
||||||
#if 0 // code is only needed if next #if is set to 0!
|
#if 0 // code is only needed if next #if is set to 0!
|
||||||
wxGenericMDIChildFrame *pFirstActiveChild = m_pActiveChild;
|
wxGenericMDIChildFrame *pFirstActiveChild = m_pActiveChild;
|
||||||
#endif
|
#endif
|
||||||
while (m_pActiveChild)
|
while (m_pActiveChild)
|
||||||
@@ -340,7 +340,7 @@ void wxGenericMDIParentFrame::DoHandleMenu(wxCommandEvent &event)
|
|||||||
{
|
{
|
||||||
#if 1 // What's best? Delayed deleting or immediate deleting?
|
#if 1 // What's best? Delayed deleting or immediate deleting?
|
||||||
delete m_pActiveChild;
|
delete m_pActiveChild;
|
||||||
#else
|
#else
|
||||||
ActivateNext();
|
ActivateNext();
|
||||||
|
|
||||||
if (pFirstActiveChild == m_pActiveChild)
|
if (pFirstActiveChild == m_pActiveChild)
|
||||||
@@ -425,7 +425,7 @@ wxGenericMDIChildFrame::~wxGenericMDIChildFrame()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bActive)
|
if (bActive)
|
||||||
{
|
{
|
||||||
// Set the new selection to the a remaining page
|
// Set the new selection to the a remaining page
|
||||||
@@ -456,7 +456,7 @@ bool wxGenericMDIChildFrame::Create( wxGenericMDIParentFrame *parent,
|
|||||||
wxASSERT_MSG((pClientWindow != (wxWindow*) NULL), "Missing MDI client window.");
|
wxASSERT_MSG((pClientWindow != (wxWindow*) NULL), "Missing MDI client window.");
|
||||||
|
|
||||||
wxPanel::Create(pClientWindow, id, wxDefaultPosition, size, style, name);
|
wxPanel::Create(pClientWindow, id, wxDefaultPosition, size, style, name);
|
||||||
|
|
||||||
SetMDIParentFrame(parent);
|
SetMDIParentFrame(parent);
|
||||||
|
|
||||||
// This is the currently active child
|
// This is the currently active child
|
||||||
@@ -471,7 +471,7 @@ bool wxGenericMDIChildFrame::Create( wxGenericMDIParentFrame *parent,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
void wxGenericMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
|
void wxGenericMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
|
||||||
{
|
{
|
||||||
wxMenuBar *pOldMenuBar = m_pMenuBar;
|
wxMenuBar *pOldMenuBar = m_pMenuBar;
|
||||||
@@ -480,7 +480,7 @@ void wxGenericMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
|
|||||||
if (m_pMenuBar)
|
if (m_pMenuBar)
|
||||||
{
|
{
|
||||||
wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame();
|
wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame();
|
||||||
|
|
||||||
if (pParentFrame != NULL)
|
if (pParentFrame != NULL)
|
||||||
{
|
{
|
||||||
m_pMenuBar->SetParent(pParentFrame);
|
m_pMenuBar->SetParent(pParentFrame);
|
||||||
@@ -500,20 +500,20 @@ wxMenuBar *wxGenericMDIChildFrame::GetMenuBar() const
|
|||||||
{
|
{
|
||||||
return m_pMenuBar;
|
return m_pMenuBar;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
void wxGenericMDIChildFrame::SetTitle(const wxString& title)
|
void wxGenericMDIChildFrame::SetTitle(const wxString& title)
|
||||||
{
|
{
|
||||||
m_Title = title;
|
m_Title = title;
|
||||||
|
|
||||||
wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame();
|
wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame();
|
||||||
|
|
||||||
if (pParentFrame != NULL)
|
if (pParentFrame != NULL)
|
||||||
{
|
{
|
||||||
wxGenericMDIClientWindow * pClientWindow = pParentFrame->GetClientWindow();
|
wxGenericMDIClientWindow * pClientWindow = pParentFrame->GetClientWindow();
|
||||||
|
|
||||||
if (pClientWindow != NULL)
|
if (pClientWindow != NULL)
|
||||||
{
|
{
|
||||||
int pos;
|
int pos;
|
||||||
for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
|
for (pos = 0; pos < pClientWindow->GetPageCount(); pos++)
|
||||||
{
|
{
|
||||||
@@ -522,12 +522,12 @@ void wxGenericMDIChildFrame::SetTitle(const wxString& title)
|
|||||||
pClientWindow->SetPageText(pos, m_Title);
|
pClientWindow->SetPageText(pos, m_Title);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxGenericMDIChildFrame::GetTitle()
|
wxString wxGenericMDIChildFrame::GetTitle() const
|
||||||
{
|
{
|
||||||
return m_Title;
|
return m_Title;
|
||||||
}
|
}
|
||||||
@@ -560,7 +560,7 @@ void wxGenericMDIChildFrame::OnMenuHighlight(wxMenuEvent& event)
|
|||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
if ( m_pMDIParentFrame)
|
if ( m_pMDIParentFrame)
|
||||||
{
|
{
|
||||||
// we don't have any help text for this item,
|
// we don't have any help text for this item,
|
||||||
// but may be the MDI frame does?
|
// but may be the MDI frame does?
|
||||||
m_pMDIParentFrame->OnMenuHighlight(event);
|
m_pMDIParentFrame->OnMenuHighlight(event);
|
||||||
}
|
}
|
||||||
@@ -633,14 +633,14 @@ void wxGenericMDIChildFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
|||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericMDIChildFrame::SetMDIParentFrame(wxGenericMDIParentFrame* parentFrame)
|
void wxGenericMDIChildFrame::SetMDIParentFrame(wxGenericMDIParentFrame* parentFrame)
|
||||||
{
|
{
|
||||||
m_pMDIParentFrame = parentFrame;
|
m_pMDIParentFrame = parentFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGenericMDIParentFrame* wxGenericMDIChildFrame::GetMDIParentFrame() const
|
wxGenericMDIParentFrame* wxGenericMDIChildFrame::GetMDIParentFrame() const
|
||||||
{
|
{
|
||||||
return m_pMDIParentFrame;
|
return m_pMDIParentFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericMDIChildFrame::Init()
|
void wxGenericMDIChildFrame::Init()
|
||||||
@@ -648,11 +648,11 @@ void wxGenericMDIChildFrame::Init()
|
|||||||
m_pMDIParentFrame = (wxGenericMDIParentFrame *) NULL;
|
m_pMDIParentFrame = (wxGenericMDIParentFrame *) NULL;
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
m_pMenuBar = (wxMenuBar *) NULL;
|
m_pMenuBar = (wxMenuBar *) NULL;
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericMDIChildFrame::DoMoveWindow(int x, int y, int width, int height)
|
void wxGenericMDIChildFrame::DoMoveWindow(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
m_MDIRect = wxRect(x, y, width, height);
|
m_MDIRect = wxRect(x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -714,7 +714,7 @@ int wxGenericMDIClientWindow::SetSelection(int nPage)
|
|||||||
{
|
{
|
||||||
int oldSelection = wxNotebook::SetSelection(nPage);
|
int oldSelection = wxNotebook::SetSelection(nPage);
|
||||||
|
|
||||||
#if !defined(__WXMSW__) // No need to do this for wxMSW as wxNotebook::SetSelection()
|
#if !defined(__WXMSW__) // No need to do this for wxMSW as wxNotebook::SetSelection()
|
||||||
// will already cause this to be done!
|
// will already cause this to be done!
|
||||||
// Handle the page change.
|
// Handle the page change.
|
||||||
PageChanged(oldSelection, nPage);
|
PageChanged(oldSelection, nPage);
|
||||||
|
Reference in New Issue
Block a user