]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/notebook.cpp
mac paths updated
[wxWidgets.git] / src / generic / notebook.cpp
index f5f40f5015f1b26c49a6982529b9a66682beca63..3b0b6d23823e15bd82698ffa885b6e12d2b8d20a 100644 (file)
@@ -35,7 +35,7 @@
     #include  "wx/settings.h"
 #endif
 
-#include  "wx/generic/imaglist.h"
+#include  "wx/imaglist.h"
 #include  "wx/generic/tabg.h"
 
 // ----------------------------------------------------------------------------
@@ -52,7 +52,7 @@
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
 
-BEGIN_EVENT_TABLE(wxNotebook, wxControl)
+BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
     EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
     EVT_SIZE(wxNotebook::OnSize)
     EVT_PAINT(wxNotebook::OnPaint)
@@ -61,7 +61,7 @@ BEGIN_EVENT_TABLE(wxNotebook, wxControl)
     EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
 END_EVENT_TABLE()
 
-IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
 IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
 
 // ============================================================================
@@ -84,7 +84,7 @@ class WXDLLEXPORT wxNotebookTabView: public wxTabView
 DECLARE_DYNAMIC_CLASS(wxNotebookTabView)
 public:
     wxNotebookTabView(wxNotebook* notebook, long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR);
-    ~wxNotebookTabView(void);
+    virtual ~wxNotebookTabView(void);
 
     // Called when a tab is activated
     virtual void OnTabActivate(int activateId, int deactivateId);
@@ -106,7 +106,7 @@ private:
 
 static int GetPageId(wxTabView *tabview, wxNotebookPage *page)
 {
-    return static_cast<wxNotebookTabView*>(tabview)->GetId(page);
+    return wx_static_cast(wxNotebookTabView*, tabview)->GetId(page);
 }
 
 // ----------------------------------------------------------------------------
@@ -150,13 +150,14 @@ bool wxNotebook::Create(wxWindow *parent,
     // base init
     SetName(name);
 
+    if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        style |= wxBK_TOP;
+
     m_windowId = id == wxID_ANY ? NewControlId() : id;
 
     if (!wxControl::Create(parent, id, pos, size, style|wxNO_BORDER, wxDefaultValidator, name))
         return false;
 
-    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
-
     SetTabView(new wxNotebookTabView(this));
 
     return true;
@@ -189,6 +190,12 @@ int wxNotebook::SetSelection(size_t nPage)
     return 0;
 }
 
+int wxNotebook::ChangeSelection(size_t nPage)
+{
+    // FIXME: currently it does generate events too
+    return SetSelection(nPage);
+}
+
 #if 0
 void wxNotebook::AdvanceSelection(bool bForward)
 {