11#ifndef __SCMNCTRL__H__
12#define __SCMNCTRL__H__
16#include <interface/SCtrl-i.h>
17#include <proxy/SWindowProxy.h>
57 virtual void OnDrawLine(
IRenderTarget *pRT, LPCTSTR pszBuf,
int iBegin,
int cchText, LPRECT pRect, UINT uFormat);
197 DEF_SOBJECT(
SWindow, L
"button")
231 virtual BOOL WINAPI OnAcceleratorPressed(
const IAccelerator *accelerator) OVERRIDE;
267 void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
275 void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
287 void OnSize(UINT nType, CSize size);
305 HRESULT OnAttrAccel(
SStringW strAccel, BOOL bLoading);
311 STDMETHOD_(
void, OnNextFrame)(THIS_) OVERRIDE;
316 void StopCurAnimate();
367 DEF_SOBJECT(
SButton, L
"imgbtn")
391class SOUI_EXP
SImageWnd :
public TWindowProxy<IImageWnd> {
413 STDMETHOD_(BOOL,
SetSkin)(THIS_
ISkinObj *pSkin,
int iFrame DEF_VAL(0), BOOL bAutoFree DEF_VAL(TRUE)) OVERRIDE;
426 STDMETHOD_(
void,
SetImage)(THIS_
IBitmapS *pBitmap, FilterLevel fl DEF_VAL(kNone_FilterLevel)) OVERRIDE;
439 STDMETHOD_(BOOL,
SetIcon)(THIS_
int nSubID) OVERRIDE;
499 ATTR_SKIN(L
"skin",
m_pSkin, TRUE)
500 ATTR_INT(L
"iconIndex",
m_iIcon, FALSE)
501 ATTR_INT(L
"tile",
m_iTile, TRUE)
523 : public TWindowProxy<IAnimateImgWnd>
525 DEF_SOBJECT(
SWindow, L
"animateimg")
571 STDMETHOD_(
void, OnNextFrame)(THIS_) OVERRIDE;
611 MSG_WM_PAINT_EX(OnPaint)
612 MSG_WM_DESTROY(OnDestroy)
613 MSG_WM_SHOWWINDOW(OnShowWindow)
617 ATTR_SKIN(L
"skin", m_pSkin, TRUE)
618 ATTR_UINT(L
"speed", m_nSpeed, FALSE)
619 ATTR_BOOL(L
"autoStart", m_bAutoStart, FALSE)
620 ATTR_INT(L
"repeat", m_nRepeat, FALSE)
671class SOUI_EXP
SProgress : public TWindowProxy<IProgress> {
672 DEF_SOBJECT(
SWindow, L
"progress")
685 STDMETHOD_(BOOL,
SetValue)(THIS_
int nValue) OVERRIDE;
701 STDMETHOD_(
void, SetRange)(THIS_
int nMin,
int nMax) OVERRIDE;
708 STDMETHOD_(
void, GetRange)(CTHIS_
int *pMin,
int *pMax) SCONST OVERRIDE;
726 STDMETHOD_(
void, GetDesiredSize)(THIS_ SIZE *psz,
int wid,
int hei) OVERRIDE;
852 ATTR_COLOR(L
"colorLine", m_crLine, FALSE)
853 ATTR_COLOR(L
"lineColor", m_crLine, FALSE)
854 ATTR_INT(L
"lineSize", m_nLineSize, FALSE)
855 ATTR_ENUM_BEGIN(L
"mode", HRMODE, FALSE)
856 ATTR_ENUM_VALUE(L
"vertical", HR_VERT)
857 ATTR_ENUM_VALUE(L
"horizontal", HR_HORZ)
858 ATTR_ENUM_VALUE(L
"tilt", HR_TILT)
859 ATTR_ENUM_END(m_mode)
860 ATTR_ENUM_BEGIN(L
"lineStyle",
int, FALSE)
861 ATTR_ENUM_VALUE(L
"solid", PS_SOLID)
862 ATTR_ENUM_VALUE(L
"dash", PS_DASH)
863 ATTR_ENUM_VALUE(L
"dot", PS_DOT)
864 ATTR_ENUM_VALUE(L
"dashdot", PS_DASHDOT)
865 ATTR_ENUM_VALUE(L
"dashdotdot", PS_DASHDOTDOT)
866 ATTR_ENUM_END(m_nLineStyle)
870 MSG_WM_PAINT_EX(OnPaint)
983 void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
999 HRESULT OnAttrCheck(
const SStringW &strValue, BOOL bLoading);
1005 ATTR_SKIN(L
"skin",
m_pSkin, FALSE)
1013 SOUI_MSG_MAP_BEGIN()
1027class SOUI_EXP
SIconWnd : public TWindowProxy<IIconWnd> {
1045 STDMETHOD_(
void,
SetIcon)(THIS_ HICON hIcon) OVERRIDE;
1062 SOUI_MSG_MAP_BEGIN()
1068 ATTR_CUSTOM(L
"src", OnAttrIcon)
1071 HRESULT OnAttrIcon(
const SStringW &value, BOOL bLoading);
1087 DEF_SOBJECT(
SWindow, L
"radio")
1201 HRESULT OnAttrCheck(
const SStringW &strValue, BOOL bLoading);
1207 ATTR_SKIN(L
"skin",
m_pSkin, FALSE)
1210 ATTR_ENUM_BEGIN(L
"iconAlign", UINT, TRUE)
1211 ATTR_ENUM_VALUE(L
"left",
SwndStyle::Align_Left)
1212 ATTR_ENUM_VALUE(L
"center",
SwndStyle::Align_Center)
1213 ATTR_ENUM_VALUE(L
"right",
SwndStyle::Align_Right)
1215 ATTR_ENUM_BEGIN(L
"iconValign", UINT, TRUE)
1216 ATTR_ENUM_VALUE(L
"top",
SwndStyle::VAlign_Top)
1217 ATTR_ENUM_VALUE(L
"middle",
SwndStyle::VAlign_Middle)
1218 ATTR_ENUM_VALUE(L
"bottom",
SwndStyle::VAlign_Bottom)
1226 SOUI_MSG_MAP_BEGIN()
1265 DEF_SOBJECT(
SWindow, L
"radioGroup")
1278 BOOL
Check(
int nID);
1285 BOOL
Check(LPCTSTR pszName);
1299 STDMETHOD_(BOOL,
FireEvent)(THIS_ IEvtArgs *evt) OVERRIDE;
1333 void SetToggle(BOOL bToggle, BOOL bUpdate = TRUE);
1367 SOUI_MSG_MAP_BEGIN()
1368 MSG_WM_PAINT_EX(OnPaint)
1379 DEF_SOBJECT(
SWindow, L
"group")
1400 STDMETHOD_(
void,
GetDesiredSize)(THIS_ SIZE *psz,
int wid,
int hei) OVERRIDE;
1424 SOUI_MSG_MAP_BEGIN()
1429 ATTR_COLOR(L
"colorLine1",
m_crLine1, FALSE)
1430 ATTR_COLOR(L
"colorLine2", m_crLine2, FALSE)
1431 ATTR_LAYOUTSIZE(L
"round",
m_nRound, FALSE)
Accelerator management module.
Focus management module for DUI windows.
BOOL WINAPI IsPlaying() SCONST
判断动画运行状态
int m_nRepeat
播放循环次数,-1代表无限循环
virtual ~SAnimateImgWnd()
析构函数
SAutoRefPtr< ISkinObj > m_pSkin
动画图片
int m_iTimeFrame
OnNextFrame的执行次数
Smart pointer class for managing COM-style reference-counted objects.
void OnLButtonUp(UINT nFlags, CPoint pt)
处理鼠标左键释放事件
CRect GetCheckRect()
获取复选框矩形区域
virtual UINT WINAPI OnGetDlgCode() const
获取对话框代码
virtual BOOL NeedRedrawWhenStateChange()
判断状态改变时是否需要重绘控件
void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
处理按键按下事件
void OnPaint(IRenderTarget *pRT)
处理绘制事件
SAutoRefPtr< ISkinObj > m_pSkin
状态图片资源
SAutoRefPtr< ISkinObj > m_pFocusSkin
焦点状态资源
HRESULT OnAttrCheck(const SStringW &strValue, BOOL bLoading)
处理自定义属性 "checked"
FocusChangeReason
Reason for focus change.
void GetDesiredSize(SIZE *psz, int wid, int hei) OVERRIDE
获取预期大小
SLayoutSize m_nHeaderHeight
头部高度
void OnPaint(IRenderTarget *pRT)
绘制控件
void GetChildrenLayoutRect(RECT *prc) SCONST OVERRIDE
获取子控件布局矩形
COLORREF m_crLine1
group 3D显示使用的两种颜色
void OnPaint(IRenderTarget *pRT)
绘制控件
void SetIcon(HICON hIcon) OVERRIDE
设置图标
BOOL m_bManaged
是否要自动释放当前的m_pSkin对象
SAutoRefPtr< IBitmapS > m_pImg
使用代码设定的图片
BOOL SetIcon(int nSubID) OVERRIDE
设置图标
void OnPaint(IRenderTarget *pRT)
绘制控件
FilterLevel m_fl
绘制图片的放大精度
void SetImage(IBitmapS *pBitmap, FilterLevel fl=kNone_FilterLevel) OVERRIDE
设置绘制图片
SAutoRefPtr< ISkinObj > m_pSkin
ISkinObj对象
BOOL SetSkin(ISkinObj *pSkin, int iFrame=0, BOOL bAutoFree=TRUE) OVERRIDE
设置skin
int m_iTile
绘制是否平铺, 0–位伸(默认),1–不变常规绘制, 2–平铺
ISkinObj * GetSkin() OVERRIDE
获取资源
IBitmapS * GetImage() OVERRIDE
获取当前设置的IBitmapS对象
void OnLButtonDown(UINT nFlags, CPoint pt)
处理左键按下事件
void OnMouseMove(UINT nFlags, CPoint pt)
处理鼠标移动事件
SStringT m_strLinkUrl
窗口URL
void OnLButtonUp(UINT nFlags, CPoint pt)
处理左键释放事件
void OnMouseHover(WPARAM wParam, CPoint ptPos)
处理鼠标悬停事件
void OnInitFinished(IXmlNode *xmlNode) OVERRIDE
SAutoRefPtr< ISkinObj > m_pSkinPos
前景资源
void OnPaint(IRenderTarget *pRT)
绘制控件
BOOL SetValue(int nValue) OVERRIDE
设置进度条进度值
BOOL m_bShowPercent
是否显示百分比
BOOL IsVertical() SCONST OVERRIDE
判断进度条是否为竖直状态
SAutoRefPtr< ISkinObj > m_pSkinBg
背景资源
int GetValue() SCONST OVERRIDE
获取进度值
int OnCreate(void *)
处理创建事件
void OnLButtonUp(UINT nFlags, CPoint pt)
处理鼠标左键释放事件
SAutoRefPtr< ISkinObj > m_pFocusSkin
焦点皮肤资源
BOOL IsSiblingsAutoGroupped() SCONST OVERRIDE
判断是否自动将相同名称的单选按钮添加到同一组中
void OnSetFocus(SWND wndOld, SFocusManager::FocusChangeReason reason)
处理焦点改变事件
HRESULT OnAttrCheck(const SStringW &strValue, BOOL bLoading)
处理自定义属性 "checked"
UINT OnGetDlgCode() SCONST OVERRIDE
获取对话框代码
SAutoRefPtr< ISkinObj > m_pSkin
定义控件的消息映射
UINT m_uIconVAlign
图标垂直对齐方式
CRect GetRadioRect()
获取单选框显示位置的矩形区域
int m_nRadioBoxSpacing
单选框与文本之间的间距
UINT m_uIconAlign
图标水平对齐方式
void OnPaint(IRenderTarget *pRT)
绘制控件
BOOL ClearCheck()
清除所有选中的单选按钮
BOOL FireEvent(IEvtArgs *evt) OVERRIDE
触发事件
BOOL Check(int nID)
检查指定ID的单选按钮
virtual void OnDrawLine(IRenderTarget *pRT, LPCTSTR pszBuf, int iBegin, int cchText, LPRECT pRect, UINT uFormat)
绘制单行文本
void DrawMultiLine(IRenderTarget *pRT, LPCTSTR pszBuf, int cchText, LPRECT pRect, UINT uFormat)
绘制多行文本
virtual SIZE OnMeasureText(IRenderTarget *pRT, LPCTSTR pszBuf, int cchText)
测量文本大小
A class representing an ASCII string.
BOOL GetToggle()
获取Toggle属性
void SetToggle(BOOL bToggle, BOOL bUpdate=TRUE)
设置Toggle属性
virtual BOOL NeedRedrawWhenStateChange()
状态改变是否需要重画
Base class for SOUI DUI windows.
virtual void OnContainerChanged(ISwndContainer *pOldContainer, ISwndContainer *pNewContainer)
Called when the container of the window changes.
void OnMouseMove(UINT nFlags, CPoint pt)
Handles the mouse move event.
void OnMouseHover(UINT nFlags, CPoint ptPos)
Handles the mouse hover event.
void OnDestroy()
Handles the destruction of the window.
void OnPaint(IRenderTarget *pRT)
Handles the painting of the window.
virtual SIZE MeasureContent(int nParentWid, int nParentHei)
Measures the size of the content within the window.
virtual void OnScaleChanged(int scale)
Called when the scale of the window changes.
int OnCreate(LPVOID)
Handles the creation of the window.
virtual BOOL NeedRedrawWhenStateChange()
Determine if redraw is needed on state change.
void OnSize(UINT nType, CSize size)
Handles the resizing of the window.
void OnLButtonUp(UINT nFlags, CPoint pt)
Handles the left mouse button up event.
virtual void DrawFocus(IRenderTarget *pRT)
Draw focus state.
void OnLButtonDown(UINT nFlags, CPoint pt)
Handles the left mouse button down event.
virtual void OnBeforeRemoveChild(SWindow *pChild)
Called before a child window is removed from this window.
virtual void OnAfterInsertChild(SWindow *pChild)
Called after a child window has been inserted into this window.
virtual void GetTextRect(LPRECT pRect)
Calculate text display rectangle.
virtual void DrawText(IRenderTarget *pRT, LPCTSTR pszBuf, int cchText, LPRECT pRect, UINT uFormat)
Draw text content.
void OnShowWindow(BOOL bShow, UINT nStatus)
Handles showing or hiding the window.
virtual void OnColorize(COLORREF cr)
Adjusts the color tone of the window.
virtual BOOL OnSetCursor(const CPoint &pt)
Sets the cursor when the mouse hovers over the window.
virtual SWindow * GetSelectedSiblingInGroup()
Get selected sibling in group.
virtual void OnStateChanging(DWORD dwOldState, DWORD dwNewState)
Called before the state of the window changes.
BOOL InitFromXml(IXmlNode *pNode) OVERRIDE
Initializes the window from an XML node.
void OnSetFocus(SWND wndOld)
Handles gaining focus.
virtual void OnStateChanged(DWORD dwOldState, DWORD dwNewState)
Called after the state of the window changes.
Manages the style attributes of SOUI windows.
Interface for an accelerator key.
Interface for handling accelerator key presses.
Interface for rendering target objects.
Interface for Skin Objects.
SOUI Window Container Interface.