X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9fbb7d80f84efc87dc996a49c6da97cda9048f86..6e264997213eb394e0fc87772f4657abf8fe735a:/src/aui/tabmdi.cpp diff --git a/src/aui/tabmdi.cpp b/src/aui/tabmdi.cpp index 816e81e822..f7328f7864 100644 --- a/src/aui/tabmdi.cpp +++ b/src/aui/tabmdi.cpp @@ -82,8 +82,9 @@ wxAuiMDIParentFrame::~wxAuiMDIParentFrame() wxDELETE(m_pClientWindow); #if wxUSE_MENUS + wxDELETE(m_pMyMenuBar); RemoveWindowMenu(GetMenuBar()); - delete m_pWindowMenu; + wxDELETE(m_pWindowMenu); #endif // wxUSE_MENUS } @@ -166,7 +167,7 @@ void wxAuiMDIParentFrame::SetMenuBar(wxMenuBar* pMenuBar) AddWindowMenu(pMenuBar); wxFrame::SetMenuBar(pMenuBar); - m_pMyMenuBar = GetMenuBar(); + //m_pMyMenuBar = GetMenuBar(); } #endif // wxUSE_MENUS @@ -179,7 +180,7 @@ void wxAuiMDIParentFrame::SetChildMenuBar(wxAuiMDIChildFrame* pChild) SetMenuBar(m_pMyMenuBar); // Make sure we know our menu bar is in use - //m_pMyMenuBar = NULL; + m_pMyMenuBar = NULL; } else { @@ -354,6 +355,26 @@ void wxAuiMDIParentFrame::DoGetClientSize(int* width, int* height) const wxFrame::DoGetClientSize(width, height); } +void wxAuiMDIParentFrame::Tile(wxOrientation orient) +{ + wxAuiMDIClientWindow* client_window = GetClientWindow(); + wxASSERT_MSG(client_window, wxT("Missing MDI Client Window")); + + int cur_idx = client_window->GetSelection(); + if (cur_idx == -1) + return; + + if (orient == wxVERTICAL) + { + client_window->Split(cur_idx, wxLEFT); + } + else if (orient == wxHORIZONTAL) + { + client_window->Split(cur_idx, wxTOP); + } +} + + //----------------------------------------------------------------------------- // wxAuiMDIChildFrame //----------------------------------------------------------------------------- @@ -396,6 +417,13 @@ wxAuiMDIChildFrame::wxAuiMDIChildFrame(wxAuiMDIParentFrame *parent, wxAuiMDIChildFrame::~wxAuiMDIChildFrame() { + wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); + if (pParentFrame && pParentFrame->GetActiveChild() == this) + { + pParentFrame->SetActiveChild(NULL); + pParentFrame->SetChildMenuBar(NULL); + } + #if wxUSE_MENUS wxDELETE(m_pMenuBar); #endif // wxUSE_MENUS @@ -701,7 +729,7 @@ bool wxAuiMDIClientWindow::CreateClient(wxAuiMDIParentFrame* parent, long style) wxSize(wxSystemSettings::GetMetric(wxSYS_SMALLICON_X), wxSystemSettings::GetMetric(wxSYS_SMALLICON_Y)); SetUniformBitmapSize(caption_icon_size); - + if (!wxAuiNotebook::Create(parent, wxID_ANY, wxPoint(0,0), @@ -714,7 +742,7 @@ bool wxAuiMDIClientWindow::CreateClient(wxAuiMDIParentFrame* parent, long style) wxColour bkcolour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE); SetOwnBackgroundColour(bkcolour); - m_mgr.GetArtProvider()->SetColour(wxAUI_ART_BACKGROUND_COLOUR, bkcolour); + m_mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_BACKGROUND_COLOUR, bkcolour); return true; }