1#ifndef __SLISTCTRL__H__
2#define __SLISTCTRL__H__
5#include "SHeaderCtrl.h"
26typedef int(__cdecl *PFNLVCOMPAREEX)(
void *,
const void *,
const void *);
54typedef SArray<DXLVSUBITEM> ArrSubItem;
84 DEF_SOBJECT(
SPanel, L
"listctrl")
106 int InsertColumn(
int nIndex, LPCTSTR pszText,
int nWidth, UINT fmt, LPARAM lParam = 0);
115 int InsertItem(
int nItem, LPCTSTR pszText,
int nImage = -1);
229 BOOL
SortItems(PFNLVCOMPAREEX pfnCompare,
void *pContext);
310 int HitTest(
const CPoint &pt);
316 int GetTopIndex()
const;
324 CRect GetItemRect(
int nItem,
int nSubItem = 0);
332 virtual void DrawItem(
IRenderTarget *pRT, CRect rcItem,
int nItem);
338 void RedrawItem(
int nItem);
346 void NotifySelChange(
int nOldSel,
int nNewSel, BOOL checkBox = FALSE);
364 BOOL OnHeaderClick(IEvtArgs *pEvt);
371 BOOL OnHeaderSizeChanging(IEvtArgs *pEvt);
378 BOOL OnHeaderSwap(IEvtArgs *pEvt);
387 virtual BOOL
OnScroll(BOOL bVertical, UINT uCode,
int nPos);
427 void OnSize(UINT nType, CSize size);
432 STDMETHOD_(
void, UpdateChildrenPosition)(THIS) OVERRIDE;
443 void UpdateScrollBar();
448 void UpdateHeaderCtrl();
455 BOOL HitCheckBox(
const CPoint &pt);
497 ATTR_COLOR(L
"colorItemBkgnd",
m_crItemBg, FALSE)
501 ATTR_COLOR(L
"colorText",
m_crText, FALSE)
503 ATTR_INT(L
"icon-x",
m_ptIcon.x, FALSE)
504 ATTR_INT(L
"icon-y",
m_ptIcon.y, FALSE)
505 ATTR_INT(L
"text-x",
m_ptText.x, FALSE)
506 ATTR_INT(L
"text-y",
m_ptText.y, FALSE)
SOUI Panel with Scrollbar Support.
Smart pointer class for managing COM-style reference-counted objects.
void OnLButtonUp(UINT nFlags, CPoint pt)
Handle left mouse button up event.
void SetSelectedItem(int nItem)
Set the selected item.
BOOL SetSubItemText(int nItem, int nSubItem, LPCTSTR pszText)
Set the text of a subitem.
VOID EnableHotTrack(BOOL enable)
Enable or disable hot tracking.
int GetLastCheckedItem()
Get the last checked item.
BOOL SetSubItem(int nItem, int nSubItem, const DXLVSUBITEM *plv)
Set a subitem.
int GetSelectedItem()
Get the selected item.
void OnLButtonDown(UINT nFlags, CPoint pt)
Handle left mouse button down event.
BOOL SetItemCount(int nItems, int nGrowBy)
Set the total number of items.
SStringT GetSubItemText(int nItem, int nSubItem) const
Get the text of a subitem.
int InsertItem(int nItem, LPCTSTR pszText, int nImage=-1)
Insert an item.
SArray< DXLVITEM > ArrLvItem
BOOL SortItems(PFNLVCOMPAREEX pfnCompare, void *pContext)
Sort items using a comparison function.
void OnMouseLeave()
Handle mouse leave event.
int GetFirstCheckedItem()
Get the first checked item.
SAutoRefPtr< ISkinObj > m_pItemSkin
int InsertColumn(int nIndex, LPCTSTR pszText, int nWidth, UINT fmt, LPARAM lParam=0)
Insert a column.
void OnMouseMove(UINT nFlags, CPoint pt)
Handle mouse move event.
BOOL GetCheckState(int nItem)
Get the check state of an item.
void OnPaint(IRenderTarget *pRT)
Paint the control.
VOID EnableMultiSelection(BOOL enable)
Enable or disable multiple selection.
VOID EnableCheckBox(BOOL enable)
Enable or disable checkboxes.
void DeleteAllItems()
Delete all items.
LPARAM GetItemData(int nItem)
Get the data associated with an item.
void OnSize(UINT nType, CSize size)
Handle size change event.
void OnDestroy()
Handle destroy event.
SHeaderCtrl * GetHeaderCtrl() const
Get the header control.
SAutoRefPtr< ISkinObj > m_pCheckSkin
SAutoRefPtr< ISkinObj > m_pIconSkin
int GetItemCount() const
Get the total number of items.
void DeleteItem(int nItem)
Delete a specific item.
BOOL SetCheckState(int nItem, BOOL bCheck)
Set the check state of an item.
void OnLButtonDbClick(UINT nFlags, CPoint pt)
Handle left mouse button double-click event.
int GetColumnCount() const
Get the total number of columns.
BOOL GetSubItem(int nItem, int nSubItem, DXLVSUBITEM *plv) const
Get a subitem.
int GetCheckedItemCount()
Get the number of checked items.
BOOL SetItemData(int nItem, LPARAM dwData)
Set the data associated with an item.
void DeleteColumn(int iCol)
Delete a specific column.
int GetCountPerPage(BOOL bPartial)
Get the number of items per page.
SPanel()
Constructor for SPanel.
virtual BOOL OnScroll(BOOL bVertical, UINT uCode, int nPos)
Handles scroll events.
void OnDestroy()
Handles the WM_DESTROY message.
void OnMouseMove(UINT nFlags, CPoint pt)
Handles the mouse move event.
void OnPaint(IRenderTarget *pRT)
Handles the painting of the window.
void OnLButtonDbClick(UINT nFlags, CPoint point)
Handles the left mouse button double-click event.
void OnMouseLeave()
Handles the mouse leave event.
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.
void OnLButtonDown(UINT nFlags, CPoint pt)
Handles the left mouse button down event.
virtual BOOL CreateChildren(SXmlNode xmlNode)
Create child windows from XML node.
Class representing an XML node.
DXLVSUBITEM()
Constructor.
Interface for rendering target objects.