+ wxWindow::ChangeForegroundColour();
+}
+
+void wxNotebook::OnMouseEvent(wxMouseEvent& event)
+{
+ if (m_tabView)
+ m_tabView->OnEvent(event);
+}
+
+void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event) )
+{
+ wxPaintDC dc(this);
+ if (m_tabView)
+ m_tabView->Draw(dc);
+}
+
+wxRect wxNotebook::GetAvailableClientSize()
+{
+ int cw, ch;
+ GetClientSize(& cw, & ch);
+
+ int tabHeight = m_tabView->GetTotalTabHeight();
+
+ // TODO: these margins should be configurable.
+ wxRect rect;
+ rect.x = 6;
+ rect.y = tabHeight + 6;
+ rect.width = cw - 12;
+ rect.height = ch - 4 - rect.y ;
+
+ return rect;
+}
+
+/*
+ * wxNotebookTabView
+ */
+
+IMPLEMENT_CLASS(wxNotebookTabView, wxTabView)
+
+wxNotebookTabView::wxNotebookTabView(wxNotebook *notebook, long style): wxTabView(style)
+{
+ m_notebook = notebook;
+
+ m_notebook->SetTabView(this);
+
+ SetWindow(m_notebook);
+}
+
+wxNotebookTabView::~wxNotebookTabView(void)
+{
+}
+
+// Called when a tab is activated
+void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
+{
+ if (!m_notebook)
+ return;
+
+ wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_notebook->GetId());
+ event.SetEventObject(m_notebook);
+ event.SetSelection(activateId);
+ event.SetOldSelection(deactivateId);
+ m_notebook->GetEventHandler()->ProcessEvent(event);
+
+ /*
+ wxWindow *oldWindow = ((deactivateId == -1) ? 0 : m_notebook->GetPage(deactivateId));
+ wxWindow *newWindow = m_notebook->GetPage(activateId);
+
+ if (oldWindow)
+ {
+ oldWindow->Show(FALSE);
+ oldWindow->Lower();
+ }
+ if (newWindow)
+ {
+ newWindow->Show(TRUE);
+ newWindow->Raise();
+
+ int cw, ch;
+ m_notebook->GetClientSize(& cw, & ch);
+
+ int tabHeight = GetTotalTabHeight();
+ wxRect rect;
+ rect.x = 4;
+ rect.y = tabHeight + 4;
+ rect.width = cw - 8;
+ rect.height = ch - 4 - rect.y ;
+
+ newWindow->SetSize(rect.x + 2, rect.y + 2, rect.width - 2, rect.height - 2);
+ newWindow->Refresh();
+ }
+
+ // TODO: only refresh the tab area.
+ m_notebook->Refresh();
+*/
+}
+
+#if 0
+void wxNotebookTabView::AddTabWindow(int id, wxWindow *window)
+{
+ m_tabWindows.Append((long)id, window);
+ window->Show(FALSE);
+}
+
+wxWindow *wxNotebookTabView::GetTabWindow(int id) const
+{
+ wxNode *node = m_tabWindows.Find((long)id);
+ if (!node)
+ return (wxWindow *) NULL;
+ return (wxWindow *)node->Data();