12#ifndef __STABCTRL__H__
13#define __STABCTRL__H__
16#include <helper/SplitString.h>
17#include <proxy/SWindowProxy.h>
18#include <interface/SCtrl-i.h>
28class SOUI_EXP
STabPage :
public TWindowProxy<ITabPage> {
30 friend class STabCtrl;
55 STDMETHOD_(LPCTSTR,
GetTitle)(CTHIS) SCONST OVERRIDE
64 STDMETHOD_(
void,
SetTitle)(THIS_ LPCTSTR lpszTitle) OVERRIDE
101 ATTR_INT(L
"iconIndex",
m_iIcon, FALSE)
117class SOUI_EXP
STabCtrl : public TWindowProxy<ITabCtrl> {
118 friend class STabSlider;
119 DEF_SOBJECT(
SWindow, L
"tabctrl")
136 STabSlider *m_tabSlider;
172 STDMETHOD_(
int, GetCurSel)(THIS) SCONST OVERRIDE;
179 STDMETHOD_(BOOL, SetCurSel)(THIS_
int nIndex) OVERRIDE;
187 STDMETHOD_(BOOL, SetItemTitle)(THIS_
int nIndex, LPCTSTR lpszTitle) OVERRIDE;
195 STDMETHOD_(
int, InsertItem)(THIS_ LPCWSTR lpContent,
int iInsert = -1) OVERRIDE;
201 STDMETHOD_(
int, GetItemCount)(THIS) SCONST OVERRIDE;
208 STDMETHOD_(IWindow *, GetPage)(THIS_
int nIndex) OVERRIDE;
216 STDMETHOD_(BOOL, RemoveItem)(THIS_
int nIndex,
int iSelPage = 0) OVERRIDE;
221 STDMETHOD_(
void, RemoveAllItems)(THIS) OVERRIDE;
229 STDMETHOD_(
int, GetPageIndex)(THIS_ LPCTSTR pszName, BOOL bTitle) OVERRIDE;
245 STabPage *GetPage(LPCTSTR pszName, BOOL bTitle = TRUE);
253 BOOL SetCurSel(LPCTSTR pszName, BOOL bTitle = TRUE);
270 virtual int InsertItem(
SXmlNode xmlNode,
int iInsert = -1, BOOL bLoading = FALSE);
299 STDMETHOD_(
void, GetChildrenLayoutRect)(THIS_ RECT *prc) SCONST OVERRIDE;
305 virtual CRect GetTitleRect();
313 virtual BOOL GetItemRect(
int nIndex, CRect &rcItem);
322 virtual void DrawItem(
IRenderTarget *pRT,
const CRect &rcItem,
int iItem, DWORD dwState);
332 return SC_WANTARROWS;
340 STDMETHOD_(
void, UpdateChildrenPosition)(THIS) OVERRIDE;
342 STDMETHOD_(
void, OnInitFinished)(THIS_
IXmlNode *xmlNode) OVERRIDE;
355 int HitTest(CPoint pt);
357 void OnSliderFinish();
367 void TextOutV(
IRenderTarget *pRT,
int x,
int y,
const SStringT &strText);
375 void DrawTextV(
IRenderTarget *pRT, CRect rcText,
const SStringT &strText);
383 SIZE MeasureTextV(
IRenderTarget *pRT,
const SStringT &strText);
420 void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
428 MSG_WM_PAINT_EX(OnPaint)
429 MSG_WM_DESTROY(OnDestroy)
430 MSG_WM_LBUTTONDOWN(OnLButtonDown)
431 MSG_WM_MOUSEMOVE(OnMouseMove)
432 MSG_WM_MOUSELEAVE(OnMouseLeave)
433 MSG_WM_KEYDOWN(OnKeyDown)
438 ATTR_LAYOUTSIZE2(L
"tabSize",
m_szTab, TRUE)
439 ATTR_LAYOUTSIZE(L
"tabWidth",
m_szTab[0], FALSE)
440 ATTR_LAYOUTSIZE(L
"tabHeight",
m_szTab[1], FALSE)
441 ATTR_LAYOUTSIZE(L
"tabPos",
m_nTabPos, FALSE)
447 ATTR_LAYOUTSIZE(L
"icon-x",
m_ptIcon[0], FALSE)
448 ATTR_LAYOUTSIZE(L
"icon-y",
m_ptIcon[1], FALSE)
449 ATTR_LAYOUTSIZE(L
"text-x",
m_ptText[0], FALSE)
450 ATTR_LAYOUTSIZE(L
"text-y",
m_ptText[1], FALSE)
451 ATTR_ENUM_BEGIN(L
"tabAlign",
int, TRUE)
452 ATTR_ENUM_VALUE(L
"top", AlignTop)
453 ATTR_ENUM_VALUE(L
"left", AlignLeft)
454 ATTR_ENUM_VALUE(L
"right", AlignRight)
455 ATTR_ENUM_VALUE(L
"bottom", AlignBottom)
457 ATTR_ENUM_BEGIN(L
"textDir", TEXTDIR, TRUE)
458 ATTR_ENUM_VALUE(L
"hori", Text_Horz)
459 ATTR_ENUM_VALUE(L
"horizontal", Text_Horz)
460 ATTR_ENUM_VALUE(L
"vert", Text_Vert)
461 ATTR_ENUM_VALUE(L
"vertical", Text_Vert)
462 ATTR_ENUM_END(m_txtDir)
465 ATTR_INTERPOLATOR(L
"interpolator", m_aniInterpolator, FALSE)
466 ATTR_CHAIN_PTR(m_aniInterpolator, 0)
Smart pointer class for managing COM-style reference-counted objects.
Helper class for painting.
SAutoRefPtr< ISkinObj > m_pSkinTabInter
virtual void OnItemInserted(STabPage *pItem)
Handles the insertion of a tab page.
virtual void OnItemRemoved(STabPage *pItem)
Handles the removal of a tab page.
SAutoRefPtr< ISkinObj > m_pSkinFrame
SArray< STabPage * > m_lstPages
STabCtrl()
Constructor for STabCtrl.
SAutoRefPtr< ISkinObj > m_pSkinIcon
void OnMouseLeave()
Handles the mouse leave event.
virtual UINT WINAPI OnGetDlgCode() const
Gets the dialog code for the window.
SLayoutSize m_nTabInterSize
virtual ~STabCtrl()
Destructor for STabCtrl.
SAutoRefPtr< ISkinObj > m_pSkinTab
A tab page within a tab control.
virtual BOOL UpdateToolTip(CPoint pt, SwndToolTipInfo &tipInfo)
Handles tooltip updates.
LPCTSTR GetTitle() SCONST OVERRIDE
Gets the title of the tab page.
STabPage()
Constructor for STabPage.
virtual ~STabPage()
Destructor for STabPage.
void SetTitle(LPCTSTR lpszTitle) OVERRIDE
Sets the title of the tab page.
int GetIconIndex() SCONST OVERRIDE
Gets the icon index of the tab page.
void SetIconIndex(int iIcon) OVERRIDE
Sets the icon index of the tab page.
Class for handling text with translation support.
virtual BOOL UpdateToolTip(CPoint pt, SwndToolTipInfo &tipInfo)
Handle tooltip updates.
void OnMouseMove(UINT nFlags, CPoint pt)
Handles the mouse move event.
void OnDestroy()
Handles the destruction of the window.
void OnPaint(IRenderTarget *pRT)
Handles the painting of the window.
virtual void OnScaleChanged(int scale)
Called when the scale of the window changes.
virtual HRESULT OnLanguageChanged()
Called when the language of the window changes.
virtual void BeforePaint(IRenderTarget *pRT, SPainter &painter)
Prepare rendering environment.
void OnLButtonDown(UINT nFlags, CPoint pt)
Handles the left mouse button down event.
virtual void OnColorize(COLORREF cr)
Adjusts the color tone of the window.
virtual BOOL CreateChildren(SXmlNode xmlNode)
Create child windows from XML node.
Class representing an XML node.
Interface for rendering target objects.