X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a6f6393c3f42fc0d14b6815fb7a4cf5549b53501..0fab3a5a1a0729cb417c05d50712bd9083b02801:/include/wx/generic/tabg.h diff --git a/include/wx/generic/tabg.h b/include/wx/generic/tabg.h index 5ae093690b..905fad790e 100644 --- a/include/wx/generic/tabg.h +++ b/include/wx/generic/tabg.h @@ -12,15 +12,17 @@ #ifndef __TABGH_G__ #define __TABGH_G__ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "tabg.h" #endif #define WXTAB_VERSION 1.1 -#include "wx/hash.h" +#include "wx/hashmap.h" #include "wx/string.h" #include "wx/dialog.h" +#include "wx/panel.h" +#include "wx/list.h" class WXDLLEXPORT wxTabView; @@ -37,30 +39,30 @@ public: ~wxTabControl(void); virtual void OnDraw(wxDC& dc, bool lastInRow); - inline void SetLabel(const wxString& str) { m_controlLabel = str; } - inline wxString GetLabel(void) const { return m_controlLabel; } + void SetLabel(const wxString& str) { m_controlLabel = str; } + wxString GetLabel(void) const { return m_controlLabel; } - inline void SetFont(const wxFont& f) { m_labelFont = f; } - inline wxFont *GetFont(void) const { return (wxFont*) & m_labelFont; } + void SetFont(const wxFont& f) { m_labelFont = f; } + wxFont *GetFont(void) const { return (wxFont*) & m_labelFont; } - inline void SetSelected(bool sel) { m_isSelected = sel; } - inline bool IsSelected(void) const { return m_isSelected; } + void SetSelected(bool sel) { m_isSelected = sel; } + bool IsSelected(void) const { return m_isSelected; } - inline void SetPosition(int x, int y) { m_offsetX = x; m_offsetY = y; } - inline void SetSize(int x, int y) { m_width = x; m_height = y; } + void SetPosition(int x, int y) { m_offsetX = x; m_offsetY = y; } + void SetSize(int x, int y) { m_width = x; m_height = y; } - inline void SetRowPosition(int r) { m_rowPosition = r; } - inline int GetRowPosition() const { return m_rowPosition; } - inline void SetColPosition(int c) { m_colPosition = c; } - inline int GetColPosition() const { return m_colPosition; } + void SetRowPosition(int r) { m_rowPosition = r; } + int GetRowPosition() const { return m_rowPosition; } + void SetColPosition(int c) { m_colPosition = c; } + int GetColPosition() const { return m_colPosition; } - inline int GetX(void) const { return m_offsetX; } - inline int GetY(void) const { return m_offsetY; } - inline int GetWidth(void) const { return m_width; } - inline int GetHeight(void) const { return m_height; } + int GetX(void) const { return m_offsetX; } + int GetY(void) const { return m_offsetY; } + int GetWidth(void) const { return m_width; } + int GetHeight(void) const { return m_height; } - inline int GetId(void) const { return m_id; } - inline void SetId(int i) { m_id = i; } + int GetId(void) const { return m_id; } + void SetId(int i) { m_id = i; } virtual bool HitTest(int x, int y) const ; @@ -91,6 +93,8 @@ class WXDLLEXPORT wxTabLayer: public wxList * The wxTabView controls and draws the tabbed object */ +WX_DECLARE_LIST(wxTabLayer, wxTabLayerList); + #define wxTAB_STYLE_DRAW_BOX 1 // Draws 3D boxes round tab layers #define wxTAB_STYLE_COLOUR_INTERIOR 2 // Colours interior of tabs, otherwise draws outline @@ -101,8 +105,12 @@ public: wxTabView(long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR); ~wxTabView(); - inline int GetNumberOfLayers() const { return m_layers.Number(); } - inline wxList& GetLayers() { return m_layers; } + inline int GetNumberOfLayers() const { return m_layers.GetCount(); } +#if WXWIN_COMPATIBILITY_2_4 + inline wxList& GetLayers() { return (wxList&)m_layers; } +#else + inline wxTabLayerList& GetLayers() { return m_layers; } +#endif inline void SetWindow(wxWindow* wnd) { m_window = wnd; } inline wxWindow* GetWindow(void) const { return m_window; } @@ -119,7 +127,7 @@ public: wxString GetTabText(int id) const; // Layout tabs (optional, e.g. if resizing window) - void Layout(void); + void LayoutTabs(); // Draw all tabs virtual void Draw(wxDC& dc); @@ -149,7 +157,7 @@ public: inline wxPen *GetBackgroundPen(void) const { return m_backgroundPen; } inline wxBrush *GetBackgroundBrush(void) const { return m_backgroundBrush; } - inline void SetViewRect(const wxRectangle& rect) { m_tabViewRect = rect; } + inline void SetViewRect(const wxRect& rect) { m_tabViewRect = rect; } inline wxRect GetViewRect(void) const { return m_tabViewRect; } // Calculate tab width to fit to view, and optionally adjust the view @@ -195,7 +203,7 @@ public: inline wxFont *GetSelectedTabFont() const { return (wxFont*) & m_tabSelectedFont; } inline void SetSelectedTabFont(const wxFont& f) { m_tabSelectedFont = f; } // Find the node and the column at which this control is positioned. - wxNode *FindTabNodeAndColumn(wxTabControl *control, int *col) const ; + wxList::compatibility_iterator FindTabNodeAndColumn(wxTabControl *control, int *col) const ; // Do the necessary to change to this tab virtual bool ChangeTab(wxTabControl *control); @@ -208,7 +216,7 @@ public: protected: // List of layers, from front to back. - wxList m_layers; + wxTabLayerList m_layers; // Selected tab int m_tabSelection; @@ -319,6 +327,9 @@ protected: DECLARE_EVENT_TABLE() }; +WX_DECLARE_HASH_MAP(int, wxWindow*, wxIntegerHash, wxIntegerEqual, + wxIntToWindowHashMap); + class WXDLLEXPORT wxPanelTabView: public wxTabView { DECLARE_DYNAMIC_CLASS(wxPanelTabView) @@ -336,14 +347,14 @@ public: inline wxWindow *GetCurrentWindow() const { return m_currentWindow; } void ShowWindowForTab(int id); - inline wxList& GetWindows() const { return (wxList&) m_tabWindows; } + // inline wxList& GetWindows() const { return (wxList&) m_tabWindows; } protected: // List of panels, one for each tab. Indexed // by tab ID. - wxList m_tabWindows; - wxWindow* m_currentWindow; - wxPanel* m_panel; + wxIntToWindowHashMap m_tabWindows; + wxWindow* m_currentWindow; + wxPanel* m_panel; }; #endif