2#include "control/SMCListView.h"
3#include "helper/SListViewItemLocator.h"
5#pragma warning(disable : 4267 4018)
9class SMCListViewDataSetObserver :
public TObjRefImpl<ILvDataSetObserver> {
11 SMCListViewDataSetObserver(SMCListView *pView)
15 STDMETHOD_(
void, onChanged)(THIS) OVERRIDE;
17 STDMETHOD_(
void, onInvalidated)(THIS) OVERRIDE;
19 STDMETHOD_(
void, OnItemChanged)(THIS_
int iItem) OVERRIDE;
22 SMCListView *m_pOwner;
26void SMCListViewDataSetObserver::onChanged()
28 m_pOwner->onDataSetChanged();
31void SMCListViewDataSetObserver::onInvalidated()
33 m_pOwner->onDataSetInvalidated();
36void SMCListViewDataSetObserver::OnItemChanged(
int iItem)
38 m_pOwner->onItemDataChanged(iItem);
61 m_dwUpdateInterval = 40;
63 m_observer.Attach(
new SMCListViewDataSetObserver(
this));
65 m_evtSet.addEvent(EVENTID(EventLVSelChanging));
66 m_evtSet.addEvent(EVENTID(EventLVSelChanged));
79 SASSERT_MSGA(FALSE,
"error: A item locator is in need before setting adapter!!!");
84 SSLOGW() <<
"the new adapter is same to previous set adapter, same as notifyDatasetChanged";
100 SPOSITION pos = lstItemPanels->GetHeadPosition();
103 SItemPanel *pItemPanel = lstItemPanels->GetNext(pos);
106 delete lstItemPanels;
132 for (
int i = 0; i <
m_adapter->getViewTypeCount(); i++)
145 int nRet =
m_pHeader->InsertItem(nIndex, pszText, nWidth, fmt, lParam, bDpiAware, fWeight);
163 if (!__baseCls::CreateChildren(xmlNode))
169 if (nItemHei.fSize > 0.0f)
173 pItemLocator->Release();
179 pItemLocator->Release();
204 szView.cx =
m_pHeader->GetTotalWidth(
false);
205 int nMinWid =
m_pHeader->GetTotalWidth(
true);
211 if (rcClient.bottom < rcClient.top)
212 rcClient.bottom = rcClient.top;
213 CSize size = rcClient.Size();
215 m_wBarVisible = SSB_NULL;
217 if (size.cy < szView.cy || (size.cy < szView.cy +
GetSbWidth() && size.cx < szView.cx))
220 m_wBarVisible |= SSB_VERT;
222 m_siVer.nMax = szView.cy - 1;
223 m_siVer.nPage = rcClient.Height();
226 if (horzSize < nMinWid)
229 m_wBarVisible |= SSB_HORZ;
233 m_siHoz.nMax = szView.cx - 1;
238 if (horzSize < szView.cx || m_pHeader->IsAutoResize())
240 CRect rcHead =
m_pHeader->GetWindowRect();
241 rcHead.right = rcHead.left + horzSize;
243 szView.cx = horzSize;
246 m_siHoz.nPage = szView.cx;
248 m_siHoz.nMax = m_siHoz.nPage - 1;
255 m_siVer.nPage = size.cy;
257 m_siVer.nMax = size.cy - 1;
260 if (size.cx < nMinWid)
263 m_wBarVisible |= SSB_HORZ;
265 m_siHoz.nMax = szView.cx - 1;
266 m_siHoz.nPage = size.cx;
270 if (size.cx < szView.cx ||
m_pHeader->IsAutoResize())
272 CRect rcHead =
m_pHeader->GetWindowRect();
273 rcHead.right = rcHead.left + size.cx;
278 m_siHoz.nPage = szView.cx;
280 m_siHoz.nMax = m_siHoz.nPage - 1;
286 if (HasScrollBar(FALSE) && m_siHoz.nPos + m_siHoz.nPage > szView.cx)
288 m_siHoz.nPos = szView.cx - m_siHoz.nPage;
291 if (HasScrollBar(TRUE) && m_siVer.nPos + m_siVer.nPage > szView.cy)
293 m_siVer.nPos = szView.cy - m_siVer.nPage;
296 SetScrollPos(TRUE, m_siVer.nPos, TRUE);
297 SetScrollPos(FALSE, m_siHoz.nPos, TRUE);
310 CRect rcHeader(rcClient);
312 rcHeader.left -= m_siHoz.nPos;
335 __baseCls::UpdateChildrenPosition();
346 EventHeaderClick *pEvt2 = sobj_cast<EventHeaderClick>(pEvt);
348 SHDITEM hi = { SHDI_ORDER | SHDI_FORMAT, 0 };
349 UINT *pFmts =
new UINT[
m_pHeader->GetItemCount()];
350 int *pOrders =
new int[
m_pHeader->GetItemCount()];
352 for (
int i = 0; i <
m_pHeader->GetItemCount(); i++)
355 pFmts[hi.iOrder] = hi.fmt;
356 pOrders[hi.iOrder] = i;
357 if (i == pEvt2->iItem)
363 for (
int i = 0; i <
m_pHeader->GetItemCount(); i++)
365 m_pHeader->SetItemSort(pOrders[i], pFmts[i]);
390 rcItem.right =
m_pHeader->GetTotalWidth();
391 ii.pItem->
Move(rcItem);
392 CRect rcSubItem(rcItem);
393 rcSubItem.right = rcSubItem.left = 0;
394 for (
int i = 0; i <
m_pHeader->GetItemCount(); i++)
396 SHDITEM hi = { SHDI_ORDER, 0 };
398 rcSubItem.left = rcSubItem.right;
399 rcSubItem.right +=
m_pHeader->GetItemWidth(i);
401 m_adapter->GetColumnName(hi.iOrder, &strColName);
405 pCol->
Move(rcSubItem);
408 SASSERT(rcSubItem.right ==
m_pHeader->GetTotalWidth());
434 m_pHeader->GetEventSet()->setMutedState(
true);
435 for (
size_t i = 0; i <
m_pHeader->GetItemCount(); i++)
437 int iCol =
m_pHeader->GetOriItemIndex(i);
440 m_pHeader->GetEventSet()->setMutedState(
false);
501 CRect rcClip, rcInter;
520 if (SItemPanel::IsItemInClip(mtx, rcClip, rgnClip, rcItem))
521 ii.pItem->Draw(pRT, rcItem);
527 POINT pts[2] = { { rcItem.left, rcItem.top }, { rcItem.right, rcItem.top } };
530 POINT pts[2] = { { rcItem.left, rcItem.bottom - 1 }, { rcItem.right, rcItem.bottom - 1 } };
534 rcItem.top = rcItem.bottom;
536 if (
m_pSkinDivider && !rcItem.IsRectEmpty() && rgnClip->RectInRegion(&rcItem))
548 POINT pts[2] = { { rcTop.left, rcTop.top }, { rcTop.left, rcBottom.bottom } };
550 pts[0].x--, pts[1].x--;
551 for (
int i = 0; i <
m_pHeader->GetItemCount(); i++)
571 int nOldPos = bVertical ? m_siVer.nPos : m_siHoz.nPos;
572 __baseCls::OnScroll(bVertical, uCode, nPos);
573 int nNewPos = bVertical ? m_siVer.nPos : m_siHoz.nPos;
574 if (nOldPos != nNewPos)
581 if (uCode == SB_THUMBTRACK)
599 int iNewLastVisible = iNewFirstVisible;
604 ItemInfo *pItemInfos =
new ItemInfo[
m_lstItems.GetCount()];
605 SPOSITION spos =
m_lstItems.GetHeadPosition();
614 if (iNewFirstVisible != -1)
616 while (pos < m_siVer.nPos + (
int)m_siVer.nPage && iNewLastVisible < m_adapter->getCount())
619 if (iHoverItem == iNewLastVisible)
624 ItemInfo ii = { NULL, -1 };
625 ii.nType =
m_adapter->getItemViewType(iNewLastVisible, dwState);
627 if (iNewLastVisible >= iOldFirstVisible && iNewLastVisible < iOldLastVisible)
629 int iItem = iNewLastVisible - iOldFirstVisible;
631 SASSERT(iItem >= 0 && iItem <= (iOldLastVisible - iOldFirstVisible));
632 if (pItemInfos[iItem].nType == ii.nType)
634 ii = pItemInfos[iItem];
635 pItemInfos[iItem].pItem = NULL;
638 BOOL bNewItem = FALSE;
641 SList<SItemPanel *> *lstRecycle =
m_itemRecycle.GetAt(ii.nType);
642 if (lstRecycle->IsEmpty())
645 ii.pItem = SItemPanel::Create(
this,
SXmlNode(),
this);
650 ii.pItem = lstRecycle->RemoveHead();
652 ii.pItem->SetItemIndex(iNewLastVisible);
655 CRect rcItem(0, 0,
m_pHeader->GetTotalWidth(), 100000);
659 ii.pItem->
Move(rcItem);
664 ii.pItem->ModifyItemState(dwState, 0);
672 m_adapter->getView(iNewLastVisible, ii.pItem, &xmlNode);
684 m_adapter->getViewDesiredSize(&szView, iNewLastVisible, ii.pItem, rcItem.Width(), rcItem.Height());
686 rcItem.bottom = szView.cy;
687 ii.pItem->
Move(rcItem);
692 CRect rcSubItem(rcItem);
693 rcSubItem.right = rcSubItem.left;
694 for (
int i = 0; i <
m_pHeader->GetItemCount(); i++)
696 SHDITEM hditem = { SHDI_ORDER | SHDI_WIDTH, 0 };
699 m_adapter->GetColumnName(hditem.iOrder, &strColName);
705 rcSubItem.left = rcSubItem.right;
706 rcSubItem.right += hditem.cx;
707 pColWnd->
Move(rcSubItem);
723 for (
int i = 0; i < (iOldLastVisible - iOldFirstVisible); i++)
725 ItemInfo ii = pItemInfos[i];
731 ii.pItem->DoFrameEvent(WM_MOUSELEAVE, 0, 0);
766 m_adapter->getView(iItem, pItem, &xmlNode);
772 __baseCls::OnSize(nType, size);
798 SPOSITION pos = pLstTypeItems->GetHeadPosition();
801 SItemPanel *pItem = pLstTypeItems->GetNext(pos);
804 delete pLstTypeItems;
808 __baseCls::OnDestroy();
820 int iPosition = (int)pItem->GetItemIndex();
821 if (iPosition < 0 || iPosition >=
m_adapter->getCount())
829 int nOffset =
m_lvItemLocator->Item2Position(iPosition) - m_siVer.nPos;
832 rcItem.bottom = rcItem.top +
m_lvItemLocator->GetItemHeight(iPosition);
833 rcItem.left -= m_siHoz.nPos;
834 rcItem.right = rcItem.left +
m_pHeader->GetTotalWidth();
863 CRect rcItem = ii.pItem->GetItemRect();
864 if (rcItem.PtInRect(pt))
866 pt -= rcItem.TopLeft();
892 CPoint pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
897 pt.Offset(-rcItem.TopLeft());
898 lRet =
m_itemCapture->DoFrameEvent(uMsg, wParam, MAKELPARAM(pt.x, pt.y));
902 if (uMsg == WM_LBUTTONDOWN || uMsg == WM_RBUTTONDOWN || uMsg == WM_MBUTTONDOWN)
904 __baseCls::ProcessSwndMessage(uMsg, wParam, lParam, lRet);
907 SItemPanel *pHover =
HitTest(pt);
914 nOldHover->DoFrameEvent(WM_MOUSELEAVE, 0, 0);
919 m_pHoverItem->DoFrameEvent(WM_MOUSEHOVER, wParam, MAKELPARAM(pt.x, pt.y));
925 m_pHoverItem->DoFrameEvent(uMsg, wParam, MAKELPARAM(pt.x, pt.y));
927 else if (uMsg == WM_LBUTTONDOWN || uMsg == WM_RBUTTONDOWN || uMsg == WM_MBUTTONDOWN)
934 if (uMsg == WM_LBUTTONUP || uMsg == WM_RBUTTONUP || uMsg == WM_MBUTTONUP)
936 __baseCls::ProcessSwndMessage(uMsg, wParam, lParam, lRet);
948 lRet = pItem->DoFrameEvent(uMsg, wParam, lParam);
960 __baseCls::OnMouseLeave();
981 pItem->DoFrameEvent(WM_KEYDOWN, nChar, MAKELONG(nFlags, nRepCnt));
987 int nNewSelItem = -1;
989 if (pOwner && (nChar == VK_ESCAPE || nChar == VK_RETURN))
991 pOwner->
SSendMessage(WM_KEYDOWN, nChar, MAKELONG(nFlags, nRepCnt));
1017 if (nChar == VK_PRIOR || nChar == VK_HOME)
1021 nNewSelItem = (int)
m_lstItems.GetHead().pItem->GetItemIndex();
1024 else if (nChar == VK_NEXT || nChar == VK_END)
1028 nNewSelItem = (int)
m_lstItems.GetTail().pItem->GetItemIndex();
1033 if (nNewSelItem != -1)
1037 SetSel(nNewSelItem, TRUE);
1047 if (iItem < 0 || iItem >=
m_adapter->getCount())
1058 if (iItem >= iFirstVisible && iItem < iLastVisible)
1060 if (iItem == iFirstVisible)
1063 OnScroll(TRUE, SB_THUMBPOSITION, pos);
1065 else if (iItem == iLastVisible - 1)
1072 OnScroll(TRUE, SB_THUMBPOSITION, pos);
1079 if (iItem < iFirstVisible)
1082 OnScroll(TRUE, SB_THUMBPOSITION, pos);
1093 OnScroll(TRUE, SB_THUMBPOSITION, pos);
1099 OnScroll(TRUE, SB_THUMBPOSITION, pos);
1108 CRect rcItem = pSelItem->GetItemRect();
1109 CPoint pt2 = pt - rcItem.TopLeft();
1110 if (pSelItem->DoFrameEvent(WM_MOUSEWHEEL, MAKEWPARAM(nFlags, zDelta), MAKELPARAM(pt2.x, pt2.y)))
1113 return __baseCls::OnMouseWheel(nFlags, zDelta, pt);
1125 SPOSITION pos =
m_lstItems.GetHeadPosition();
1129 if ((
int)ii.pItem->GetItemIndex() == iItem)
1149 return __baseCls::UpdateToolTip(pt, tipInfo);
1165 int nNewSel = iItem;
1170 EventLVSelChanging evt(
this);
1171 evt.bCancel = FALSE;
1172 evt.iOldSel = nOldSel;
1173 evt.iNewSel = nNewSel;
1182 if (nOldSel == nNewSel)
1203 EventLVSelChanged evt(
this);
1204 evt.iOldSel = nOldSel;
1205 evt.iNewSel = nNewSel;
1213 return SC_WANTALLKEYS;
1215 return SC_WANTARROWS | SC_WANTSYSKEY;
1220 __baseCls::OnKillFocus(wndFocus);
1232 __baseCls::OnSetFocus(wndOld);
1247 bRet =
m_itemCapture->DoFrameEvent(WM_SETCURSOR, 0, MAKELPARAM(pt.x - rcItem.left, pt.y - rcItem.top)) != 0;
1252 bRet =
m_pHoverItem->DoFrameEvent(WM_SETCURSOR, 0, MAKELPARAM(pt.x - rcItem.left, pt.y - rcItem.top)) != 0;
1256 bRet = __baseCls::OnSetCursor(pt);
1263 SItemPanel *pItemPanel = sobj_cast<SItemPanel>(pEvt->Sender());
1264 int iItem = (int)pItemPanel->GetItemIndex();
1274 __baseCls::OnColorize(cr);
1276 SPOSITION pos =
m_lstItems.GetHeadPosition();
1286 __baseCls::OnScaleChanged(nScale);
1295 HRESULT hret = __baseCls::OnLanguageChanged();
1302 SPOSITION pos =
m_lstItems.GetHeadPosition();
1311 SPOSITION pos = pLstTypeItems->GetHeadPosition();
1314 SItemPanel *pItem = pLstTypeItems->GetNext(pos);
1322 __baseCls::OnShowWindow(bShow, nStatus);
1349 __baseCls::OnRebuildFont();
1375 __baseCls::GetDesiredSize(psz, nParentWid, nParentHei);
1380 psz->cy =
m_lvItemLocator->GetTotalHeight() + rcPadding.top + rcPadding.bottom;
1381 if (nParentHei > 0 && psz->cy > nParentHei)
1382 psz->cy = nParentHei;
1390 int *nWids =
new int[
m_pHeader->GetItemCount()];
1391 for (
int i = 0; i <
m_pHeader->GetItemCount(); i++)
1393 SHDITEM hi = { SHDI_ORDER, 0 };
1395 nWids[hi.iOrder] =
m_pHeader->GetItemWidth(i);
A helper class to enable or disable private UI definitions for the host container.
Smart pointer class for managing COM-style reference-counted objects.
BOOL subscribeEvent(DWORD dwEventID, const IEvtSlot &subscriber)
订阅事件
void setMutedState(BOOL setting)
设置事件集的静音状态
void RestoreFocusedView()
Restores the focused view.
void ClearFocus()
Clears the focused window.
void StoreFocusedView()
Stores the focused view.
void GetDesiredSize(SIZE *psz, int nParentWid, int nParentHei) OVERRIDE
Get the desired size of the control.
void UpdateVisibleItems()
Update visible items.
SHeaderCtrl * GetHeaderCtrl() const
Get the header control.
SList< ItemInfo > m_lstItems
BOOL OnItemClick(IEvtArgs *pEvt)
Handle item click event.
SArray< SList< SItemPanel * > * > m_itemRecycle
virtual void OnRebuildFont()
Handle rebuild font event.
virtual BOOL OnItemGetRect(const SOsrPanel *pItem, CRect &rcItem) const
Get the rectangle of an item.
IHeaderCtrl * GetIHeaderCtrl() SCONST OVERRIDE
Get the header control.
virtual BOOL CreateChildren(SXmlNode xmlNode)
Create child items from XML configuration.
SItemPanel * GetItemPanel(int iItem)
Get the item panel for a specific item.
void UpdateChildrenPosition() OVERRIDE
Update the position of child items.
virtual ~SMCListView()
Destructor.
void onDataSetChanged()
Handle data set changed event.
int GetSel() SCONST OVERRIDE
Get the selected item.
SAutoRefPtr< IListViewItemLocator > m_lvItemLocator
void SetSel(int iItem, BOOL bNotify=FALSE) OVERRIDE
Set the selected item.
CRect GetListRect()
Get the rectangle of the list.
void OnShowWindow(BOOL bShow, UINT nStatus)
Handle show window event.
void OnKillFocus(SWND wndFocus)
Handle kill focus event.
LRESULT OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handle key event.
int GetColumnCount() SCONST OVERRIDE
Get the total number of columns.
BOOL m_bDatasetInvalidated
void DispatchMessage2Items(UINT uMsg, WPARAM wParam, LPARAM lParam)
Dispatch messages to items.
void _UpdateAdapterColumnsWidth() const
Update the column widths in the adapter.
virtual HRESULT OnLanguageChanged()
Handle language change event.
virtual BOOL OnSetCursor(const CPoint &pt)
Handle set cursor event.
void UpdateHeaderCtrl()
Update the header control.
BOOL OnHeaderClick(IEvtArgs *pEvt)
Handle header click event.
SLayoutSize m_nHeaderHeight
virtual BOOL IsItemRedrawDelay() const
Check if item redraw is delayed.
int GetHeaderHeight() const
Get the height of the header.
BOOL SetAdapter(IMcAdapter *adapter) OVERRIDE
Set the adapter for the list view.
void UpdateScrollBar()
Update the scroll bar.
void UpdateVisibleItem(int iItem)
Update a specific visible item.
virtual int GetScrollLineSize(BOOL bVertical)
Get the scroll line size.
BOOL OnHeaderSizeChanging(IEvtArgs *pEvt)
Handle header size changing event.
virtual void OnItemSetCapture(SOsrPanel *pItem, BOOL bCapture)
Handle item capture.
void onDataSetInvalidated()
Handle data set invalidated event.
SAutoRefPtr< IMcAdapter > m_adapter
virtual UINT WINAPI OnGetDlgCode() const
Get the dialog code.
virtual void OnScaleChanged(int nScale)
Handle scale change event.
void OnSize(UINT nType, CSize size)
Handle size change event.
virtual void OnColorize(COLORREF cr)
Handle colorization event.
void RedrawItem(SOsrPanel *pItem)
Redraw a specific item.
BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
Handle mouse wheel event.
void OnPaint(IRenderTarget *pRT)
Paint the control.
int InsertColumn(int nIndex, LPCTSTR pszText, int nWidth, UINT fmt, LPARAM lParam=0, BOOL bDpiAware=TRUE, float fWeight=0.0f) OVERRIDE
Insert a column.
SMCListView()
Constructor.
void DeleteColumn(int iCol) OVERRIDE
Delete a specific column.
CRect _OnItemGetRect(int iPosition) const
Get the rectangle of an item by position.
void OnSetFocus(SWND wndOld)
Handle set focus event.
void EnsureVisible(int iItem) OVERRIDE
Ensure an item is visible.
void SetItemLocator(IListViewItemLocator *pItemLocator) OVERRIDE
Set the item locator for the list view.
void OnMouseLeave()
Handle mouse leave event.
virtual BOOL OnScroll(BOOL bVertical, UINT uCode, int nPos)
Handle scroll event.
SAutoRefPtr< ISkinObj > m_pSkinDivider
void onItemDataChanged(int iItem)
Handle item data changed event.
virtual BOOL UpdateToolTip(CPoint pt, SwndToolTipInfo &tipInfo)
Update tooltip information.
IItemPanel * HitTest(const POINT *pt) SCONST OVERRIDE
Hit test to determine the item under the mouse.
BOOL OnHeaderSwap(IEvtArgs *pEvt)
Handle header swap event.
void OnDestroy()
Handle destroy event.
IMcAdapter * GetAdapter() SCONST OVERRIDE
Get the adapter for the list view.
IListViewItemLocator * GetItemLocator() SCONST OVERRIDE
Get the item locator for the list view.
SOsrPanel * m_itemCapture
SLayoutSize m_nDividerSize
LRESULT OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handle mouse event.
SAutoRefPtr< ILvDataSetObserver > m_observer
void OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags)
Handle key down event.
The SMatrix class holds a 3x3 matrix for transforming coordinates. SMatrix does not have a constructo...
static LPCWSTR GetClassName()
Helper class for painting.
virtual CRect GetClientRect() const
Gets the client rectangle.
int GetSbWidth() const
Gets the width of the scrollbar.
void ScrollUpdate()
Updates the scrollbar.
A class representing an ASCII string.
Base class for SOUI DUI windows.
BOOL FireEvent(IEvtArgs *evt) OVERRIDE
Fires an event.
void SetVisible(BOOL bVisible, BOOL bUpdate=FALSE) OVERRIDE
Sets the visibility of the window.
void UnlockUpdate() OVERRIDE
Unlocks updates to the window.
SWindow * GetOwner() const
Retrieves the current owner of the window.
BOOL Destroy() OVERRIDE
Destroys the window.
DWORD GetState() SCONST OVERRIDE
Retrieves the current state of the window.
void SDispatchMessage(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Dispatches a message to the window.
int GetScale() SCONST OVERRIDE
Retrieves the scale factor of the window.
BOOL IsMsgHandled() const
Checks if the message is handled.
COLORREF GetColorizeColor() SCONST OVERRIDE
Retrieves the colorization color of the window.
BOOL IsVisible(BOOL bCheckParent=FALSE) SCONST OVERRIDE
Checks if the window is visible.
ISwndContainer * GetContainer() OVERRIDE
Retrieves the container associated with this window.
void DoColorize(COLORREF cr) OVERRIDE
Applies colorization to 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 InsertChild(SWindow *pNewChild, SWindow *pInsertAfter=NULL)
Inserts a child window into the window tree.
LRESULT SSendMessage(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0, BOOL *pbMsgHandled=NULL) OVERRIDE
Sends a message to the window.
virtual void BeforePaint(IRenderTarget *pRT, SPainter &painter)
Prepare rendering environment.
void InvalidateRect(LPCRECT lprect) OVERRIDE
Invalidates a specific rectangle area of the window.
void UpdateLayout() OVERRIDE
Updates the layout of the window.
virtual SWindow * CreateChildByName(LPCWSTR pszName)
Create child window by name.
virtual void AfterPaint(IRenderTarget *pRT, SPainter &painter)
Restore rendering environment.
ILayoutParam * GetLayoutParam() SCONST OVERRIDE
Retrieves the layout parameter object associated with the window.
SEventSet * GetEventSet()
Retrieves the event set associated with the window.
void Invalidate() OVERRIDE
Invalidates the entire window.
void GetWindowRect(LPRECT prect) SCONST OVERRIDE
Retrieves the bounding rectangle of the window.
void SetMsgHandled(BOOL bHandled)
Sets the message handled flag.
const SwndStyle & GetStyle() const
Retrieves the style of the window.
void LockUpdate() OVERRIDE
Locks updates to the window.
SWND m_swnd
Member variables representing various properties of the window.
void Move(LPCRECT prect) OVERRIDE
Moves the window to a new position and size.
const wchar_t * as_string(const wchar_t *def=L"") const
Gets the attribute value as a string.
const wchar_t * value() const
Gets the attribute value.
Class representing an XML node.
SXmlAttr attribute(const wchar_t *name, bool bCaseSensitive=false) const
Gets the attribute with the specified name.
SXmlNode child(const wchar_t *name, bool bCaseSensitive=false) const
Gets the child node, attribute, or next/previous sibling with the specified name.
BOOL set_userdata(int data) OVERRIDE
Sets user data for the node.
SFocusManager * GetFocusManager()
Retrieves the focus manager.
CRect GetPadding() const
Retrieves the padding rectangle.
Template class implementing the IObjRef interface.
Base class for all renderable objects.
Interface for rendering target objects.
HRESULT GetTransform(float matrix[9]) SCONST PURE
Retrieves the current coordinate transformation matrix.
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 GetClipBox(LPRECT prc) PURE
Get the bounding box of the current clip region.
HRESULT GetClipRegion(IRegionS **ppRegion) PURE
Get the current clip region.
BOOL SetAntiAlias(BOOL bAntiAlias) PURE
Enables or disables anti-aliasing for drawing operations.
HRESULT DrawLines(LPPOINT pPt, size_t nCount) PURE
Draw a series of connected lines.
BOOL OnReleaseSwndCapture() PURE
Releases the mouse capture from the Swnd object.
SWND OnSetSwndCapture(SWND swnd) PURE
Sets the Swnd object to capture the mouse.