bool DeletePage( const int page );
bool AddPage(wxWindow* win, const wxString& text, const int imageId = -1, void* data = NULL );
wxWindow *GetPageWindow( const int page ) const;
-
- // overriden to do nothing
virtual void AddChild( wxWindow *win );
-
+
protected:
-
+ // wxWin callbacks
+ void OnSize(wxSizeEvent& event);
+
wxImageList* m_imageList;
wxList m_pages;
bool DeletePage( const int page );
bool AddPage(wxWindow* win, const wxString& text, const int imageId = -1, void* data = NULL );
wxWindow *GetPageWindow( const int page ) const;
-
- // overriden to do nothing
virtual void AddChild( wxWindow *win );
-
+
protected:
-
+ // wxWin callbacks
+ void OnSize(wxSizeEvent& event);
+
wxImageList* m_imageList;
wxList m_pages;
//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
+ EVT_SIZE(wxNotebook::OnSize)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxControl)
void wxNotebook::AddChild( wxWindow *win )
{
+ // @@@ normally done in wxWindow::AddChild but for some reason wxNotebook
+ // case is speicla there (Robert?)
+ m_children.Append(win);
+
wxNotebookPage *page = new wxNotebookPage();
page->m_id = GetPageCount();
m_pages.Append( page );
};
+void wxNotebook::OnSize(wxSizeEvent& event)
+{
+ // forward this event to all pages
+ wxNode *node = m_pages.First();
+ while (node)
+ {
+ wxNotebookPage *page = (wxNotebookPage*)node->Data();
+ page->m_clientPanel->ProcessEvent(event);
+
+ node = node->Next();
+ };
+}
+
//-----------------------------------------------------------------------------
// wxTabEvent
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
+ EVT_SIZE(wxNotebook::OnSize)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxControl)
void wxNotebook::AddChild( wxWindow *win )
{
+ // @@@ normally done in wxWindow::AddChild but for some reason wxNotebook
+ // case is speicla there (Robert?)
+ m_children.Append(win);
+
wxNotebookPage *page = new wxNotebookPage();
page->m_id = GetPageCount();
m_pages.Append( page );
};
+void wxNotebook::OnSize(wxSizeEvent& event)
+{
+ // forward this event to all pages
+ wxNode *node = m_pages.First();
+ while (node)
+ {
+ wxNotebookPage *page = (wxNotebookPage*)node->Data();
+ page->m_clientPanel->ProcessEvent(event);
+
+ node = node->Next();
+ };
+}
+
//-----------------------------------------------------------------------------
// wxTabEvent
//-----------------------------------------------------------------------------