X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ed39ff57b30a70a2395e07887a70bc01e7a3b7ec..973ac5bbb2ca39f0f3e21b85c1c130d2215f1552:/src/motif/mdi.cpp diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp index 95be276fbc..daf09e2582 100644 --- a/src/motif/mdi.cpp +++ b/src/motif/mdi.cpp @@ -18,7 +18,6 @@ #define XtWindow XTWINDOW #endif -#include "wx/tab.h" #include "wx/mdi.h" #include "wx/menu.h" #include "wx/settings.h" @@ -427,8 +426,15 @@ wxMDIChildFrame::~wxMDIChildFrame() wxMDIClientWindow* clientWindow = parentFrame->GetClientWindow(); // Remove page if still there - if (clientWindow->RemovePage(this)) - clientWindow->Refresh(); + { + int i = clientWindow->FindPage(this); + + if (i != -1) + { + clientWindow->RemovePage(i); + clientWindow->Refresh(); + } + } // Set the selection to the first remaining page if (clientWindow->GetPageCount() > 0) @@ -547,9 +553,14 @@ void wxMDIChildFrame::SetTitle(const wxString& title) { wxTopLevelWindow::SetTitle( title ); wxMDIClientWindow* clientWindow = GetMDIParentFrame()->GetClientWindow(); - int pageNo = clientWindow->FindPagePosition(this); - if (pageNo > -1) - clientWindow->SetPageText(pageNo, title); + + // Remove page if still there + { + int i = clientWindow->FindPage(this); + + if (i != -1) + clientWindow->SetPageText(i, title); + } } // MDI operations @@ -635,17 +646,24 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) if (success) { wxFont font(10, wxSWISS, wxNORMAL, wxNORMAL); - wxFont selFont(10, wxSWISS, wxNORMAL, wxBOLD); - GetTabView()->SetTabFont(font); - GetTabView()->SetSelectedTabFont(selFont); - GetTabView()->SetTabSize(120, 18); - GetTabView()->SetTabSelectionHeight(20); + SetFont(font); return TRUE; } else return FALSE; } +int wxMDIClientWindow::FindPage(const wxNotebookPage* page) +{ + for (int i = GetPageCount() - 1; i >= 0; --i) + { + if (GetPage(i) == page) + return i; + } + + return -1; +} + void wxMDIClientWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags) { wxWindow::DoSetSize(x, y, width, height, sizeFlags);