soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
STabCtrl Class Reference

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.
 
STabPageGetItem (int iPage)
 Gets a tab page by index.
 
STabPageGetPage (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 STabPageCreatePageFromXml (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;amp;strAttribName, const SNS::SStringW &amp;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< ISkinObjm_pSkinTab
 
SAutoRefPtr< ISkinObjm_pSkinIcon
 
SAutoRefPtr< ISkinObjm_pSkinTabInter
 
SAutoRefPtr< ISkinObjm_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
 

Detailed Description

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.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

Definition at line 137 of file STabCtrl.h.

◆ TEXTDIR

enum STabCtrl::TEXTDIR
protected

Definition at line 145 of file STabCtrl.h.

Constructor & Destructor Documentation

◆ STabCtrl()

STabCtrl::STabCtrl ( )

Constructor for STabCtrl.

Definition at line 286 of file STabCtrl.cpp.

◆ ~STabCtrl()

virtual STabCtrl::~STabCtrl ( )
inlinevirtual

Destructor for STabCtrl.

Definition at line 163 of file STabCtrl.h.

Member Function Documentation

◆ BeforePaint()

void STabCtrl::BeforePaint ( IRenderTarget * pRT,
SPainter & painter )
protectedvirtual

Prepares the rendering target for painting the current window.

Parameters
pRTPointer to the rendering target.
painterPainter object.

Reimplemented from SWindow.

Definition at line 897 of file STabCtrl.cpp.

◆ CreateChildren()

BOOL STabCtrl::CreateChildren ( SXmlNode xmlNode)
protectedvirtual

Creates tab pages from an XML node.

Parameters
xmlNodeXML node containing the tab page definitions.
Returns
TRUE if successful, otherwise FALSE.

Reimplemented from SWindow.

Definition at line 635 of file STabCtrl.cpp.

◆ CreatePageFromXml()

STabPage * STabCtrl::CreatePageFromXml ( SXmlNode xmlPage)
protectedvirtual

Definition at line 658 of file STabCtrl.cpp.

◆ DrawItem()

void STabCtrl::DrawItem ( IRenderTarget * pRT,
const CRect & rcItem,
int iItem,
DWORD dwState )
protectedvirtual

Draws a tab item.

Parameters
pRTPointer to the rendering target.
rcItemRectangle of the item to draw.
iItemIndex of the item.
dwStateState of the item.

Definition at line 759 of file STabCtrl.cpp.

◆ DrawTextV()

void STabCtrl::DrawTextV ( IRenderTarget * pRT,
CRect rcText,
const SStringT & strText )
protected

Draws text vertically.

Parameters
pRTPointer to the rendering target.
rcTextRectangle for the text.
strTextText to draw.

Definition at line 943 of file STabCtrl.cpp.

◆ GetChildrenLayoutRect()

void STabCtrl::GetChildrenLayoutRect ( RECT * prc)
protected

Gets the layout rectangle for child windows.

Parameters
prcPointer to the rectangle to receive the layout rectangle.

Definition at line 380 of file STabCtrl.cpp.

◆ GetCurSel()

int STabCtrl::GetCurSel ( )

Gets the index of the currently selected tab page.

Returns
Index of the currently selected tab page.

Definition at line 987 of file STabCtrl.cpp.

◆ GetItem()

STabPage * STabCtrl::GetItem ( int iPage)

Gets a tab page by index.

Parameters
iPageIndex of the tab page.
Returns
Pointer to the tab page.

Definition at line 506 of file STabCtrl.cpp.

◆ GetItemCount()

int STabCtrl::GetItemCount ( )

Gets the number of tab pages.

Returns
Number of tab pages.

Definition at line 992 of file STabCtrl.cpp.

◆ GetItemRect()

BOOL STabCtrl::GetItemRect ( int nIndex,
CRect & rcItem )
protectedvirtual

Gets the rectangle of a specified tab item.

Parameters
nIndexIndex of the tab item.
rcItemRectangle to receive the item position.
Returns
TRUE if successful, otherwise FALSE.

Definition at line 735 of file STabCtrl.cpp.

◆ GetPage() [1/2]

IWindow * STabCtrl::GetPage ( int nIndex)

Gets a tab page by index.

Parameters
nIndexIndex of the tab page.
Returns
Pointer to the tab page.

Definition at line 543 of file STabCtrl.cpp.

◆ GetPage() [2/2]

STabPage * STabCtrl::GetPage ( LPCTSTR pszName,
BOOL bTitle = TRUE )

Gets a tab page by name or title.

Parameters
pszNameName or title of the page.
bTitleTRUE if pszName is a title, FALSE if it is a name.
Returns
Pointer to the tab page.

Definition at line 535 of file STabCtrl.cpp.

◆ GetPageIndex()

int STabCtrl::GetPageIndex ( LPCTSTR pszName,
BOOL bTitle )

Gets the index of a tab page by name or title.

Parameters
pszNameName or title of the page.
bTitleTRUE if pszName is a title, FALSE if it is a name.
Returns
Index of the found page.

Definition at line 513 of file STabCtrl.cpp.

◆ GetTitleRect()

CRect STabCtrl::GetTitleRect ( )
protectedvirtual

Gets the rectangle of the tab header.

Returns
Rectangle of the tab header.

Definition at line 713 of file STabCtrl.cpp.

◆ HitTest()

int STabCtrl::HitTest ( CPoint pt)
protected

Performs a hit test on the tab control.

Parameters
ptMouse position.
Returns
Index of the tab item under the mouse, or -1 if none.

Definition at line 859 of file STabCtrl.cpp.

◆ InsertItem() [1/2]

int STabCtrl::InsertItem ( LPCWSTR lpContent,
int iInsert = -1 )

Inserts a new tab page.

Parameters
lpContentXML description of the page.
iInsertPosition to insert the page.
Returns
Index of the inserted page.

Definition at line 665 of file STabCtrl.cpp.

◆ InsertItem() [2/2]

int STabCtrl::InsertItem ( SXmlNode xmlNode,
int iInsert = -1,
BOOL bLoading = FALSE )
protectedvirtual

Inserts a new tab page from an XML node.

Parameters
xmlNodeXML node containing the tab page definition.
iInsertPosition to insert the page.
bLoadingTRUE if the page is being loaded.
Returns
Index of the inserted page.

Definition at line 673 of file STabCtrl.cpp.

◆ MeasureTextV()

SIZE STabCtrl::MeasureTextV ( IRenderTarget * pRT,
const SStringT & strText )
protected

Measures text vertically.

Parameters
pRTPointer to the rendering target.
strTextText to measure.
Returns
Size of the text.

Definition at line 924 of file STabCtrl.cpp.

◆ OnColorize()

void STabCtrl::OnColorize ( COLORREF cr)
protectedvirtual

Adjusts the color tone of the window.

Parameters
crThe color reference used for colorization.

Reimplemented from SWindow.

Definition at line 949 of file STabCtrl.cpp.

◆ OnDestroy()

void STabCtrl::OnDestroy ( )
protected

Handles the destroy event.

Definition at line 496 of file STabCtrl.cpp.

◆ OnGetDlgCode()

virtual UINT WINAPI STabCtrl::OnGetDlgCode ( ) const
inlineprotectedvirtual

Gets the dialog code for the window.

Returns
Dialog code.

Definition at line 330 of file STabCtrl.h.

◆ OnInitFinished()

void STabCtrl::OnInitFinished ( IXmlNode * xmlNode)
protected

Definition at line 875 of file STabCtrl.cpp.

◆ OnItemInserted()

virtual void STabCtrl::OnItemInserted ( STabPage * pItem)
inlineprotectedvirtual

Handles the insertion of a tab page.

Parameters
pItemPointer to the inserted tab page.

Definition at line 276 of file STabCtrl.h.

◆ OnItemRemoved()

virtual void STabCtrl::OnItemRemoved ( STabPage * pItem)
inlineprotectedvirtual

Handles the removal of a tab page.

Parameters
pItemPointer to the removed tab page.

Definition at line 284 of file STabCtrl.h.

◆ OnKeyDown()

void STabCtrl::OnKeyDown ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handles the key down event.

Parameters
nCharVirtual key code of the key.
nRepCntRepeat count for the key.
nFlagsFlags associated with the key event.

Definition at line 837 of file STabCtrl.cpp.

◆ OnLanguageChanged()

HRESULT STabCtrl::OnLanguageChanged ( )
protectedvirtual

Called when the language of the window changes.

Returns
HRESULT Result of the operation.

Reimplemented from SWindow.

Definition at line 975 of file STabCtrl.cpp.

◆ OnLButtonDown()

void STabCtrl::OnLButtonDown ( UINT nFlags,
CPoint point )
protected

Handles the left mouse button down event.

Parameters
nFlagsFlags associated with the mouse event.
pointMouse position.

Definition at line 403 of file STabCtrl.cpp.

◆ OnMouseLeave()

void STabCtrl::OnMouseLeave ( )
inlineprotected

Handles the mouse leave event.

Definition at line 409 of file STabCtrl.h.

◆ OnMouseMove()

void STabCtrl::OnMouseMove ( UINT nFlags,
CPoint point )
protected

Handles the mouse move event.

Parameters
nFlagsFlags associated with the mouse event.
pointMouse position.

Definition at line 453 of file STabCtrl.cpp.

◆ OnPaint()

void STabCtrl::OnPaint ( IRenderTarget * pRT)
protected

Handles the paint event.

Parameters
pRTPointer to the rendering target.

Definition at line 314 of file STabCtrl.cpp.

◆ OnScaleChanged()

void STabCtrl::OnScaleChanged ( int scale)
protectedvirtual

Called when the scale of the window changes.

Parameters
scaleThe new scale value.

Reimplemented from SWindow.

Definition at line 962 of file STabCtrl.cpp.

◆ OnSliderFinish()

void STabCtrl::OnSliderFinish ( )
protected

Definition at line 550 of file STabCtrl.cpp.

◆ RemoveAllItems()

void STabCtrl::RemoveAllItems ( void )

Removes all tab pages.

Definition at line 440 of file STabCtrl.cpp.

◆ RemoveItem()

BOOL STabCtrl::RemoveItem ( int nIndex,
int iSelPage = 0 )

Removes a tab page by index.

Parameters
nIndexIndex of the tab page to remove.
iSelPageIndex of the page to select after removal.
Returns
TRUE if successful, otherwise FALSE.

Definition at line 413 of file STabCtrl.cpp.

◆ SetAttribute()

virtual HRESULT STabCtrl::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
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.

◆ SetCurSel() [1/2]

BOOL STabCtrl::SetCurSel ( int nIndex)

Sets the currently selected tab page.

Parameters
nIndexIndex of the tab page to select.
Returns
TRUE if successful, otherwise FALSE.

Definition at line 560 of file STabCtrl.cpp.

◆ SetCurSel() [2/2]

BOOL STabCtrl::SetCurSel ( LPCTSTR pszName,
BOOL bTitle = TRUE )

Sets the currently selected tab page by name or title.

Parameters
pszNameName or title of the page.
bTitleTRUE if pszName is a title, FALSE if it is a name.
Returns
TRUE if successful, otherwise FALSE.

Definition at line 612 of file STabCtrl.cpp.

◆ SetItemTitle()

BOOL STabCtrl::SetItemTitle ( int nIndex,
LPCTSTR lpszTitle )

Sets the title of a tab page.

Parameters
nIndexIndex of the tab page.
lpszTitleNew title for the tab page.
Returns
TRUE if successful, otherwise FALSE.

Definition at line 620 of file STabCtrl.cpp.

◆ TextOutV()

void STabCtrl::TextOutV ( IRenderTarget * pRT,
int x,
int y,
const SStringT & strText )
protected

Outputs text vertically.

Parameters
pRTPointer to the rendering target.
xX-coordinate of the text.
yY-coordinate of the text.
strTextText to output.

Definition at line 908 of file STabCtrl.cpp.

◆ UpdateChildrenPosition()

void STabCtrl::UpdateChildrenPosition ( )
protected

Updates the positions of child windows.

Definition at line 887 of file STabCtrl.cpp.

◆ UpdateToolTip()

BOOL STabCtrl::UpdateToolTip ( CPoint pt,
SwndToolTipInfo & tipInfo )
protectedvirtual

Handle tooltip updates.

OnUpdateToolTip

Reimplemented from SWindow.

Definition at line 823 of file STabCtrl.cpp.

Friends And Related Symbol Documentation

◆ STabSlider

friend class STabSlider
friend

Definition at line 118 of file STabCtrl.h.

Member Data Documentation

◆ m_aniInterpolator

SAutoRefPtr<IInterpolator> STabCtrl::m_aniInterpolator
protected

Definition at line 152 of file STabCtrl.h.

◆ m_lstPages

SArray<STabPage *> STabCtrl::m_lstPages
protected

List of tab pages.

Definition at line 135 of file STabCtrl.h.

◆ m_nAniamteType

int STabCtrl::m_nAniamteType
protected

Animation style.

Definition at line 151 of file STabCtrl.h.

◆ m_nAnimateSteps

int STabCtrl::m_nAnimateSteps
protected

Number of animation steps.

Definition at line 150 of file STabCtrl.h.

◆ m_nCurrentPage

int STabCtrl::m_nCurrentPage
protected

Index of the currently selected page.

Definition at line 123 of file STabCtrl.h.

◆ m_nHoverTabItem

int STabCtrl::m_nHoverTabItem
protected

Index of the tab item under the hover state.

Definition at line 122 of file STabCtrl.h.

◆ m_nTabAlign

int STabCtrl::m_nTabAlign
protected

Alignment of the tabs.

Definition at line 133 of file STabCtrl.h.

◆ m_nTabInterSize

SLayoutSize STabCtrl::m_nTabInterSize
protected

Spacing between tab pages.

Definition at line 124 of file STabCtrl.h.

◆ m_nTabPos

SLayoutSize STabCtrl::m_nTabPos
protected

Position of the tabs.

Definition at line 126 of file STabCtrl.h.

◆ m_pSkinFrame

SAutoRefPtr<ISkinObj> STabCtrl::m_pSkinFrame
protected

Skin object for the frame.

Definition at line 130 of file STabCtrl.h.

◆ m_pSkinIcon

SAutoRefPtr<ISkinObj> STabCtrl::m_pSkinIcon
protected

Skin object for the icons.

Definition at line 128 of file STabCtrl.h.

◆ m_pSkinTab

SAutoRefPtr<ISkinObj> STabCtrl::m_pSkinTab
protected

Skin object for the tabs.

Definition at line 127 of file STabCtrl.h.

◆ m_pSkinTabInter

SAutoRefPtr<ISkinObj> STabCtrl::m_pSkinTabInter
protected

Skin object for the tab spacing.

Definition at line 129 of file STabCtrl.h.

◆ m_ptIcon

SLayoutSize STabCtrl::m_ptIcon[2]
protected

Position of the icons.

Definition at line 131 of file STabCtrl.h.

◆ m_ptText

SLayoutSize STabCtrl::m_ptText[2]
protected

Position of the text.

Definition at line 132 of file STabCtrl.h.

◆ m_szTab

SLayoutSize STabCtrl::m_szTab[2]
protected

Size of the tab pages.

Definition at line 125 of file STabCtrl.h.

◆ m_tabSlider

STabSlider* STabCtrl::m_tabSlider
protected

Definition at line 136 of file STabCtrl.h.


The documentation for this class was generated from the following files: