List Control. More...
#include <SListCtrl.h>
Public Member Functions | |
SListCtrl () | |
Constructor. | |
virtual | ~SListCtrl () |
Destructor. | |
int | InsertColumn (int nIndex, LPCTSTR pszText, int nWidth, UINT fmt, LPARAM lParam=0) |
Insert a column. | |
int | InsertItem (int nItem, LPCTSTR pszText, int nImage=-1) |
Insert an item. | |
BOOL | SetItemData (int nItem, LPARAM dwData) |
Set the data associated with an item. | |
LPARAM | GetItemData (int nItem) |
Get the data associated with an item. | |
BOOL | SetSubItem (int nItem, int nSubItem, const DXLVSUBITEM *plv) |
Set a subitem. | |
BOOL | GetSubItem (int nItem, int nSubItem, DXLVSUBITEM *plv) const |
Get a subitem. | |
BOOL | SetSubItemText (int nItem, int nSubItem, LPCTSTR pszText) |
Set the text of a subitem. | |
SStringT | GetSubItemText (int nItem, int nSubItem) const |
Get the text of a subitem. | |
int | GetSelectedItem () |
Get the selected item. | |
void | SetSelectedItem (int nItem) |
Set the selected item. | |
int | GetItemCount () const |
Get the total number of items. | |
BOOL | SetItemCount (int nItems, int nGrowBy) |
Set the total number of items. | |
int | GetColumnCount () const |
Get the total number of columns. | |
int | GetCountPerPage (BOOL bPartial) |
Get the number of items per page. | |
void | DeleteItem (int nItem) |
Delete a specific item. | |
void | DeleteColumn (int iCol) |
Delete a specific column. | |
void | DeleteAllItems () |
Delete all items. | |
BOOL | SortItems (PFNLVCOMPAREEX pfnCompare, void *pContext) |
Sort items using a comparison function. | |
BOOL | GetCheckState (int nItem) |
Get the check state of an item. | |
BOOL | SetCheckState (int nItem, BOOL bCheck) |
Set the check state of an item. | |
int | GetCheckedItemCount () |
Get the number of checked items. | |
SHeaderCtrl * | GetHeaderCtrl () const |
Get the header control. | |
int | GetFirstCheckedItem () |
Get the first checked item. | |
int | GetLastCheckedItem () |
Get the last checked item. | |
VOID | EnableMultiSelection (BOOL enable) |
Enable or disable multiple selection. | |
VOID | EnableCheckBox (BOOL enable) |
Enable or disable checkboxes. | |
VOID | EnableHotTrack (BOOL enable) |
Enable or disable hot tracking. | |
![]() | |
SPanel () | |
Constructor for SPanel. | |
virtual | ~SPanel () |
Destructor for SPanel. | |
BOOL | ShowScrollBar (int wBar, BOOL bShow) OVERRIDE |
Shows or hides a scrollbar. | |
BOOL | EnableScrollBar (int wBar, BOOL bEnable) OVERRIDE |
Enables or disables a scrollbar. | |
BOOL | IsScrollBarEnable (BOOL bVertical) SCONST OVERRIDE |
Checks if a scrollbar is enabled. | |
void | SetScrollInfo (SCROLLINFO si, BOOL bVertical) OVERRIDE |
Sets the scroll information for a scrollbar. | |
BOOL | SetScrollPos (BOOL bVertical, int nNewPos, BOOL bRedraw) OVERRIDE |
Sets the scroll position for a scrollbar. | |
int | GetScrollPos (BOOL bVertical) SCONST OVERRIDE |
Gets the scroll position for a scrollbar. | |
BOOL | SetScrollRange (BOOL bVertical, int nMinPos, int nMaxPos, BOOL bRedraw) OVERRIDE |
Sets the scroll range for a scrollbar. | |
BOOL | GetScrollRange (BOOL bVertical, LPINT lpMinPos, LPINT lpMaxPos) SCONST OVERRIDE |
Gets the scroll range for a scrollbar. | |
BOOL | HasScrollBar (BOOL bVertical) SCONST OVERRIDE |
Checks if a scrollbar is present. | |
virtual void WINAPI | GetClientRect (LPRECT pRect) const |
Gets the client rectangle. | |
virtual CRect | GetClientRect () const |
Gets the client rectangle. | |
Protected Types | |
typedef SArray< DXLVITEM > | ArrLvItem |
![]() | |
enum | kSbConst { Timer_Wait = 100 , Timer_Go = 101 , kTime_Wait = 200 , kTime_Go = 100 } |
Protected Member Functions | |
virtual BOOL | CreateChildren (SXmlNode xmlNode) |
Create child items from XML configuration. | |
int | HitTest (const CPoint &pt) |
Hit test to determine the item under the mouse. | |
int | GetTopIndex () const |
Get the index of the top visible item. | |
CRect | GetItemRect (int nItem, int nSubItem=0) |
Get the rectangle of an item. | |
virtual void | DrawItem (IRenderTarget *pRT, CRect rcItem, int nItem) |
Draw an item. | |
void | RedrawItem (int nItem) |
Redraw a specific item. | |
void | NotifySelChange (int nOldSel, int nNewSel, BOOL checkBox=FALSE) |
Notify of selection change. | |
void | OnPaint (IRenderTarget *pRT) |
Paint the control. | |
void | OnDestroy () |
Handle destroy event. | |
BOOL | OnHeaderClick (IEvtArgs *pEvt) |
Handle header click event. | |
BOOL | OnHeaderSizeChanging (IEvtArgs *pEvt) |
Handle header size changing event. | |
BOOL | OnHeaderSwap (IEvtArgs *pEvt) |
Handle header swap event. | |
virtual BOOL | OnScroll (BOOL bVertical, UINT uCode, int nPos) |
Handle scroll event. | |
void | OnLButtonDown (UINT nFlags, CPoint pt) |
Handle left mouse button down event. | |
void | OnLButtonDbClick (UINT nFlags, CPoint pt) |
Handle left mouse button double-click event. | |
void | OnLButtonUp (UINT nFlags, CPoint pt) |
Handle left mouse button up event. | |
void | OnMouseMove (UINT nFlags, CPoint pt) |
Handle mouse move event. | |
void | OnMouseLeave () |
Handle mouse leave event. | |
void | OnSize (UINT nType, CSize size) |
Handle size change event. | |
void | UpdateChildrenPosition () OVERRIDE |
Update the position of child items. | |
CRect | GetListRect () |
Get the rectangle of the list. | |
void | UpdateScrollBar () |
Update the scroll bar. | |
void | UpdateHeaderCtrl () |
Update the header control. | |
BOOL | HitCheckBox (const CPoint &pt) |
Hit test to determine if the point is on a checkbox. | |
virtual HRESULT | SetAttribute (const SNS::SStringW &amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;strValue, BOOL bLoading=FALSE) |
![]() | |
CRect | GetScrollBarRect (BOOL bVert) SCONST OVERRIDE |
Gets the rectangle of a scrollbar. | |
ISkinObj * | GetScrollBarSkin (BOOL bVert) SCONST OVERRIDE |
Gets the skin for a scrollbar. | |
const SCROLLINFO * | GetScrollBarInfo (BOOL bVert) SCONST OVERRIDE |
Gets the scroll information for a scrollbar. | |
int | GetScrollBarArrowSize (BOOL bVert) SCONST OVERRIDE |
Gets the arrow size for a scrollbar. | |
void | OnScrollUpdatePart (BOOL bVert, int iPart) OVERRIDE |
Updates a part of the scrollbar. | |
void | OnScrollUpdateThumbTrack (BOOL bVert, int nPos) OVERRIDE |
Updates the thumb track of the scrollbar. | |
ISwndContainer * | GetScrollBarContainer () OVERRIDE |
Gets the container for the scrollbar. | |
void | OnScrollCommand (BOOL bVert, int iCmd, int nPos) OVERRIDE |
Handles scroll commands. | |
void | OnScrollSetTimer (BOOL bVert, char id, UINT uElapse) OVERRIDE |
Sets a timer for the scrollbar. | |
void | OnScrollKillTimer (BOOL bVert, char id) OVERRIDE |
Kills a timer for the scrollbar. | |
const IInterpolator * | GetScrollInterpolator () SCONST OVERRIDE |
Gets the interpolator for the scrollbar. | |
int | GetScrollFadeFrames () SCONST OVERRIDE |
Gets the number of fade frames for the scrollbar. | |
BYTE | GetScrollThumbTrackMinAlpha () SCONST OVERRIDE |
Gets the minimum alpha value for the scrollbar thumb track. | |
virtual int | GetScrollLineSize (BOOL bVertical) |
Gets the line size for scrolling. | |
virtual void | OnColorize (COLORREF cr) |
Handles colorization events. | |
virtual void | OnScaleChanged (int nScale) |
Handles scale change events. | |
virtual void | OnContainerChanged (ISwndContainer *pOldContainer, ISwndContainer *pNewContainer) |
Handles container change events. | |
int | GetSbWidth () const |
Gets the width of the scrollbar. | |
void | ScrollUpdate () |
Updates the scrollbar. | |
HRESULT | OnAttrScrollbarSkin (SStringW strValue, BOOL bLoading) |
Handles the scrollbar skin attribute. | |
int | OnCreate (LPVOID) |
Handles the WM_CREATE message. | |
void | OnDestroy () |
Handles the WM_DESTROY message. | |
void | OnNcPaint (IRenderTarget *pRT) |
Handles the WM_NCPAINT message. | |
virtual BOOL | OnNcHitTest (CPoint pt) |
Handles the WM_NCHITTEST message. | |
void | OnNcLButtonDown (UINT nFlags, CPoint point) |
Handles the WM_NCLBUTTONDOWN message. | |
void | OnNcLButtonUp (UINT nFlags, CPoint pt) |
Handles the WM_NCLBUTTONUP message. | |
void | OnNcMouseMove (UINT nFlags, CPoint point) |
Handles the WM_NCMOUSEMOVE message. | |
void | OnNcMouseLeave () |
Handles the WM_NCMOUSELEAVE message. | |
LRESULT | OnNcCalcSize (BOOL bCalcValidRects, LPARAM lParam) |
Handles the WM_NCCALCSIZE message. | |
BOOL | OnMouseWheel (UINT nFlags, short zDelta, CPoint pt) |
Handles the WM_MOUSEWHEEL message. | |
void | OnTimer (char cTimerID) |
Handles the WM_TIMER message. | |
void | OnShowWindow (BOOL bShow, UINT nStatus) |
Handles the WM_SHOWWINDOW message. | |
void | OnEnable (BOOL bEnable, UINT uStatus) |
Handles the WM_ENABLE message. | |
void | OnVScroll (UINT nSBCode, UINT nPos, HWND hwnd) |
Handles the WM_VSCROLL message. | |
void | OnHScroll (UINT nSBCode, UINT nPos, HWND hwnd) |
Handles the WM_HSCROLL message. | |
![]() | |
CRect | GetScrollBarRect (BOOL bVert) SCONST PURE |
Gets the rectangle of the scrollbar. | |
ISkinObj * | GetScrollBarSkin (BOOL bVert) SCONST PURE |
Gets the skin for the scrollbar. | |
const SCROLLINFO * | GetScrollBarInfo (BOOL bVert) SCONST PURE |
Gets the scroll information for the scrollbar. | |
int | GetScrollBarArrowSize (BOOL bVert) SCONST PURE |
Gets the arrow size for the scrollbar. | |
void | OnScrollUpdatePart (BOOL bVert, int iPart) PURE |
Updates a part of the scrollbar. | |
void | OnScrollUpdateThumbTrack (BOOL bVert, int nPos) PURE |
Updates the thumb track of the scrollbar. | |
ISwndContainer * | GetScrollBarContainer () PURE |
Gets the container for the scrollbar. | |
BOOL | IsScrollBarEnable (BOOL bVertical) SCONST PURE |
Checks if the scrollbar is enabled. | |
void | OnScrollCommand (BOOL bVert, int iCmd, int nPos) PURE |
Handles scroll commands. | |
void | OnScrollSetTimer (BOOL bVert, char id, UINT uElapse) PURE |
Sets a timer for the scrollbar. | |
void | OnScrollKillTimer (BOOL bVert, char id) PURE |
Kills a timer for the scrollbar. | |
const IInterpolator * | GetScrollInterpolator () SCONST PURE |
Gets the interpolator for the scrollbar. | |
int | GetScrollFadeFrames () SCONST PURE |
Gets the number of fade frames for the scrollbar. | |
BYTE | GetScrollThumbTrackMinAlpha () SCONST PURE |
Gets the minimum alpha value for the scrollbar thumb track. | |
List Control.
A control that displays a list of items with multiple columns and subitems.
Definition at line 83 of file SListCtrl.h.
|
protected |
Array of items
Definition at line 482 of file SListCtrl.h.
SNSBEGIN SListCtrl::SListCtrl | ( | ) |
Constructor.
Definition at line 11 of file SListCtrl.cpp.
|
virtual |
Destructor.
Definition at line 39 of file SListCtrl.cpp.
|
protectedvirtual |
Create child items from XML configuration.
xmlNode | XML node for the child items |
Reimplemented from SWindow.
Definition at line 56 of file SListCtrl.cpp.
void SListCtrl::DeleteAllItems | ( | ) |
Delete all items.
Definition at line 407 of file SListCtrl.cpp.
void SListCtrl::DeleteColumn | ( | int | iCol | ) |
Delete a specific column.
iCol | Index of the column to delete |
Definition at line 380 of file SListCtrl.cpp.
void SListCtrl::DeleteItem | ( | int | nItem | ) |
Delete a specific item.
nItem | Index of the item to delete |
Definition at line 356 of file SListCtrl.cpp.
|
protectedvirtual |
Draw an item.
pRT | Rendering target handle |
rcItem | Rectangle for the item |
nItem | Index of the item |
Definition at line 567 of file SListCtrl.cpp.
|
inline |
Enable or disable checkboxes.
enable | Enable flag |
Definition at line 283 of file SListCtrl.h.
|
inline |
Enable or disable hot tracking.
enable | Enable flag |
Definition at line 292 of file SListCtrl.h.
|
inline |
Enable or disable multiple selection.
enable | Enable flag |
Definition at line 274 of file SListCtrl.h.
int SListCtrl::GetCheckedItemCount | ( | ) |
Get the number of checked items.
Definition at line 938 of file SListCtrl.cpp.
BOOL SListCtrl::GetCheckState | ( | int | nItem | ) |
Get the check state of an item.
nItem | Index of the item |
Definition at line 915 of file SListCtrl.cpp.
int SListCtrl::GetColumnCount | ( | ) | const |
Get the total number of columns.
Definition at line 708 of file SListCtrl.cpp.
int SListCtrl::GetCountPerPage | ( | BOOL | bPartial | ) |
Get the number of items per page.
bPartial | Whether to include partial items |
Definition at line 507 of file SListCtrl.cpp.
int SListCtrl::GetFirstCheckedItem | ( | ) |
Get the first checked item.
Definition at line 952 of file SListCtrl.cpp.
SHeaderCtrl * SListCtrl::GetHeaderCtrl | ( | ) | const |
Get the header control.
Definition at line 984 of file SListCtrl.cpp.
int SListCtrl::GetItemCount | ( | ) | const |
LPARAM SListCtrl::GetItemData | ( | int | nItem | ) |
Get the data associated with an item.
nItem | Index of the item |
Definition at line 109 of file SListCtrl.cpp.
|
protected |
Get the rectangle of an item.
nItem | Index of the item |
nSubItem | Index of the subitem |
Definition at line 432 of file SListCtrl.cpp.
int SListCtrl::GetLastCheckedItem | ( | ) |
Get the last checked item.
Definition at line 968 of file SListCtrl.cpp.
|
protected |
Get the rectangle of the list.
Definition at line 228 of file SListCtrl.cpp.
int SListCtrl::GetSelectedItem | ( | ) |
Get the selected item.
Definition at line 186 of file SListCtrl.cpp.
BOOL SListCtrl::GetSubItem | ( | int | nItem, |
int | nSubItem, | ||
DXLVSUBITEM * | plv ) const |
Get a subitem.
nItem | Index of the item |
nSubItem | Index of the subitem |
plv | Pointer to the subitem structure |
Definition at line 139 of file SListCtrl.cpp.
SStringT SListCtrl::GetSubItemText | ( | int | nItem, |
int | nSubItem ) const |
Get the text of a subitem.
nItem | Index of the item |
nSubItem | Index of the subitem |
Definition at line 177 of file SListCtrl.cpp.
|
protected |
Get the index of the top visible item.
Definition at line 716 of file SListCtrl.cpp.
|
protected |
Hit test to determine if the point is on a checkbox.
pt | Mouse coordinates |
Definition at line 547 of file SListCtrl.cpp.
|
protected |
Hit test to determine the item under the mouse.
pt | Mouse coordinates |
Definition at line 465 of file SListCtrl.cpp.
int SListCtrl::InsertColumn | ( | int | nIndex, |
LPCTSTR | pszText, | ||
int | nWidth, | ||
UINT | fmt, | ||
LPARAM | lParam = 0 ) |
Insert a column.
nIndex | Index at which to insert the column |
pszText | Column title |
nWidth | Column width |
fmt | Format flags |
lParam | Additional parameter |
Definition at line 43 of file SListCtrl.cpp.
int SListCtrl::InsertItem | ( | int | nItem, |
LPCTSTR | pszText, | ||
int | nImage = -1 ) |
Insert an item.
nItem | Index at which to insert the item |
pszText | Text of the item |
nImage | Icon index |
Definition at line 75 of file SListCtrl.cpp.
|
protected |
Notify of selection change.
nOldSel | Old selected index |
nNewSel | New selected index |
checkBox | Whether the change is due to a checkbox |
Definition at line 721 of file SListCtrl.cpp.
|
protected |
Handle destroy event.
Definition at line 701 of file SListCtrl.cpp.
|
protected |
Handle header click event.
pEvt | Event arguments |
Definition at line 875 of file SListCtrl.cpp.
|
protected |
Handle header size changing event.
pEvt | Event arguments |
Definition at line 880 of file SListCtrl.cpp.
|
protected |
Handle header swap event.
pEvt | Event arguments |
Definition at line 888 of file SListCtrl.cpp.
|
protected |
Handle left mouse button double-click event.
nFlags | Flags |
pt | Mouse coordinates |
Definition at line 846 of file SListCtrl.cpp.
|
protected |
Handle left mouse button down event.
nFlags | Flags |
pt | Mouse coordinates |
Definition at line 832 of file SListCtrl.cpp.
|
protected |
Handle left mouse button up event.
nFlags | Flags |
pt | Mouse coordinates |
Definition at line 857 of file SListCtrl.cpp.
|
protected |
Handle mouse leave event.
Definition at line 905 of file SListCtrl.cpp.
|
protected |
Handle mouse move event.
nFlags | Flags |
pt | Mouse coordinates |
Definition at line 895 of file SListCtrl.cpp.
|
protected |
Paint the control.
pRT | Rendering target handle |
Definition at line 526 of file SListCtrl.cpp.
|
protectedvirtual |
Handle scroll event.
bVertical | Whether the scroll is vertical |
uCode | Scroll type |
nPos | Scroll position |
Reimplemented from SPanel.
Definition at line 810 of file SListCtrl.cpp.
|
protected |
Handle size change event.
nType | Size change type |
size | New size |
Definition at line 868 of file SListCtrl.cpp.
|
protected |
Redraw a specific item.
nItem | Index of the item to redraw |
Definition at line 481 of file SListCtrl.cpp.
|
inlineprotectedvirtual |
Reimplemented from SPanel.
Definition at line 489 of file SListCtrl.h.
BOOL SListCtrl::SetCheckState | ( | int | nItem, |
BOOL | bCheck ) |
Set the check state of an item.
nItem | Index of the item |
bCheck | Check state to set |
Definition at line 924 of file SListCtrl.cpp.
BOOL SListCtrl::SetItemCount | ( | int | nItems, |
int | nGrowBy ) |
Set the total number of items.
nItems | Number of items |
nGrowBy | Growth increment |
Definition at line 207 of file SListCtrl.cpp.
BOOL SListCtrl::SetItemData | ( | int | nItem, |
LPARAM | dwData ) |
Set the data associated with an item.
nItem | Index of the item |
dwData | Additional data |
Definition at line 99 of file SListCtrl.cpp.
void SListCtrl::SetSelectedItem | ( | int | nItem | ) |
Set the selected item.
nItem | Index of the item to select |
Definition at line 191 of file SListCtrl.cpp.
BOOL SListCtrl::SetSubItem | ( | int | nItem, |
int | nSubItem, | ||
const DXLVSUBITEM * | plv ) |
Set a subitem.
nItem | Index of the item |
nSubItem | Index of the subitem |
plv | Pointer to the subitem structure |
Definition at line 119 of file SListCtrl.cpp.
BOOL SListCtrl::SetSubItemText | ( | int | nItem, |
int | nSubItem, | ||
LPCTSTR | pszText ) |
Set the text of a subitem.
nItem | Index of the item |
nSubItem | Index of the subitem |
pszText | Text to set |
Definition at line 156 of file SListCtrl.cpp.
BOOL SListCtrl::SortItems | ( | PFNLVCOMPAREEX | pfnCompare, |
void * | pContext ) |
Sort items using a comparison function.
pfnCompare | Comparison function |
pContext | Context for the comparison function |
Definition at line 517 of file SListCtrl.cpp.
|
protected |
Update the position of child items.
Definition at line 862 of file SListCtrl.cpp.
|
protected |
Update the header control.
Definition at line 345 of file SListCtrl.cpp.
|
protected |
Update the scroll bar.
Definition at line 240 of file SListCtrl.cpp.
|
protected |
Array of items
Definition at line 485 of file SListCtrl.h.
|
protected |
Checkbox enable flag
Definition at line 478 of file SListCtrl.h.
|
protected |
Hot tracking flag
Definition at line 463 of file SListCtrl.h.
|
protected |
Multiple selection enable flag
Definition at line 479 of file SListCtrl.h.
|
protected |
Background color
Definition at line 468 of file SListCtrl.h.
|
protected |
Background color for even rows
Definition at line 469 of file SListCtrl.h.
|
protected |
Hot item background color
Definition at line 471 of file SListCtrl.h.
|
protected |
Selected item background color
Definition at line 470 of file SListCtrl.h.
|
protected |
Selected text color
Definition at line 473 of file SListCtrl.h.
|
protected |
Text color
Definition at line 472 of file SListCtrl.h.
|
protected |
Height of the header
Definition at line 458 of file SListCtrl.h.
|
protected |
Index of the item under the mouse
Definition at line 462 of file SListCtrl.h.
|
protected |
Height of the items
Definition at line 459 of file SListCtrl.h.
|
protected |
Index of the selected item
Definition at line 461 of file SListCtrl.h.
|
protected |
Skin for checkboxes
Definition at line 477 of file SListCtrl.h.
|
protected |
Header control
Definition at line 484 of file SListCtrl.h.
|
protected |
Skin for icons
Definition at line 476 of file SListCtrl.h.
|
protected |
Skin for items
Definition at line 475 of file SListCtrl.h.
|
protected |
Icon position
Definition at line 465 of file SListCtrl.h.
|
protected |
Origin point
Definition at line 486 of file SListCtrl.h.
|
protected |
Text position
Definition at line 466 of file SListCtrl.h.