Multi-Column List View Control. More...
#include <SMCListView.h>
Public Member Functions | |
| SMCListView () | |
| Constructor. | |
| virtual | ~SMCListView () |
| Destructor. | |
| BOOL | SetAdapter (IMcAdapter *adapter) OVERRIDE |
| Set the adapter for the list view. | |
| IMcAdapter * | GetAdapter () SCONST OVERRIDE |
| Get the adapter for the list view. | |
| IListViewItemLocator * | GetItemLocator () SCONST OVERRIDE |
| Get the item locator for the list view. | |
| void | SetItemLocator (IListViewItemLocator *pItemLocator) OVERRIDE |
| Set the item locator for the list view. | |
| void | EnsureVisible (int iItem) OVERRIDE |
| Ensure an item is visible. | |
| void | SetSel (int iItem, BOOL bNotify=FALSE) OVERRIDE |
| Set the selected item. | |
| int | GetSel () SCONST OVERRIDE |
| Get the selected item. | |
| IItemPanel * | HitTest (const POINT *pt) SCONST OVERRIDE |
| Hit test to determine the item under the mouse. | |
| IHeaderCtrl * | GetIHeaderCtrl () SCONST OVERRIDE |
| Get the header 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. | |
| void | DeleteColumn (int iCol) OVERRIDE |
| Delete a specific column. | |
| int | GetColumnCount () SCONST OVERRIDE |
| Get the total number of columns. | |
| void | GetDesiredSize (SIZE *psz, int nParentWid, int nParentHei) OVERRIDE |
| Get the desired size of the control. | |
| SItemPanel * | HitTest (CPoint &pt) const |
| Hit test to determine the item under the mouse. | |
| SHeaderCtrl * | GetHeaderCtrl () const |
| Get the header control. | |
| void | UpdateVisibleItems () |
| Update visible items. | |
| void | UpdateVisibleItem (int iItem) |
| Update a specific visible item. | |
Protected Member Functions | |
| virtual void | OnItemSetCapture (SOsrPanel *pItem, BOOL bCapture) |
| Handle item capture. | |
| virtual BOOL | OnItemGetRect (const SOsrPanel *pItem, CRect &rcItem) const |
| Get the rectangle of an item. | |
| virtual BOOL | IsItemRedrawDelay () const |
| Check if item redraw is delayed. | |
| void | onDataSetChanged () |
| Handle data set changed event. | |
| void | onDataSetInvalidated () |
| Handle data set invalidated event. | |
| void | onItemDataChanged (int iItem) |
| Handle item data changed event. | |
| BOOL | OnItemClick (IEvtArgs *pEvt) |
| Handle item click event. | |
| virtual BOOL | OnScroll (BOOL bVertical, UINT uCode, int nPos) |
| Handle scroll event. | |
| virtual int | GetScrollLineSize (BOOL bVertical) |
| Get the scroll line size. | |
| virtual BOOL | CreateChildren (SXmlNode xmlNode) |
| Create child items from XML configuration. | |
| virtual BOOL | UpdateToolTip (CPoint pt, SwndToolTipInfo &tipInfo) |
| Update tooltip information. | |
| virtual UINT WINAPI | OnGetDlgCode () const |
| Get the dialog code. | |
| virtual BOOL | OnSetCursor (const CPoint &pt) |
| Handle set cursor event. | |
| virtual void | OnColorize (COLORREF cr) |
| Handle colorization event. | |
| virtual void | OnScaleChanged (int nScale) |
| Handle scale change event. | |
| virtual HRESULT | OnLanguageChanged () |
| Handle language change event. | |
| virtual void | OnRebuildFont () |
| Handle rebuild font event. | |
| void | DispatchMessage2Items (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| Dispatch messages to items. | |
| void | UpdateScrollBar () |
| Update the scroll bar. | |
| void | RedrawItem (SOsrPanel *pItem) |
| Redraw a specific item. | |
| SItemPanel * | GetItemPanel (int iItem) |
| Get the item panel for a specific item. | |
| void | OnPaint (IRenderTarget *pRT) |
| Paint the control. | |
| void | OnSize (UINT nType, CSize size) |
| Handle size change event. | |
| void | OnDestroy () |
| Handle destroy event. | |
| LRESULT | OnMouseEvent (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| Handle mouse event. | |
| LRESULT | OnKeyEvent (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| Handle key event. | |
| void | OnKeyDown (TCHAR nChar, UINT nRepCnt, UINT nFlags) |
| Handle key down event. | |
| void | OnMouseLeave () |
| Handle mouse leave event. | |
| BOOL | OnMouseWheel (UINT nFlags, short zDelta, CPoint pt) |
| Handle mouse wheel event. | |
| void | OnKillFocus (SWND wndFocus) |
| Handle kill focus event. | |
| void | OnSetFocus (SWND wndOld) |
| Handle set focus event. | |
| void | OnShowWindow (BOOL bShow, UINT nStatus) |
| Handle show window event. | |
| virtual HRESULT | SetAttribute (const SNS::SStringW &amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;strValue, BOOL bLoading=FALSE) |
| 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. | |
| CRect | GetListRect () |
| Get the rectangle of the list. | |
| void | UpdateHeaderCtrl () |
| Update the header control. | |
| void | UpdateChildrenPosition () OVERRIDE |
| Update the position of child items. | |
| int | GetHeaderHeight () const |
| Get the height of the header. | |
| CRect | _OnItemGetRect (int iPosition) const |
| Get the rectangle of an item by position. | |
| void | _UpdateAdapterColumnsWidth () const |
| Update the column widths in the adapter. | |
Protected Attributes | |
| SAutoRefPtr< IMcAdapter > | m_adapter |
| SAutoRefPtr< ILvDataSetObserver > | m_observer |
| SAutoRefPtr< IListViewItemLocator > | m_lvItemLocator |
| bool | m_bPendingUpdate |
| int | m_iPendingUpdateItem |
| int | m_iPendingViewItem |
| int | m_iFirstVisible |
| SList< ItemInfo > | m_lstItems |
| SOsrPanel * | m_itemCapture |
| int | m_iSelItem |
| SOsrPanel * | m_pHoverItem |
| SArray< SList< SItemPanel * > * > | m_itemRecycle |
| SXmlDoc | m_xmlTemplate |
| SAutoRefPtr< ISkinObj > | m_pSkinDivider |
| SLayoutSize | m_nDividerSize |
| BOOL | m_bWantTab |
| BOOL | m_bDatasetInvalidated |
| COLORREF | m_crGrid |
| SHeaderCtrl * | m_pHeader |
| SLayoutSize | m_nHeaderHeight |
| BOOL | m_bHotTrack |
Friends | |
| class | SMCListViewDataSetObserver |
Multi-Column List View Control.
A control that displays a list of items with multiple columns.
Definition at line 15 of file SMCListView.h.
| SMCListView::SMCListView | ( | ) |
Constructor.
Definition at line 44 of file SMCListView.cpp.
|
virtual |
Destructor.
Definition at line 69 of file SMCListView.cpp.
|
protected |
Get the rectangle of an item by position.
| iPosition | Position of the item |
Definition at line 827 of file SMCListView.cpp.
|
protected |
Update the column widths in the adapter.
Definition at line 1386 of file SMCListView.cpp.
|
protectedvirtual |
Create child items from XML configuration.
| xmlNode | XML node for the child items |
Reimplemented from SWindow.
Definition at line 150 of file SMCListView.cpp.
| void SMCListView::DeleteColumn | ( | int | iCol | ) |
Delete a specific column.
| iCol | Index of the column to delete |
Definition at line 317 of file SMCListView.cpp.
|
protected |
Dispatch messages to items.
| uMsg | Message identifier |
| wParam | Additional message-specific information |
| lParam | Additional message-specific information |
Definition at line 1300 of file SMCListView.cpp.
| void SMCListView::EnsureVisible | ( | int | iItem | ) |
Ensure an item is visible.
| iItem | Index of the item to ensure visible |
Definition at line 1045 of file SMCListView.cpp.
| IMcAdapter * SMCListView::GetAdapter | ( | ) |
Get the adapter for the list view.
Definition at line 1363 of file SMCListView.cpp.
| int SMCListView::GetColumnCount | ( | ) |
Get the total number of columns.
Definition at line 325 of file SMCListView.cpp.
| void SMCListView::GetDesiredSize | ( | SIZE * | psz, |
| int | nParentWid, | ||
| int | nParentHei ) |
Get the desired size of the control.
| psz | Output size |
| nParentWid | Parent container width |
| nParentHei | Parent container height |
Definition at line 1373 of file SMCListView.cpp.
| SHeaderCtrl * SMCListView::GetHeaderCtrl | ( | ) | const |
Get the header control.
Definition at line 1342 of file SMCListView.cpp.
|
protected |
Get the height of the header.
Definition at line 339 of file SMCListView.cpp.
| IHeaderCtrl * SMCListView::GetIHeaderCtrl | ( | ) |
Get the header control.
Definition at line 1368 of file SMCListView.cpp.
| IListViewItemLocator * SMCListView::GetItemLocator | ( | ) |
Get the item locator for the list view.
Definition at line 1358 of file SMCListView.cpp.
|
protected |
Get the item panel for a specific item.
| iItem | Index of the item |
Definition at line 1121 of file SMCListView.cpp.
|
protected |
Get the rectangle of the list.
Definition at line 190 of file SMCListView.cpp.
|
protectedvirtual |
Get the scroll line size.
| bVertical | Whether the scroll is vertical |
Reimplemented from SPanel.
Definition at line 1116 of file SMCListView.cpp.
| int SMCListView::GetSel | ( | ) |
Get the selected item.
Definition at line 1353 of file SMCListView.cpp.
| IItemPanel * SMCListView::HitTest | ( | const POINT * | pt | ) |
Hit test to determine the item under the mouse.
| pt | Pointer to the mouse coordinates |
| SItemPanel * SMCListView::HitTest | ( | CPoint & | pt | ) | const |
Hit test to determine the item under the mouse.
| pt | Mouse coordinates |
Definition at line 857 of file SMCListView.cpp.
| int SMCListView::InsertColumn | ( | int | nIndex, |
| LPCTSTR | pszText, | ||
| int | nWidth, | ||
| UINT | fmt, | ||
| LPARAM | lParam = 0, | ||
| BOOL | bDpiAware = TRUE, | ||
| float | fWeight = 0.0f ) |
Insert a column.
| nIndex | Index at which to insert the column |
| pszText | Column title |
| nWidth | Column width |
| fmt | Format flags |
| lParam | Additional parameter |
| bDpiAware | DPI awareness flag |
| fWeight | Font weight |
Definition at line 142 of file SMCListView.cpp.
|
protectedvirtual |
Check if item redraw is delayed.
Definition at line 813 of file SMCListView.cpp.
|
protectedvirtual |
Handle colorization event.
| cr | Color reference |
Reimplemented from SPanel.
Definition at line 1272 of file SMCListView.cpp.
|
protected |
Handle data set changed event.
Definition at line 422 of file SMCListView.cpp.
|
protected |
Handle data set invalidated event.
Definition at line 451 of file SMCListView.cpp.
|
protected |
Handle destroy event.
Definition at line 779 of file SMCListView.cpp.
|
protectedvirtual |
|
protected |
Handle header click event.
| pEvt | Event arguments |
Definition at line 344 of file SMCListView.cpp.
|
protected |
Handle header size changing event.
| pEvt | Event arguments |
Definition at line 374 of file SMCListView.cpp.
|
protected |
Handle header swap event.
| pEvt | Event arguments |
Definition at line 416 of file SMCListView.cpp.
|
protected |
Handle item click event.
| pEvt | Event arguments |
Definition at line 1261 of file SMCListView.cpp.
|
protected |
Handle item data changed event.
| iItem | Index of the item |
Definition at line 457 of file SMCListView.cpp.
|
protectedvirtual |
Get the rectangle of an item.
| pItem | Pointer to the item panel |
| rcItem | Output rectangle |
Definition at line 818 of file SMCListView.cpp.
|
protectedvirtual |
Handle item capture.
| pItem | Pointer to the item panel |
| bCapture | Capture flag |
Definition at line 838 of file SMCListView.cpp.
|
protected |
Handle key down event.
| nChar | Key code |
| nRepCnt | Repeat count |
| nFlags | Flags |
Definition at line 968 of file SMCListView.cpp.
|
protected |
Handle key event.
| uMsg | Message identifier |
| wParam | Additional message-specific information |
| lParam | Additional message-specific information |
Definition at line 942 of file SMCListView.cpp.
|
protected |
Handle kill focus event.
| wndFocus | New focus window handle |
Definition at line 1218 of file SMCListView.cpp.
|
protectedvirtual |
Handle language change event.
Reimplemented from SWindow.
Definition at line 1293 of file SMCListView.cpp.
|
protected |
Handle mouse event.
| uMsg | Message identifier |
| wParam | Additional message-specific information |
| lParam | Additional message-specific information |
Definition at line 882 of file SMCListView.cpp.
|
protected |
Handle mouse leave event.
Definition at line 958 of file SMCListView.cpp.
|
protected |
Handle mouse wheel event.
| nFlags | Flags |
| zDelta | Delta value |
| pt | Mouse coordinates |
Definition at line 1103 of file SMCListView.cpp.
|
protected |
Paint the control.
| pRT | Rendering target handle |
Definition at line 478 of file SMCListView.cpp.
|
protectedvirtual |
Handle rebuild font event.
Reimplemented from SWindow.
Definition at line 1347 of file SMCListView.cpp.
|
protectedvirtual |
Handle scale change event.
| nScale | Scale factor |
Reimplemented from SPanel.
Definition at line 1284 of file SMCListView.cpp.
|
protectedvirtual |
Handle scroll event.
| bVertical | Whether the scroll is vertical |
| uCode | Scroll type |
| nPos | Scroll position |
Reimplemented from SPanel.
Definition at line 569 of file SMCListView.cpp.
|
protectedvirtual |
Handle set cursor event.
| pt | Mouse coordinates |
Reimplemented from SWindow.
Definition at line 1241 of file SMCListView.cpp.
|
protected |
Handle set focus event.
| wndOld | Previous focus window handle |
Definition at line 1230 of file SMCListView.cpp.
|
protected |
Handle show window event.
| bShow | Show flag |
| nStatus | Status code |
Definition at line 1320 of file SMCListView.cpp.
|
protected |
Handle size change event.
| nType | Size change type |
| size | New size |
Definition at line 770 of file SMCListView.cpp.
|
protected |
Redraw a specific item.
| pItem | Pointer to the item panel |
Definition at line 852 of file SMCListView.cpp.
| BOOL SMCListView::SetAdapter | ( | IMcAdapter * | adapter | ) |
Set the adapter for the list view.
| adapter | Pointer to the multi-column adapter |
Definition at line 75 of file SMCListView.cpp.
|
inlineprotectedvirtual |
Reimplemented from SPanel.
Definition at line 387 of file SMCListView.h.
| void SMCListView::SetItemLocator | ( | IListViewItemLocator * | pItemLocator | ) |
Set the item locator for the list view.
| pItemLocator | Pointer to the item locator |
Definition at line 1135 of file SMCListView.cpp.
| void SMCListView::SetSel | ( | int | iItem, |
| BOOL | bNotify = FALSE ) |
Set the selected item.
| iItem | Index of the item to select |
| bNotify | Whether to notify of the change |
Definition at line 1153 of file SMCListView.cpp.
|
protected |
Update the position of child items.
Definition at line 333 of file SMCListView.cpp.
|
protected |
Update the header control.
Definition at line 306 of file SMCListView.cpp.
|
protected |
Update the scroll bar.
Definition at line 201 of file SMCListView.cpp.
|
protectedvirtual |
Update tooltip information.
| pt | Mouse coordinates |
| tipInfo | Tooltip information |
Reimplemented from SWindow.
Definition at line 1146 of file SMCListView.cpp.
| void SMCListView::UpdateVisibleItem | ( | int | iItem | ) |
Update a specific visible item.
| iItem | Index of the item |
Definition at line 759 of file SMCListView.cpp.
| void SMCListView::UpdateVisibleItems | ( | ) |
Update visible items.
Definition at line 589 of file SMCListView.cpp.
|
friend |
Definition at line 21 of file SMCListView.h.
|
protected |
Pointer to the multi-column adapter
Definition at line 397 of file SMCListView.h.
|
protected |
Flag indicating data set is invalidated
Definition at line 424 of file SMCListView.h.
|
protected |
Hot tracking flag
Definition at line 487 of file SMCListView.h.
|
protected |
Flag indicating pending update
Definition at line 407 of file SMCListView.h.
|
protected |
Flag indicating whether to want tab
Definition at line 423 of file SMCListView.h.
|
protected |
Grid color
Definition at line 425 of file SMCListView.h.
|
protected |
Index of the first visible item
Definition at line 411 of file SMCListView.h.
|
protected |
Index of the item to update, -1 for all, -2 for nothing
Definition at line 408 of file SMCListView.h.
|
protected |
Index of the item to view, -1 for init
Definition at line 409 of file SMCListView.h.
|
protected |
Index of the selected item
Definition at line 415 of file SMCListView.h.
|
protected |
Item panel that has been set capture
Definition at line 413 of file SMCListView.h.
|
protected |
Recycle bin for item panels
Definition at line 418 of file SMCListView.h.
|
protected |
List of currently visible items
Definition at line 412 of file SMCListView.h.
|
protected |
Pointer to the item locator
Definition at line 399 of file SMCListView.h.
|
protected |
Size of dividers
Definition at line 422 of file SMCListView.h.
|
protected |
Height of the header
Definition at line 486 of file SMCListView.h.
|
protected |
Pointer to the data set observer
Definition at line 398 of file SMCListView.h.
|
protected |
Pointer to the header control
Definition at line 485 of file SMCListView.h.
|
protected |
Item panel under the mouse
Definition at line 416 of file SMCListView.h.
|
protected |
Skin for dividers
Definition at line 421 of file SMCListView.h.
|
protected |
XML template for items
Definition at line 420 of file SMCListView.h.