]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/aui/auibook.h
support SDK < 10.6, fixes #14902
[wxWidgets.git] / include / wx / aui / auibook.h
index bb7af8078754aa4622337539e787624194bfece1..d42d784c5d828f4e76a0d0e2647249efacb19d08 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        wx/aui/auibook.h
 // Purpose:     wxaui: wx advanced user interface - notebook
 // Author:      Benjamin I. Williams
-// Modified by:
+// Modified by: Jens Lody
 // Created:     2006-06-28
 // Copyright:   (C) Copyright 2006, Kirix Corporation, All Rights Reserved.
 // Licence:     wxWindows Library Licence, Version 3.1
 
 #if wxUSE_AUI
 
+#include "wx/aui/tabart.h"
 #include "wx/aui/framemanager.h"
-#include "wx/aui/dockart.h"
-#include "wx/aui/floatpane.h"
 #include "wx/bookctrl.h"
+#include "wx/containr.h"
 
 
 class wxAuiNotebook;
@@ -95,6 +95,7 @@ class WXDLLIMPEXP_AUI wxAuiNotebookPage
 public:
     wxWindow* window;     // page's associated window
     wxString caption;     // caption displayed on the tab
+    wxString tooltip;     // tooltip displayed when hovering over tab title
     wxBitmap bitmap;      // tab's bitmap
     wxRect rect;          // tab's hit rectangle
     bool active;          // true if the page is currently active
@@ -119,254 +120,6 @@ WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiTabContainerButton, wxAuiTabContainerButt
 #endif
 
 
-// tab art class
-
-class WXDLLIMPEXP_AUI wxAuiTabArt
-{
-public:
-
-    wxAuiTabArt() { }
-    virtual ~wxAuiTabArt() { }
-
-    virtual wxAuiTabArt* Clone() = 0;
-    virtual void SetFlags(unsigned int flags) = 0;
-
-    virtual void SetSizingInfo(const wxSize& tabCtrlSize,
-                               size_t tabCount) = 0;
-
-    virtual void SetNormalFont(const wxFont& font) = 0;
-    virtual void SetSelectedFont(const wxFont& font) = 0;
-    virtual void SetMeasuringFont(const wxFont& font) = 0;
-    virtual void SetColour(const wxColour& colour) = 0;
-    virtual void SetActiveColour(const wxColour& colour) = 0;
-
-    virtual void DrawBackground(
-                         wxDC& dc,
-                         wxWindow* wnd,
-                         const wxRect& rect) = 0;
-
-    virtual void DrawTab(wxDC& dc,
-                         wxWindow* wnd,
-                         const wxAuiNotebookPage& pane,
-                         const wxRect& inRect,
-                         int closeButtonState,
-                         wxRect* outTabRect,
-                         wxRect* outButtonRect,
-                         int* xExtent) = 0;
-
-    virtual void DrawButton(
-                         wxDC& dc,
-                         wxWindow* wnd,
-                         const wxRect& inRect,
-                         int bitmapId,
-                         int buttonState,
-                         int orientation,
-                         wxRect* outRect) = 0;
-
-    virtual wxSize GetTabSize(
-                         wxDC& dc,
-                         wxWindow* wnd,
-                         const wxString& caption,
-                         const wxBitmap& bitmap,
-                         bool active,
-                         int closeButtonState,
-                         int* xExtent) = 0;
-
-    virtual int ShowDropDown(
-                         wxWindow* wnd,
-                         const wxAuiNotebookPageArray& items,
-                         int activeIdx) = 0;
-
-    virtual int GetIndentSize() = 0;
-
-    virtual int GetBestTabCtrlSize(
-                         wxWindow* wnd,
-                         const wxAuiNotebookPageArray& pages,
-                         const wxSize& requiredBmpSize) = 0;
-};
-
-
-class WXDLLIMPEXP_AUI wxAuiDefaultTabArt : public wxAuiTabArt
-{
-
-public:
-
-    wxAuiDefaultTabArt();
-    virtual ~wxAuiDefaultTabArt();
-
-    wxAuiTabArt* Clone();
-    void SetFlags(unsigned int flags);
-    void SetSizingInfo(const wxSize& tabCtrlSize,
-                       size_t tabCount);
-
-    void SetNormalFont(const wxFont& font);
-    void SetSelectedFont(const wxFont& font);
-    void SetMeasuringFont(const wxFont& font);
-    void SetColour(const wxColour& colour);
-    void SetActiveColour(const wxColour& colour);
-
-    void DrawBackground(
-                 wxDC& dc,
-                 wxWindow* wnd,
-                 const wxRect& rect);
-
-    void DrawTab(wxDC& dc,
-                 wxWindow* wnd,
-                 const wxAuiNotebookPage& pane,
-                 const wxRect& inRect,
-                 int closeButtonState,
-                 wxRect* outTabRect,
-                 wxRect* outButtonRect,
-                 int* xExtent);
-
-    void DrawButton(
-                 wxDC& dc,
-                 wxWindow* wnd,
-                 const wxRect& inRect,
-                 int bitmapId,
-                 int buttonState,
-                 int orientation,
-                 wxRect* outRect);
-
-    int GetIndentSize();
-
-    wxSize GetTabSize(
-                 wxDC& dc,
-                 wxWindow* wnd,
-                 const wxString& caption,
-                 const wxBitmap& bitmap,
-                 bool active,
-                 int closeButtonState,
-                 int* xExtent);
-
-    int ShowDropDown(
-                 wxWindow* wnd,
-                 const wxAuiNotebookPageArray& items,
-                 int activeIdx);
-
-    int GetBestTabCtrlSize(wxWindow* wnd,
-                 const wxAuiNotebookPageArray& pages,
-                 const wxSize& requiredBmpSize);
-
-protected:
-
-    wxFont m_normalFont;
-    wxFont m_selectedFont;
-    wxFont m_measuringFont;
-    wxColour m_baseColour;
-    wxPen m_baseColourPen;
-    wxPen m_borderPen;
-    wxBrush m_baseColourBrush;
-    wxColour m_activeColour;
-    wxBitmap m_activeCloseBmp;
-    wxBitmap m_disabledCloseBmp;
-    wxBitmap m_activeLeftBmp;
-    wxBitmap m_disabledLeftBmp;
-    wxBitmap m_activeRightBmp;
-    wxBitmap m_disabledRightBmp;
-    wxBitmap m_activeWindowListBmp;
-    wxBitmap m_disabledWindowListBmp;
-
-    int m_fixedTabWidth;
-    int m_tabCtrlHeight;
-    unsigned int m_flags;
-};
-
-
-class WXDLLIMPEXP_AUI wxAuiSimpleTabArt : public wxAuiTabArt
-{
-
-public:
-
-    wxAuiSimpleTabArt();
-    virtual ~wxAuiSimpleTabArt();
-
-    wxAuiTabArt* Clone();
-    void SetFlags(unsigned int flags);
-
-    void SetSizingInfo(const wxSize& tabCtrlSize,
-                       size_t tabCount);
-
-    void SetNormalFont(const wxFont& font);
-    void SetSelectedFont(const wxFont& font);
-    void SetMeasuringFont(const wxFont& font);
-    void SetColour(const wxColour& colour);
-    void SetActiveColour(const wxColour& colour);
-
-    void DrawBackground(
-                 wxDC& dc,
-                 wxWindow* wnd,
-                 const wxRect& rect);
-
-    void DrawTab(wxDC& dc,
-                 wxWindow* wnd,
-                 const wxAuiNotebookPage& pane,
-                 const wxRect& inRect,
-                 int closeButtonState,
-                 wxRect* outTabRect,
-                 wxRect* outButtonRect,
-                 int* xExtent);
-
-    void DrawButton(
-                 wxDC& dc,
-                 wxWindow* wnd,
-                 const wxRect& inRect,
-                 int bitmapId,
-                 int buttonState,
-                 int orientation,
-                 wxRect* outRect);
-
-    int GetIndentSize();
-
-    wxSize GetTabSize(
-                 wxDC& dc,
-                 wxWindow* wnd,
-                 const wxString& caption,
-                 const wxBitmap& bitmap,
-                 bool active,
-                 int closeButtonState,
-                 int* xExtent);
-
-    int ShowDropDown(
-                 wxWindow* wnd,
-                 const wxAuiNotebookPageArray& items,
-                 int activeIdx);
-
-    int GetBestTabCtrlSize(wxWindow* wnd,
-                 const wxAuiNotebookPageArray& pages,
-                 const wxSize& requiredBmpSize);
-
-protected:
-
-    wxFont m_normalFont;
-    wxFont m_selectedFont;
-    wxFont m_measuringFont;
-    wxPen m_normalBkPen;
-    wxPen m_selectedBkPen;
-    wxBrush m_normalBkBrush;
-    wxBrush m_selectedBkBrush;
-    wxBrush m_bkBrush;
-    wxBitmap m_activeCloseBmp;
-    wxBitmap m_disabledCloseBmp;
-    wxBitmap m_activeLeftBmp;
-    wxBitmap m_disabledLeftBmp;
-    wxBitmap m_activeRightBmp;
-    wxBitmap m_disabledRightBmp;
-    wxBitmap m_activeWindowListBmp;
-    wxBitmap m_disabledWindowListBmp;
-
-    int m_fixedTabWidth;
-    unsigned int m_flags;
-};
-
-
-
-
-
-
-
-
-
 class WXDLLIMPEXP_AUI wxAuiTabContainer
 {
 public:
@@ -536,13 +289,16 @@ public:
     bool DeletePage(size_t page);
     bool RemovePage(size_t page);
 
-    size_t GetPageCount() const;
-    wxWindow* GetPage(size_t pageIdx) const;
+    virtual size_t GetPageCount() const;
+    virtual wxWindow* GetPage(size_t pageIdx) const;
     int GetPageIndex(wxWindow* pageWnd) const;
 
     bool SetPageText(size_t page, const wxString& text);
     wxString GetPageText(size_t pageIdx) const;
 
+    bool SetPageToolTip(size_t page, const wxString& text);
+    wxString GetPageToolTip(size_t pageIdx) const;
+
     bool SetPageBitmap(size_t page, const wxBitmap& bitmap);
     wxBitmap GetPageBitmap(size_t pageIdx) const;
 
@@ -571,9 +327,6 @@ public:
     // Gets the height of the notebook for a given page height
     int GetHeightForPageHeight(int pageHeight);
 
-    // Advances the selection, generation page selection events
-    void AdvanceSelection(bool forward = true);
-
     // Shows the window menu
     bool ShowWindowMenu();
 
@@ -583,9 +336,6 @@ public:
     // we don't want focus for ourselves
     // virtual bool AcceptsFocus() const { return false; }
 
-    // Redo sizing after thawing
-    virtual void Thaw();
-
     //wxBookCtrlBase functions
 
     virtual void SetPageSize (const wxSize &size);
@@ -594,15 +344,13 @@ public:
     virtual int GetPageImage(size_t n) const;
     virtual bool SetPageImage(size_t n, int imageId);
 
-    wxWindow* GetCurrentPage () const;
-
     virtual int ChangeSelection(size_t n);
 
     virtual bool AddPage(wxWindow *page, const wxString &text, bool select, 
                          int imageId);
     virtual bool DeleteAllPages();
     virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text,
-                            bool select=false, int imageId=NO_IMAGE);
+                            bool select, int imageId);
 
 protected:
     // Common part of all ctors.
@@ -611,6 +359,9 @@ protected:
     // choose the default border for this window
     virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
 
+    // Redo sizing after thawing
+    virtual void DoThaw();
+
     // these can be overridden
 
     // update the height, return true if it was done or false if the new height