26 OnDrawLine(pRT, pszBuf, 0, cchText, pRect, uFormat);
30 if (uFormat & (DT_VCENTER | DT_BOTTOM) && !(uFormat & DT_CALCRECT))
33 CRect rcText = *pRect;
34 DrawMultiLine(pRT, pszBuf, cchText, &rcText, uFormat | DT_CALCRECT);
35 CSize szTxt = rcText.Size();
40 rcText.DeflateRect(0, (rcText.Height() - szTxt.cy) / 2);
43 rcText.DeflateRect(0, (rcText.Height() - szTxt.cy));
57 pRT->
DrawText(pszBuf + iBegin, cchText, pRect, uFormat);
60static bool IsAlpha(TCHAR c)
62 return (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z') || c ==
'_';
65static bool IsNumber(TCHAR c)
67 return c >=
'0' && c <=
'9';
70static bool IsHex(TCHAR c)
72 return IsNumber(c) || (c >=
'a' && c <=
'f') || (c >=
'A' && c <=
'F');
75static bool IsDigit(TCHAR c)
77 return IsNumber(c) || c ==
'.' || c ==
',';
80static LPCTSTR SkipWord(LPCTSTR p)
94static LPCTSTR SkipNumber(LPCTSTR p)
96 if (*p && *(p + 1) && (_tcsncmp(p, _T(
"0x"), 2) == 0 || _tcsncmp(p, _T(
"0X"), 2) == 0))
119static LPCTSTR WordNext(LPCTSTR pszBuf,
bool bWordbreak)
122 LPCTSTR p = CharNext(pszBuf);
125 LPCTSTR pWord = SkipWord(pszBuf);
128 LPCTSTR pNum = SkipNumber(pszBuf);
136 int i = 0, nLine = 1;
138 cchText = (int)_tcslen(pszBuf);
140 POINT pt = { pRect->left, pRect->top };
142 int nLineHei = szWord.cy;
143 int nRight = pRect->right;
144 int nLineWid = pRect->right - pRect->left;
145 pRect->right = pRect->left;
147 LPCTSTR pLineHead = p1, pLineTail = p1;
149 LPCTSTR pPrev = NULL;
154 if ((*p1 == _T(
'\n') && p2))
156 if (pLineTail > pLineHead && !(uFormat & DT_CALCRECT))
158 CRect rcText(pRect->left, pt.y, nRight, pt.y + nLineHei);
159 OnDrawLine(pRT, pszBuf, (
int)(pLineHead - pszBuf), (
int)(pLineTail - pLineHead), &rcText, uFormat);
169 if (
m_bWordbreak && *p1 == 0x20 && pt.x == pRect->left && (!pPrev || *pPrev != 0x20))
174 pLineTail = pLineHead = p2;
178 if (pt.x + szWord.cx > nRight)
181 if (pLineTail > pLineHead)
183 if (!(uFormat & DT_CALCRECT))
185 CRect rcText(pRect->left, pt.y, nRight, pt.y + nLineHei);
186 OnDrawLine(pRT, pszBuf, (
int)(pLineHead - pszBuf), (
int)(pLineTail - pLineHead), &rcText, uFormat);
193 pLineHead = pLineTail;
212 LPCTSTR p4 = CharNext(p3);
214 if (szWord.cx + szChar.cx > nLineWid)
219 szWord.cx = szChar.cx;
227 szWord.cx += szChar.cx;
233 if (pt.x > pRect->right && uFormat & DT_CALCRECT)
240 if (uFormat & DT_CALCRECT)
242 if (pRect->bottom > pt.y + nLineHei)
243 pRect->bottom = pt.y + nLineHei;
245 else if (pLineTail > pLineHead)
247 CRect rcText(pRect->left, pt.y, nRight, pt.y + nLineHei);
248 OnDrawLine(pRT, pszBuf, (
int)(pLineHead - pszBuf), (
int)(pLineTail - pLineHead), &rcText, uFormat);
272 if (!(uFormat & DT_CALCRECT))
275 pRT->
DrawText(pszBuf, cchText, &rc, DT_LEFT | DT_CALCRECT);
277 if (
m_style.GetTextAlign() & DT_CENTER)
279 m_rcText.left = pRect->left + (pRect->right - pRect->left - rc.Width()) / 2;
282 else if (
m_style.GetTextAlign() & DT_RIGHT)
284 m_rcText.left = pRect->right - rc.Width();
290 m_rcText.right = pRect->left + rc.Width();
293 if (
m_style.GetTextAlign() & DT_VCENTER)
295 m_rcText.top = pRect->top + (pRect->bottom - pRect->top - rc.Height()) / 2;
298 else if (
m_style.GetTextAlign() & DT_BOTTOM)
309 __baseCls::DrawText(pRT, pszBuf, cchText, pRect, uFormat);
314 __baseCls::OnInitFinished(pNode);
323 HCURSOR hCursor = GETRESPROVIDER->LoadCursor(
m_style.m_strCursor);
324 ::SetCursor(hCursor);
332 __baseCls::OnLButtonDown(nFlags, pt);
342 __baseCls::OnLButtonUp(nFlags, pt);
347 ::ShellExecute(NULL, _T(
"open"), strUrl, NULL, NULL, SW_SHOWNORMAL);
384 m_pBgSkin = GETBUILTINSKIN(SKIN_SYS_BTN_NORMAL);
420 if (nChar == VK_SPACE || nChar == VK_RETURN)
432 if (nChar == VK_SPACE || nChar == VK_RETURN)
461 if (!strText.IsEmpty() && (strText[strText.GetLength() - 1] == _T(
')')))
463 int pos = strText.ReverseFind(_T(
'('));
464 if ((pos != -1) && (strText[++pos] == _T(
'&')))
466 SStringT strAccelT = _T(
"alt+");
467 strAccelT += strText[++pos];
487 __baseCls::OnDestroy();
492 SStringT strAccelT = S_CW2T(strAccel);
509 __baseCls::OnStateChanged(dwOldState, dwNewState);
524 __baseCls::OnSize(nType, size);
574 ,
m_fl(kNone_FilterLevel)
594 if (rcWnd.IsRectEmpty())
602 szImg =
m_pSkin->GetSkinSize();
603 if (szImg.cx == 0 || szImg.cy == 0)
606 float fWndRatio = rcWnd.Width() * 1.0f / rcWnd.Height();
607 float fImgRatio = szImg.cx * 1.0f / szImg.cy;
608 if (fWndRatio > fImgRatio)
610 int nWid = (int)(rcWnd.Height() * fImgRatio);
611 rcWnd.DeflateRect((rcWnd.Width() - nWid) / 2, 0);
615 int nHei = (int)(rcWnd.Width() / fImgRatio);
616 rcWnd.DeflateRect(0, (rcWnd.Height() - nHei) / 2);
622 CRect rcImg(CPoint(0, 0),
m_pImg->Size());
689 if (nSubID < 0 || nSubID >
m_pSkin->GetStates() - 1)
702 szRet =
m_pSkin->GetSkinSize();
704 szRet.cx += rcPadding.left + rcPadding.right;
705 szRet.cy += rcPadding.top + rcPadding.bottom;
711 __baseCls::OnColorize(cr);
718 __baseCls::OnScaleChanged(scale);
758 EventImageAnimateStart evt(
this);
768 EventImageAnimateStop evt(
this);
777 __baseCls::OnDestroy();
784 szRet =
m_pSkin->GetSkinSize();
790 __baseCls::OnShowWindow(bShow, nStatus);
815 int nStates =
m_pSkin->GetStates();
828 EventImageAnimateRepeat evt(
this);
839 __baseCls::OnColorize(cr);
858 __baseCls::OnScaleChanged(scale);
888 szRet.cx = sizeBg.cx + rcMargin.left + rcMargin.right;
892 szRet.cy = sizeBg.cy + rcMargin.top + rcMargin.bottom;
896 szRet.cy = sizeBg.cy + rcMargin.top + rcMargin.bottom;
900 szRet.cx = sizeBg.cx + rcMargin.left + rcMargin.right;
915 CRect rcValue = rcClient;
919 rcValue.bottom = rcClient.bottom;
935 pRT->
DrawText(strPercent, strPercent.GetLength(),
GetWindowRect(), DT_SINGLELINE | DT_CENTER | DT_VCENTER);
965 SSLOGW() <<
"invalid range: min=" << nMin <<
" max=" << nMax;
987 __baseCls::OnColorize(cr);
996 __baseCls::OnScaleChanged(scale);
1017 pts[0] = rcWnd.TopLeft();
1021 pts[1].x = rcWnd.right, pts[1].y = rcWnd.top;
1024 pts[1].x = rcWnd.left, pts[1].y = rcWnd.bottom;
1027 pts[1] = rcWnd.BottomRight();
1041 :
m_pSkin(GETBUILTINSKIN(SKIN_SYS_CHECKBOX))
1054 CSize szCheck =
m_pSkin->GetSkinSize();
1055 CRect rcCheckBox(rcClient.TopLeft(), szCheck);
1056 rcCheckBox.OffsetRect(0, (rcClient.Height() - szCheck.cy) / 2);
1065 szCheck =
m_pSkin->GetSkinSize();
1066 pRect->left += szCheck.cx + CheckBoxSpacing;
1073 __baseCls::OnPaint(pRT);
1085 __baseCls::DrawFocus(pRT);
1092 return __baseCls::MeasureContent(wid, hei);
1093 CSize szCheck =
m_pSkin->GetSkinSize();
1094 CSize szRet = __baseCls::MeasureContent(wid, hei);
1095 szRet.cx += szCheck.cx + CheckBoxSpacing;
1096 szRet.cy = smax(szRet.cy, szCheck.cy);
1111 if (nChar == VK_SPACE)
1130 __baseCls::OnColorize(cr);
1139 __baseCls::OnScaleChanged(nScale);
1163 pRT->
DrawIconEx(rcClient.left, rcClient.top,
m_theIcon, rcClient.Width(), rcClient.Height(), DI_NORMAL);
1170 ICONINFO iconInfo = { 0 };
1172 if (iconInfo.hbmColor)
1173 DeleteObject(iconInfo.hbmColor);
1174 if (iconInfo.hbmMask)
1175 DeleteObject(iconInfo.hbmMask);
1177 return CSize(iconInfo.xHotspot * 2, iconInfo.yHotspot * 2);
1190HRESULT SIconWnd::OnAttrIcon(
const SStringW &value, BOOL bLoading)
1193 m_strIconSrc = value;
1194 return bLoading ? S_FALSE : S_OK;
1199 if (!m_strIconSrc.IsEmpty())
1201 SStringT strIconID2 = S_CW2T(m_strIconSrc);
1202 SStringTList strLst;
1203 int nSegs = ParseResID(strIconID2, strLst);
1206 int cx = _ttoi(strLst[1]) * scale / 100;
1225 :
m_pSkin(GETBUILTINSKIN(SKIN_SYS_RADIO))
1241 CSize szRadioBox =
m_pSkin->GetSkinSize();
1242 CRect rcRadioBox = rcClient;
1246 case SwndStyle::Align_Center:
1247 rcRadioBox.left += (rcClient.Width() - szRadioBox.cx) / 2;
1249 case SwndStyle::Align_Right:
1250 rcRadioBox.left = rcClient.right - szRadioBox.cx;
1255 case SwndStyle::VAlign_Middle:
1256 rcRadioBox.top += (rcClient.Height() - szRadioBox.cy) / 2;
1258 case SwndStyle::VAlign_Bottom:
1259 rcRadioBox.top = rcClient.bottom - szRadioBox.cy;
1262 rcRadioBox.right = rcRadioBox.left + szRadioBox.cx;
1263 rcRadioBox.bottom = rcRadioBox.top + szRadioBox.cy;
1273 szRadioBox =
m_pSkin->GetSkinSize();
1277 case SwndStyle::Align_Left:
1280 case SwndStyle::Align_Right:
1286 case SwndStyle::VAlign_Top:
1289 case SwndStyle::VAlign_Bottom:
1299 __baseCls::OnPaint(pRT);
1311 __baseCls::DrawFocus(pRT);
1317 CSize szRet = __baseCls::MeasureContent(wid, hei);
1318 CSize szRaio =
m_pSkin->GetSkinSize();
1320 szRet.cy = smax(szRet.cy, szRaio.cy);
1398 __baseCls::OnColorize(cr);
1407 __baseCls::OnScaleChanged(nScale);
1442 SRadioBox *pRadio = sobj_cast<SRadioBox>(pChild);
1455 if (evt->Sender() ==
this)
1459 if (evt->GetID() == EventSwndStateChanged::EventID && evt->Sender() && evt->Sender()->IsClass(
SRadioBox::GetClassName()))
1461 EventSwndStateChanged *evt2 = sobj_cast<EventSwndStateChanged>(evt);
1464 EventRadioGroupCheckChanged evt3(
this);
1465 SRadioBox *pSender = sobj_cast<SRadioBox>(evt->Sender());
1466 evt3.pChecked = pSender->
IsChecked() ? pSender : NULL;
1487 m_pSkin = GETBUILTINSKIN(SKIN_SYS_TREE_TOGGLE);
1517#define GROUP_HEADER 20
1518#define GROUP_ROUNDCORNOR 4
1521 :
m_crLine1(RGBA(0xF0, 0xF0, 0xF0, 0xFF))
1522 , m_crLine2(RGBA(0xA0, 0xA0, 0xA0, 0xFF))
1524 m_nRound.setSize(GROUP_ROUNDCORNOR, SLayoutSize::dp);
1539 rcText.left += GROUP_HEADER, rcText.right -= GROUP_HEADER;
1540 rcText.bottom = rcText.top + szFnt.cy + 2;
1543 rcText.left += (rcText.Width() - szFnt.cx) / 2;
1544 rcText.right = rcText.left + szFnt.cx;
1548 rcText.left = rcText.right - szFnt.cx;
1552 rcText.right = rcText.left + szFnt.cx;
1555 if (!
m_strText.GetText(FALSE).IsEmpty())
1557 CRect rcClip = rcText;
1558 rcClip.InflateRect(5, 5, 5, 5);
1565 if (!
m_strText.GetText(FALSE).IsEmpty())
1566 rcGroupBox.top += szFnt.cy / 2;
1567 rcGroupBox.DeflateRect(1, 1, 1, 0);
1571 pRT->
CreatePen(PS_SOLID, m_crLine2, 1, &pen2);
1578 rcGroupBox.InflateRect(1, 1, 1, -1);
1584 if (!
m_strText.GetText(FALSE).IsEmpty())
1595 __baseCls::GetChildrenLayoutRect(prc);
1601 __baseCls::GetDesiredSize(psz, nParentWid, nParentHei);
static DWORD TranslateAccelKey(LPCTSTR pszKeyName)
Translates a string to an accelerator key value.
void OnNextFrame() OVERRIDE
处理下一帧事件
void OnScaleChanged(int scale) override
处理缩放变化事件
BOOL WINAPI IsPlaying() SCONST
判断动画运行状态
int m_nRepeat
播放循环次数,-1代表无限循环
void OnPaint(IRenderTarget *pRT)
绘制控件
virtual SIZE MeasureContent(int wid, int hei)
测量内容大小
virtual void OnContainerChanged(ISwndContainer *pOldContainer, ISwndContainer *pNewContainer)
容器改变处理函数
SAutoRefPtr< ISkinObj > m_pSkin
动画图片
void OnShowWindow(BOOL bShow, UINT nStatus)
处理显示窗口事件
virtual void OnColorize(COLORREF cr)
处理颜色化事件
int m_iTimeFrame
OnNextFrame的执行次数
IResProviderMgr * GetResProviderMgr() OVERRIDE
Get the resource provider manager.
Smart pointer class for managing COM-style reference-counted objects.
void OnLButtonUp(UINT nFlags, CPoint pt)
处理鼠标左键释放事件
CRect GetCheckRect()
获取复选框矩形区域
void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
处理按键按下事件
virtual void OnScaleChanged(int scale)
处理缩放变化事件
void OnPaint(IRenderTarget *pRT)
处理绘制事件
virtual void GetTextRect(LPRECT pRect)
获取文本显示区域的大小
SAutoRefPtr< ISkinObj > m_pSkin
状态图片资源
virtual void DrawFocus(IRenderTarget *pRT)
绘制焦点样式
virtual void OnColorize(COLORREF cr)
处理颜色化事件
SIZE MeasureContent(int wid, int hei) override
测量内容所需的大小
SAutoRefPtr< ISkinObj > m_pFocusSkin
焦点状态资源
HRESULT OnAttrCheck(const SStringW &strValue, BOOL bLoading)
处理自定义属性 "checked"
BOOL addEvent(DWORD dwEventID, LPCWSTR pszEventHandlerName)
添加一个新事件到事件集
void setMutedState(BOOL setting)
设置事件集的静音状态
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显示使用的两种颜色
SIZE MeasureContent(int wid, int hei) override
测量内容大小
void OnScaleChanged(int scale) override
Called when the scale of the window changes.
void OnPaint(IRenderTarget *pRT)
绘制控件
void SetIcon(HICON hIcon) OVERRIDE
设置图标
virtual SIZE MeasureContent(int nParentWid, int nParentHei)
测量内容大小
virtual void OnColorize(COLORREF cr)
处理颜色化事件
BOOL m_bManaged
是否要自动释放当前的m_pSkin对象
SAutoRefPtr< IBitmapS > m_pImg
使用代码设定的图片
virtual void OnScaleChanged(int scale)
处理缩放变化事件
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对象
int toPixelSize(int scale) const
将大小转换为像素值
void OnPaint(IRenderTarget *pRT)
绘制控件
void OnLButtonDown(UINT nFlags, CPoint pt)
处理左键按下事件
virtual void WINAPI OnInitFinished(IXmlNode *pNode)
解析XML设置属性
void OnMouseMove(UINT nFlags, CPoint pt)
处理鼠标移动事件
SStringT m_strLinkUrl
窗口URL
void OnLButtonUp(UINT nFlags, CPoint pt)
处理左键释放事件
virtual void DrawText(IRenderTarget *pRT, LPCTSTR pszBuf, int cchText, LPRECT pRect, UINT uFormat)
绘制文本
void OnMouseHover(WPARAM wParam, CPoint ptPos)
处理鼠标悬停事件
virtual BOOL OnSetCursor(const CPoint &pt)
设置光标样式和位置
BOOL IsClass(LPCWSTR lpszName) SCONST OVERRIDE
Checks if the object is of a specific class.
static LPCWSTR GetClassName()
Helper class for painting.
SAutoRefPtr< ISkinObj > m_pSkinPos
前景资源
virtual void OnColorize(COLORREF cr)
处理颜色化事件
void OnPaint(IRenderTarget *pRT)
绘制控件
BOOL SetValue(int nValue) OVERRIDE
设置进度条进度值
BOOL m_bShowPercent
是否显示百分比
virtual void OnScaleChanged(int scale)
处理缩放变化事件
BOOL IsVertical() SCONST OVERRIDE
判断进度条是否为竖直状态
SAutoRefPtr< ISkinObj > m_pSkinBg
背景资源
void GetRange(int *pMin, int *pMax) SCONST OVERRIDE
获取进度值最小大值
int OnCreate(void *)
处理创建事件
void GetDesiredSize(SIZE *psz, int wid, int hei) OVERRIDE
获取预期大小
void SetRange(int nMin, int nMax) OVERRIDE
设置进度值最小大值
virtual void OnColorize(COLORREF cr)
处理颜色化事件
void OnLButtonUp(UINT nFlags, CPoint pt)
处理鼠标左键释放事件
SIZE MeasureContent(int wid, int hei) OVERRIDE
测量内容所需的大小
SAutoRefPtr< ISkinObj > m_pFocusSkin
焦点皮肤资源
void OnSetFocus(SWND wndOld, SFocusManager::FocusChangeReason reason)
处理焦点改变事件
HRESULT OnAttrCheck(const SStringW &strValue, BOOL bLoading)
处理自定义属性 "checked"
virtual void GetTextRect(LPRECT pRect)
获取文本显示区域的大小
virtual void DrawFocus(IRenderTarget *pRT)
绘制焦点样式
SAutoRefPtr< ISkinObj > m_pSkin
定义控件的消息映射
UINT m_uIconVAlign
图标垂直对齐方式
CRect GetRadioRect()
获取单选框显示位置的矩形区域
int m_nRadioBoxSpacing
单选框与文本之间的间距
virtual BOOL NeedRedrawWhenStateChange()
判断状态改变时是否需要重绘控件
virtual void OnScaleChanged(int nScale)
处理缩放变化事件
UINT m_uIconAlign
图标水平对齐方式
virtual SWindow * GetSelectedSiblingInGroup()
获取当前组中被选中的兄弟控件
virtual void OnStateChanging(DWORD dwOldState, DWORD dwNewState)
处理状态变化事件
void OnPaint(IRenderTarget *pRT)
绘制控件
virtual void OnBeforeRemoveChild(SWindow *pChild)
在移除子控件前处理
BOOL ClearCheck()
清除所有选中的单选按钮
BOOL FireEvent(IEvtArgs *evt) OVERRIDE
触发事件
virtual void OnAfterInsertChild(SWindow *pChild)
在插入子控件后处理
BOOL Check(int nID)
检查指定ID的单选按钮
static SApplication * getSingletonPtr(void)
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 void DrawText(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.
SIZE MeasureContent(int nParentWid, int nParentHei) override
测量内容大小
BOOL GetToggle()
获取Toggle属性
void SetToggle(BOOL bToggle, BOOL bUpdate=TRUE)
设置Toggle属性
void OnPaint(IRenderTarget *pRT)
绘制控件
BOOL FireEvent(IEvtArgs *evt) OVERRIDE
Fires an event.
virtual void OnContainerChanged(ISwndContainer *pOldContainer, ISwndContainer *pNewContainer)
Called when the container of the window changes.
SWindow * GetParent() const
Retrieves the parent window.
void OnMouseHover(UINT nFlags, CPoint ptPos)
Handles the mouse hover event.
DWORD GetState() SCONST OVERRIDE
Retrieves the current state of the window.
int GetWindowText(TCHAR *pBuf, int nBufLen, BOOL bRawText) OVERRIDE
Retrieves the window text.
UINT GetTextAlign() const
Retrieves the text alignment of the window.
void OnPaint(IRenderTarget *pRT)
Handles the painting of the window.
int GetScale() SCONST OVERRIDE
Retrieves the scale factor of the window.
CRect GetWindowRect() const
Retrieves the bounding rectangle of the window.
BOOL IsVisible(BOOL bCheckParent=FALSE) SCONST OVERRIDE
Checks if the window is visible.
virtual void OnContentChanged()
Called when the content of the window changes.
ISwndContainer * GetContainer() OVERRIDE
Retrieves the container associated with this window.
void OnMouseLeave()
Handles the mouse leave event.
void SetOwner(SWindow *pOwner)
Sets the owner of the window.
SWindow * FindChildByName(LPCWSTR strName, int nDeep=-1)
Finds a child window by its name.
virtual CRect GetClientRect() const
Retrieves the client rectangle of the window.
void OnLButtonUp(UINT nFlags, CPoint pt)
Handles the left mouse button up event.
void SetCheck(BOOL bCheck) OVERRIDE
Sets the check state of the window.
virtual void BeforePaint(IRenderTarget *pRT, SPainter &painter)
Prepare rendering environment.
BOOL IsChecked() SCONST OVERRIDE
Checks if the window is checked.
SWND GetCapture() SCONST OVERRIDE
Retrieves the window that has captured the mouse.
virtual void AfterPaint(IRenderTarget *pRT, SPainter &painter)
Restore rendering environment.
ILayoutParam * GetLayoutParam() SCONST OVERRIDE
Retrieves the layout parameter object associated with the window.
SWindow * GetWindow(int uCode) const
Retrieves a window based on a given code.
BOOL IsDisabled(BOOL bCheckParent=FALSE) SCONST OVERRIDE
Checks if the window is disabled.
SEventSet * GetEventSet()
Retrieves the event set associated with the window.
BOOL IsFocusable() SCONST OVERRIDE
Checks if the window is focusable.
SAutoRefPtr< ISkinObj > m_pBgSkin
void Invalidate() OVERRIDE
Invalidates the entire window.
void RequestRelayout() OVERRIDE
Requests a relayout of the window.
void GetWindowRect(LPRECT prect) SCONST OVERRIDE
Retrieves the bounding rectangle of the window.
void SetMsgHandled(BOOL bHandled)
Sets the message handled flag.
void GetScaleSkin(SAutoRefPtr< ISkinObj > &pSkin, int nScale)
Retrieves a scaled skin object based on the current scale factor.
BOOL InitFromXml(IXmlNode *pNode) OVERRIDE
Initializes the window from an XML node.
BOOL FireCommand() OVERRIDE
Fires a command event.
DWORD ModifyState(DWORD dwStateAdd, DWORD dwStateRemove, BOOL bUpdate=FALSE) OVERRIDE
Modifies the state of the window.
const SwndStyle & GetStyle() const
Retrieves the style of the window.
SWND m_swnd
Member variables representing various properties of the window.
SWindow * FindChildByID(int nID, int nDeep=-1)
Finds a child window by its ID.
BOOL ReleaseCapture() OVERRIDE
Releases the mouse capture from the window.
Manages the style attributes of SOUI windows.
CRect GetMargin() const
Retrieves the margin rectangle.
CRect GetPadding() const
Retrieves the padding rectangle.
Interface for an accelerator key.
void UnregisterAccelerator(const IAccelerator *pAcc, IAcceleratorTarget *target) PURE
Unregister a keyboard accelerator for the specified target.
void RegisterAccelerator(const IAccelerator *pAcc, IAcceleratorTarget *target) PURE
Register a keyboard accelerator for the specified target.
Base class for all renderable objects.
Interface for rendering target objects.
HRESULT DrawText(LPCTSTR pszText, int cchLen, LPRECT pRc, UINT uFormat) PURE
Draw text within a rectangle.
HRESULT DrawBitmapEx(LPCRECT pRcDest, const IBitmapS *pBitmap, LPCRECT pRcSrc, UINT expendMode, BYTE byAlpha=0xFF) PURE
Draws a bitmap with expansion mode.
HRESULT SelectObject(IRenderObj *pObj, IRenderObj **pOldObj=NULL) PURE
Selects a new rendering object and optionally retrieves the previous one.
HRESULT PushClipRect(LPCRECT pRect, UINT mode=RGN_AND) PURE
Push a rectangular clip region.
HRESULT CreatePen(int iStyle, COLORREF cr, int cWidth, IPenS **ppPen) PURE
Create a pen object.
HRESULT PopClip() PURE
Pop the last clip region from the stack.
HRESULT DrawRoundRect(LPCRECT pRect, POINT pt) PURE
Draw a rounded rectangle outline.
HRESULT DrawLines(LPPOINT pPt, size_t nCount) PURE
Draw a series of connected lines.
HRESULT DrawIconEx(int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT diFlags) PURE
Draw an icon.
HRESULT MeasureText(LPCTSTR pszText, int cchLen, SIZE *psz) PURE
Measure the size of the text.
Interface for Skin Objects.
SOUI Window Container Interface.
BOOL RegisterTimelineHandler(ITimelineHandler *pHandler) PURE
Registers an animation frame handler.
IAcceleratorMgr * GetAcceleratorMgr() PURE
Retrieves the accelerator manager.
BOOL OnFireEvent(IEvtArgs *evt) PURE
Fires an event.
BOOL UnregisterTimelineHandler(ITimelineHandler *pHandler) PURE
Unregisters an animation frame handler.