Removed dependency on wxTabView.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -231,6 +231,8 @@ public:
|
|||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
void OnPageChanged(wxNotebookEvent& event);
|
void OnPageChanged(wxNotebookEvent& event);
|
||||||
|
|
||||||
|
int FindPage(const wxNotebookPage* page);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DoSetSize(int x, int y,
|
virtual void DoSetSize(int x, int y,
|
||||||
@@ -242,7 +244,6 @@ protected:
|
|||||||
void DoGetSize(int *width, int *height) const ;
|
void DoGetSize(int *width, int *height) const ;
|
||||||
void DoGetPosition(int *x, int *y) const ;
|
void DoGetPosition(int *x, int *y) const ;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
#define XtWindow XTWINDOW
|
#define XtWindow XTWINDOW
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/tab.h"
|
|
||||||
#include "wx/mdi.h"
|
#include "wx/mdi.h"
|
||||||
#include "wx/menu.h"
|
#include "wx/menu.h"
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
@@ -427,8 +426,15 @@ wxMDIChildFrame::~wxMDIChildFrame()
|
|||||||
wxMDIClientWindow* clientWindow = parentFrame->GetClientWindow();
|
wxMDIClientWindow* clientWindow = parentFrame->GetClientWindow();
|
||||||
|
|
||||||
// Remove page if still there
|
// 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
|
// Set the selection to the first remaining page
|
||||||
if (clientWindow->GetPageCount() > 0)
|
if (clientWindow->GetPageCount() > 0)
|
||||||
@@ -547,9 +553,14 @@ void wxMDIChildFrame::SetTitle(const wxString& title)
|
|||||||
{
|
{
|
||||||
wxTopLevelWindow::SetTitle( title );
|
wxTopLevelWindow::SetTitle( title );
|
||||||
wxMDIClientWindow* clientWindow = GetMDIParentFrame()->GetClientWindow();
|
wxMDIClientWindow* clientWindow = GetMDIParentFrame()->GetClientWindow();
|
||||||
int pageNo = clientWindow->FindPagePosition(this);
|
|
||||||
if (pageNo > -1)
|
// Remove page if still there
|
||||||
clientWindow->SetPageText(pageNo, title);
|
{
|
||||||
|
int i = clientWindow->FindPage(this);
|
||||||
|
|
||||||
|
if (i != -1)
|
||||||
|
clientWindow->SetPageText(i, title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MDI operations
|
// MDI operations
|
||||||
@@ -635,17 +646,24 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
|
|||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
wxFont font(10, wxSWISS, wxNORMAL, wxNORMAL);
|
wxFont font(10, wxSWISS, wxNORMAL, wxNORMAL);
|
||||||
wxFont selFont(10, wxSWISS, wxNORMAL, wxBOLD);
|
SetFont(font);
|
||||||
GetTabView()->SetTabFont(font);
|
|
||||||
GetTabView()->SetSelectedTabFont(selFont);
|
|
||||||
GetTabView()->SetTabSize(120, 18);
|
|
||||||
GetTabView()->SetTabSelectionHeight(20);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
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)
|
void wxMDIClientWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
|
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
|
||||||
|
Reference in New Issue
Block a user