A tab control for managing multiple tab pages. More...
#include <STabCtrl.h>
Public Member Functions | |
| STabCtrl () | |
| Constructor for STabCtrl. | |
| virtual | ~STabCtrl () |
| Destructor for STabCtrl. | |
| int | GetCurSel () SCONST OVERRIDE |
| Gets the index of the currently selected tab page. | |
| BOOL | SetCurSel (int nIndex) OVERRIDE |
| Sets the currently selected tab page. | |
| BOOL | SetItemTitle (int nIndex, LPCTSTR lpszTitle) OVERRIDE |
| Sets the title of a tab page. | |
| int | InsertItem (LPCWSTR lpContent, int iInsert=-1) OVERRIDE |
| Inserts a new tab page. | |
| int | GetItemCount () SCONST OVERRIDE |
| Gets the number of tab pages. | |
| IWindow * | GetPage (int nIndex) OVERRIDE |
| Gets a tab page by index. | |
| BOOL | RemoveItem (int nIndex, int iSelPage=0) OVERRIDE |
| Removes a tab page by index. | |
| void | RemoveAllItems () OVERRIDE |
| Removes all tab pages. | |
| int | GetPageIndex (LPCTSTR pszName, BOOL bTitle) OVERRIDE |
| Gets the index of a tab page by name or title. | |
| STabPage * | GetItem (int iPage) |
| Gets a tab page by index. | |
| STabPage * | GetPage (LPCTSTR pszName, BOOL bTitle=TRUE) |
| Gets a tab page by name or title. | |
| BOOL | SetCurSel (LPCTSTR pszName, BOOL bTitle=TRUE) |
| Sets the currently selected tab page by name or title. | |
Protected Types | |
| enum | { AlignTop , AlignLeft , AlignBottom , AlignRight } |
| enum | TEXTDIR { Text_Horz , Text_Vert } |
Protected Member Functions | |
| BOOL | CreateChildren (SXmlNode xmlNode) |
| Creates tab pages from an XML node. | |
| virtual int | InsertItem (SXmlNode xmlNode, int iInsert=-1, BOOL bLoading=FALSE) |
| Inserts a new tab page from an XML node. | |
| virtual void | OnItemInserted (STabPage *pItem) |
| Handles the insertion of a tab page. | |
| virtual void | OnItemRemoved (STabPage *pItem) |
| Handles the removal of a tab page. | |
| virtual void | BeforePaint (IRenderTarget *pRT, SPainter &painter) |
| Prepares the rendering target for painting the current window. | |
| void | GetChildrenLayoutRect (RECT *prc) SCONST OVERRIDE |
| Gets the layout rectangle for child windows. | |
| virtual CRect | GetTitleRect () |
| Gets the rectangle of the tab header. | |
| virtual BOOL | GetItemRect (int nIndex, CRect &rcItem) |
| Gets the rectangle of a specified tab item. | |
| virtual void | DrawItem (IRenderTarget *pRT, const CRect &rcItem, int iItem, DWORD dwState) |
| Draws a tab item. | |
| virtual STabPage * | CreatePageFromXml (SXmlNode xmlPage) |
| virtual UINT WINAPI | OnGetDlgCode () const |
| Gets the dialog code for the window. | |
| virtual BOOL | UpdateToolTip (CPoint pt, SwndToolTipInfo &tipInfo) |
| Handle tooltip updates. | |
| void | UpdateChildrenPosition () OVERRIDE |
| Updates the positions of child windows. | |
| void | OnInitFinished (IXmlNode *xmlNode) OVERRIDE |
| virtual void | OnColorize (COLORREF cr) |
| Adjusts the color tone of the window. | |
| virtual void | OnScaleChanged (int nScale) |
| Called when the scale of the window changes. | |
| virtual HRESULT | OnLanguageChanged () |
| Called when the language of the window changes. | |
| int | HitTest (CPoint pt) |
| Performs a hit test on the tab control. | |
| void | OnSliderFinish () |
| void | TextOutV (IRenderTarget *pRT, int x, int y, const SStringT &strText) |
| Outputs text vertically. | |
| void | DrawTextV (IRenderTarget *pRT, CRect rcText, const SStringT &strText) |
| Draws text vertically. | |
| SIZE | MeasureTextV (IRenderTarget *pRT, const SStringT &strText) |
| Measures text vertically. | |
| void | OnPaint (IRenderTarget *pRT) |
| Handles the paint event. | |
| void | OnLButtonDown (UINT nFlags, CPoint point) |
| Handles the left mouse button down event. | |
| void | OnMouseMove (UINT nFlags, CPoint point) |
| Handles the mouse move event. | |
| void | OnMouseLeave () |
| Handles the mouse leave event. | |
| void | OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags) |
| Handles the key down event. | |
| void | OnDestroy () |
| Handles the destroy event. | |
| virtual HRESULT | SetAttribute (const SNS::SStringW &amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;strValue, BOOL bLoading=FALSE) |
Protected Attributes | |
| int | m_nHoverTabItem |
| int | m_nCurrentPage |
| SLayoutSize | m_nTabInterSize |
| SLayoutSize | m_szTab [2] |
| SLayoutSize | m_nTabPos |
| SAutoRefPtr< ISkinObj > | m_pSkinTab |
| SAutoRefPtr< ISkinObj > | m_pSkinIcon |
| SAutoRefPtr< ISkinObj > | m_pSkinTabInter |
| SAutoRefPtr< ISkinObj > | m_pSkinFrame |
| SLayoutSize | m_ptIcon [2] |
| SLayoutSize | m_ptText [2] |
| int | m_nTabAlign |
| SArray< STabPage * > | m_lstPages |
| STabSlider * | m_tabSlider |
| enum STabCtrl::TEXTDIR | m_txtDir |
| int | m_nAnimateSteps |
| int | m_nAniamteType |
| SAutoRefPtr< IInterpolator > | m_aniInterpolator |
Friends | |
| class | STabSlider |
A tab control for managing multiple tab pages.
This class represents a tab control that can manage multiple tab pages with various customization options.
Definition at line 117 of file STabCtrl.h.
|
protected |
Definition at line 137 of file STabCtrl.h.
|
protected |
Definition at line 145 of file STabCtrl.h.
| STabCtrl::STabCtrl | ( | ) |
Constructor for STabCtrl.
Definition at line 286 of file STabCtrl.cpp.
|
inlinevirtual |
Destructor for STabCtrl.
Definition at line 163 of file STabCtrl.h.
|
protectedvirtual |
Prepares the rendering target for painting the current window.
| pRT | Pointer to the rendering target. |
| painter | Painter object. |
Reimplemented from SWindow.
Definition at line 897 of file STabCtrl.cpp.
|
protectedvirtual |
Creates tab pages from an XML node.
| xmlNode | XML node containing the tab page definitions. |
Reimplemented from SWindow.
Definition at line 635 of file STabCtrl.cpp.
Definition at line 658 of file STabCtrl.cpp.
|
protectedvirtual |
Draws a tab item.
| pRT | Pointer to the rendering target. |
| rcItem | Rectangle of the item to draw. |
| iItem | Index of the item. |
| dwState | State of the item. |
Definition at line 759 of file STabCtrl.cpp.
|
protected |
Draws text vertically.
| pRT | Pointer to the rendering target. |
| rcText | Rectangle for the text. |
| strText | Text to draw. |
Definition at line 943 of file STabCtrl.cpp.
|
protected |
Gets the layout rectangle for child windows.
| prc | Pointer to the rectangle to receive the layout rectangle. |
Definition at line 380 of file STabCtrl.cpp.
| int STabCtrl::GetCurSel | ( | ) |
Gets the index of the currently selected tab page.
Definition at line 987 of file STabCtrl.cpp.
| STabPage * STabCtrl::GetItem | ( | int | iPage | ) |
Gets a tab page by index.
| iPage | Index of the tab page. |
Definition at line 506 of file STabCtrl.cpp.
| int STabCtrl::GetItemCount | ( | ) |
Gets the number of tab pages.
Definition at line 992 of file STabCtrl.cpp.
|
protectedvirtual |
Gets the rectangle of a specified tab item.
| nIndex | Index of the tab item. |
| rcItem | Rectangle to receive the item position. |
Definition at line 735 of file STabCtrl.cpp.
| IWindow * STabCtrl::GetPage | ( | int | nIndex | ) |
Gets a tab page by index.
| nIndex | Index of the tab page. |
Definition at line 543 of file STabCtrl.cpp.
| STabPage * STabCtrl::GetPage | ( | LPCTSTR | pszName, |
| BOOL | bTitle = TRUE ) |
Gets a tab page by name or title.
| pszName | Name or title of the page. |
| bTitle | TRUE if pszName is a title, FALSE if it is a name. |
Definition at line 535 of file STabCtrl.cpp.
| int STabCtrl::GetPageIndex | ( | LPCTSTR | pszName, |
| BOOL | bTitle ) |
Gets the index of a tab page by name or title.
| pszName | Name or title of the page. |
| bTitle | TRUE if pszName is a title, FALSE if it is a name. |
Definition at line 513 of file STabCtrl.cpp.
|
protectedvirtual |
Gets the rectangle of the tab header.
Definition at line 713 of file STabCtrl.cpp.
|
protected |
Performs a hit test on the tab control.
| pt | Mouse position. |
Definition at line 859 of file STabCtrl.cpp.
| int STabCtrl::InsertItem | ( | LPCWSTR | lpContent, |
| int | iInsert = -1 ) |
Inserts a new tab page.
| lpContent | XML description of the page. |
| iInsert | Position to insert the page. |
Definition at line 665 of file STabCtrl.cpp.
|
protectedvirtual |
Inserts a new tab page from an XML node.
| xmlNode | XML node containing the tab page definition. |
| iInsert | Position to insert the page. |
| bLoading | TRUE if the page is being loaded. |
Definition at line 673 of file STabCtrl.cpp.
|
protected |
Measures text vertically.
| pRT | Pointer to the rendering target. |
| strText | Text to measure. |
Definition at line 924 of file STabCtrl.cpp.
|
protectedvirtual |
Adjusts the color tone of the window.
| cr | The color reference used for colorization. |
Reimplemented from SWindow.
Definition at line 949 of file STabCtrl.cpp.
|
protected |
Handles the destroy event.
Definition at line 496 of file STabCtrl.cpp.
|
inlineprotectedvirtual |
|
protected |
Definition at line 875 of file STabCtrl.cpp.
|
inlineprotectedvirtual |
Handles the insertion of a tab page.
| pItem | Pointer to the inserted tab page. |
Definition at line 276 of file STabCtrl.h.
|
inlineprotectedvirtual |
Handles the removal of a tab page.
| pItem | Pointer to the removed tab page. |
Definition at line 284 of file STabCtrl.h.
|
protected |
Handles the key down event.
| nChar | Virtual key code of the key. |
| nRepCnt | Repeat count for the key. |
| nFlags | Flags associated with the key event. |
Definition at line 837 of file STabCtrl.cpp.
|
protectedvirtual |
Called when the language of the window changes.
Reimplemented from SWindow.
Definition at line 975 of file STabCtrl.cpp.
|
protected |
Handles the left mouse button down event.
| nFlags | Flags associated with the mouse event. |
| point | Mouse position. |
Definition at line 403 of file STabCtrl.cpp.
|
inlineprotected |
Handles the mouse leave event.
Definition at line 409 of file STabCtrl.h.
|
protected |
Handles the mouse move event.
| nFlags | Flags associated with the mouse event. |
| point | Mouse position. |
Definition at line 453 of file STabCtrl.cpp.
|
protected |
Handles the paint event.
| pRT | Pointer to the rendering target. |
Definition at line 314 of file STabCtrl.cpp.
|
protectedvirtual |
Called when the scale of the window changes.
| scale | The new scale value. |
Reimplemented from SWindow.
Definition at line 962 of file STabCtrl.cpp.
|
protected |
Definition at line 550 of file STabCtrl.cpp.
| void STabCtrl::RemoveAllItems | ( | void | ) |
Removes all tab pages.
Definition at line 440 of file STabCtrl.cpp.
| BOOL STabCtrl::RemoveItem | ( | int | nIndex, |
| int | iSelPage = 0 ) |
Removes a tab page by index.
| nIndex | Index of the tab page to remove. |
| iSelPage | Index of the page to select after removal. |
Definition at line 413 of file STabCtrl.cpp.
|
inlineprotectedvirtual |
< Index of the currently selected page.
< Size of the tab pages.
< Width of the tab pages.
< Height of the tab pages.
< Position of the tabs.
< Spacing between tab pages.
< Skin object for the tab spacing.
< Skin object for the tabs.
< Skin object for the icons.
< Skin object for the frame.
< X-coordinate of the icons.
< Y-coordinate of the icons.
< X-coordinate of the text.
< Y-coordinate of the text.
< Align tabs at the top.
< Align tabs on the left.
< Align tabs on the right.
< Align tabs at the bottom.
< Horizontal text direction.
< Horizontal text direction.
< Vertical text direction.
< Vertical text direction.
< Number of animation steps.
< Animation style.
< Interpolator for animations.
< Chain attributes to interpolator.
Reimplemented from SWindow.
Definition at line 436 of file STabCtrl.h.
| BOOL STabCtrl::SetCurSel | ( | int | nIndex | ) |
Sets the currently selected tab page.
| nIndex | Index of the tab page to select. |
Definition at line 560 of file STabCtrl.cpp.
| BOOL STabCtrl::SetCurSel | ( | LPCTSTR | pszName, |
| BOOL | bTitle = TRUE ) |
Sets the currently selected tab page by name or title.
| pszName | Name or title of the page. |
| bTitle | TRUE if pszName is a title, FALSE if it is a name. |
Definition at line 612 of file STabCtrl.cpp.
| BOOL STabCtrl::SetItemTitle | ( | int | nIndex, |
| LPCTSTR | lpszTitle ) |
Sets the title of a tab page.
| nIndex | Index of the tab page. |
| lpszTitle | New title for the tab page. |
Definition at line 620 of file STabCtrl.cpp.
|
protected |
Outputs text vertically.
| pRT | Pointer to the rendering target. |
| x | X-coordinate of the text. |
| y | Y-coordinate of the text. |
| strText | Text to output. |
Definition at line 908 of file STabCtrl.cpp.
|
protected |
Updates the positions of child windows.
Definition at line 887 of file STabCtrl.cpp.
|
protectedvirtual |
Handle tooltip updates.
OnUpdateToolTip
Reimplemented from SWindow.
Definition at line 823 of file STabCtrl.cpp.
|
friend |
Definition at line 118 of file STabCtrl.h.
|
protected |
Definition at line 152 of file STabCtrl.h.
|
protected |
List of tab pages.
Definition at line 135 of file STabCtrl.h.
|
protected |
Animation style.
Definition at line 151 of file STabCtrl.h.
|
protected |
Number of animation steps.
Definition at line 150 of file STabCtrl.h.
|
protected |
Index of the currently selected page.
Definition at line 123 of file STabCtrl.h.
|
protected |
Index of the tab item under the hover state.
Definition at line 122 of file STabCtrl.h.
|
protected |
Alignment of the tabs.
Definition at line 133 of file STabCtrl.h.
|
protected |
Spacing between tab pages.
Definition at line 124 of file STabCtrl.h.
|
protected |
Position of the tabs.
Definition at line 126 of file STabCtrl.h.
|
protected |
Skin object for the frame.
Definition at line 130 of file STabCtrl.h.
|
protected |
Skin object for the icons.
Definition at line 128 of file STabCtrl.h.
|
protected |
Skin object for the tabs.
Definition at line 127 of file STabCtrl.h.
|
protected |
Skin object for the tab spacing.
Definition at line 129 of file STabCtrl.h.
|
protected |
Position of the icons.
Definition at line 131 of file STabCtrl.h.
|
protected |
Position of the text.
Definition at line 132 of file STabCtrl.h.
|
protected |
Size of the tab pages.
Definition at line 125 of file STabCtrl.h.
|
protected |
Definition at line 136 of file STabCtrl.h.