Class representing a tree view control. More...
#include <STreeView.h>
Public Member Functions | |
| STreeView () | |
| Constructor for STreeView. | |
| ~STreeView () | |
| Destructor for STreeView. | |
| BOOL | SetAdapter (ITvAdapter *adapter) OVERRIDE |
| Sets the adapter for the tree view. | |
| ITvAdapter * | GetAdapter () SCONST OVERRIDE |
| Gets the adapter for the tree view. | |
| void | SetItemLocator (ITreeViewItemLocator *pItemLocator) OVERRIDE |
| Sets the item locator for the tree view. | |
| ITreeViewItemLocator * | GetItemLocator () SCONST OVERRIDE |
| Gets the item locator for the tree view. | |
| void | SetSel (HSTREEITEM hItem, BOOL bNotify=FALSE) OVERRIDE |
| Sets the selected item. | |
| HSTREEITEM | GetSel () SCONST OVERRIDE |
| Gets the selected item. | |
| void | EnsureVisible (HSTREEITEM hItem) OVERRIDE |
| Ensures an item is visible. | |
| IItemPanel * | HitTest (const POINT *pt) SCONST OVERRIDE |
| Performs a hit test on the tree view. | |
| SItemPanel * | HitTest (CPoint &pt) const |
| Performs a hit test on the tree view. | |
Protected Types | |
| typedef SMap< HSTREEITEM, ItemInfo > | VISIBLEITEMSMAP |
Protected Member Functions | |
| BOOL | OnItemClick (IEvtArgs *pEvt) |
| Handles the item click event. | |
| BOOL | OnItemDblClick (IEvtArgs *pEvt) |
| Handles the item double-click event. | |
| void | onBranchChanged (HSTREEITEM hBranch) |
| Notifies the tree view that a branch has changed. | |
| void | onBranchInvalidated (HSTREEITEM hBranch, BOOL bInvalidParents, BOOL bInvalidChildren) |
| Notifies the tree view that a branch has been invalidated. | |
| void | onBranchExpandedChanged (HSTREEITEM hBranch, BOOL bExpandedOld, BOOL bExpandedNew) |
| Notifies the tree view that the expanded state of a branch has changed. | |
| void | onItemBeforeRemove (HSTREEITEM hItem) |
| Notifies the tree view that an item is about to be removed. | |
| void | OnPaint (IRenderTarget *pRT) |
| Handles the paint event. | |
| void | OnSize (UINT nType, CSize size) |
| Handles the size event. | |
| void | OnDestroy () |
| Handles the destruction event. | |
| void | OnKeyDown (TCHAR nChar, UINT nRepCnt, UINT nFlags) |
| Handles the key down event. | |
| LRESULT | OnKeyEvent (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| Handles key events. | |
| void | OnMouseLeave () |
| Handles the mouse leave event. | |
| BOOL | OnMouseWheel (UINT nFlags, short zDelta, CPoint pt) |
| Handles the mouse wheel event. | |
| LRESULT | OnMouseEvent (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| Handles mouse events. | |
| void | OnKillFocus (SWND wndFocus) |
| Handles the kill focus event. | |
| void | OnSetFocus (SWND wndOld) |
| Handles the set focus event. | |
| void | OnLButtonDown (UINT nFlags, CPoint pt) |
| Handles the left mouse button down event. | |
| HRESULT | OnAttrIndent (const SStringW &strValue, BOOL bLoading) |
| Handles the indentation attribute. | |
| virtual HRESULT | SetAttribute (const SNS::SStringW &amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;strValue, BOOL bLoading=FALSE) |
| virtual UINT WINAPI | OnGetDlgCode () const |
| Gets the dialog code for the tree view. | |
| virtual BOOL | OnSetCursor (const CPoint &pt) |
| Sets the cursor for the tree view. | |
| virtual BOOL | UpdateToolTip (CPoint pt, SwndToolTipInfo &tipInfo) |
| Updates the tooltip information. | |
| virtual void | OnColorize (COLORREF cr) |
| Applies colorization to the tree view. | |
| virtual void | OnScaleChanged (int nScale) |
| Handles scale changes. | |
| virtual HRESULT | OnLanguageChanged () |
| Handles language change events. | |
| virtual void | OnRebuildFont () |
| Rebuilds the font settings. | |
| virtual BOOL | OnScroll (BOOL bVertical, UINT uCode, int nPos) |
| Handles scroll events. | |
| virtual int | GetScrollLineSize (BOOL bVertical) |
| Gets the scroll line size. | |
| virtual BOOL | CreateChildren (SXmlNode xmlNode) |
| Creates child elements from XML node. | |
| virtual void | OnItemSetCapture (SOsrPanel *pItem, BOOL bCapture) |
| Sets or releases mouse capture for an item. | |
| virtual BOOL | OnItemGetRect (const SOsrPanel *pItem, CRect &rcItem) const |
| Gets the rectangle of an item. | |
| virtual BOOL | IsItemRedrawDelay () const |
| Indicates if item redraw is delayed. | |
| virtual void | DrawLines (IRenderTarget *pRT, const CRect &rc, HSTREEITEM hItem) |
| Draws lines for an item. | |
| void | UpdateScrollBar () |
| Updates the scroll bar. | |
| void | UpdateVisibleItems () |
| Updates the visible items. | |
| void | RedrawItem (SItemPanel *pItem) |
| Redraws an item. | |
| SItemPanel * | GetItemPanel (HSTREEITEM hItem) |
| Gets the item panel for a given item handle. | |
| void | DispatchMessage2Items (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| Dispatches a message to items. | |
Protected Attributes | |
| SAutoRefPtr< ITvAdapter > | m_adapter |
| SAutoRefPtr< ITvDataSetObserver > | m_observer |
| SAutoRefPtr< ITreeViewItemLocator > | m_tvItemLocator |
| SArray< SList< SItemPanel * > * > | m_itemRecycle |
| SList< ItemInfo > | m_visible_items |
| VISIBLEITEMSMAP * | m_pVisibleMap |
| SXmlDoc | m_xmlTemplate |
| SOsrPanel * | m_itemCapture |
| SOsrPanel * | m_pHoverItem |
| HSTREEITEM | m_hSelected |
| BOOL | m_bWantTab |
| BOOL | m_bHasLines |
| SAutoRefPtr< ISkinObj > | m_pLineSkin |
| SLayoutSize | m_indent |
Friends | |
| class | STreeViewDataSetObserver |
Class representing a tree view control.
Definition at line 262 of file STreeView.h.
|
protected |
Definition at line 637 of file STreeView.h.
| STreeView::STreeView | ( | ) |
Constructor for STreeView.
Definition at line 420 of file STreeView.cpp.
| STreeView::~STreeView | ( | ) |
Destructor for STreeView.
Definition at line 438 of file STreeView.cpp.
|
protectedvirtual |
Creates child elements from XML node.
| xmlNode | XML node containing child elements. |
Reimplemented from SWindow.
Definition at line 509 of file STreeView.cpp.
|
protected |
Dispatches a message to items.
| uMsg | Message identifier. |
| wParam | Additional message information. |
| lParam | Additional message information. |
Definition at line 1443 of file STreeView.cpp.
|
protectedvirtual |
Draws lines for an item.
| pRT | Pointer to the rendering target. |
| rc | Rectangle to draw the lines. |
| hItem | Handle to the item. |
Definition at line 1490 of file STreeView.cpp.
| void STreeView::EnsureVisible | ( | HSTREEITEM | hItem | ) |
Ensures an item is visible.
| hItem | Handle to the item. |
Definition at line 617 of file STreeView.cpp.
| ITvAdapter * STreeView::GetAdapter | ( | ) |
Gets the adapter for the tree view.
Definition at line 1470 of file STreeView.cpp.
| ITreeViewItemLocator * STreeView::GetItemLocator | ( | ) |
Gets the item locator for the tree view.
Definition at line 1480 of file STreeView.cpp.
|
protected |
Gets the item panel for a given item handle.
| hItem | Handle to the item. |
Definition at line 1322 of file STreeView.cpp.
|
protectedvirtual |
Gets the scroll line size.
| bVertical | TRUE if the scroll is vertical, FALSE if horizontal. |
Reimplemented from SPanel.
Definition at line 1317 of file STreeView.cpp.
| HSTREEITEM STreeView::GetSel | ( | ) |
Gets the selected item.
Definition at line 1485 of file STreeView.cpp.
| IItemPanel * STreeView::HitTest | ( | const POINT * | pt | ) |
Performs a hit test on the tree view.
| pt | Mouse position. |
| SItemPanel * STreeView::HitTest | ( | CPoint & | pt | ) | const |
Performs a hit test on the tree view.
| pt | Mouse position. |
Definition at line 1339 of file STreeView.cpp.
|
protectedvirtual |
Indicates if item redraw is delayed.
Definition at line 1070 of file STreeView.cpp.
|
protected |
Handles the indentation attribute.
| strValue | Attribute value. |
| bLoading | TRUE if loading, FALSE otherwise. |
Definition at line 1412 of file STreeView.cpp.
|
protected |
Notifies the tree view that a branch has changed.
| hBranch | Handle to the branch item. |
Definition at line 1075 of file STreeView.cpp.
|
protected |
Notifies the tree view that the expanded state of a branch has changed.
| hBranch | Handle to the branch item. |
| bExpandedOld | Old expanded state. |
| bExpandedNew | New expanded state. |
Definition at line 1146 of file STreeView.cpp.
|
protected |
Notifies the tree view that a branch has been invalidated.
| hBranch | Handle to the branch item. |
| bInvalidParents | TRUE to invalidate parent branches, FALSE otherwise. |
| bInvalidChildren | TRUE to invalidate child branches, FALSE otherwise. |
Definition at line 1087 of file STreeView.cpp.
|
protectedvirtual |
Applies colorization to the tree view.
| cr | Color reference. |
Reimplemented from SPanel.
Definition at line 1421 of file STreeView.cpp.
|
protected |
Handles the destruction event.
Definition at line 584 of file STreeView.cpp.
|
protectedvirtual |
Gets the dialog code for the tree view.
Definition at line 1377 of file STreeView.cpp.
|
protected |
Notifies the tree view that an item is about to be removed.
| hItem | Handle to the item. |
Definition at line 1158 of file STreeView.cpp.
|
protected |
Handles the item click event.
| pEvt | Event arguments. |
Definition at line 1355 of file STreeView.cpp.
|
protected |
Handles the item double-click event.
| pEvt | Event arguments. |
Definition at line 1366 of file STreeView.cpp.
|
protectedvirtual |
Gets the rectangle of an item.
| pItem | Pointer to the item panel. |
| rcItem | Rectangle to receive the item position. |
Definition at line 1051 of file STreeView.cpp.
|
protectedvirtual |
Sets or releases mouse capture for an item.
| pItem | Pointer to the item panel. |
| bCapture | TRUE to set capture, FALSE to release capture. |
Definition at line 1037 of file STreeView.cpp.
|
protected |
Handles the key down event.
| nChar | Character code. |
| nRepCnt | Repeat count. |
| nFlags | Flags associated with the key event. |
Definition at line 697 of file STreeView.cpp.
|
protected |
Handles key events.
| uMsg | Message identifier. |
| wParam | Additional message information. |
| lParam | Additional message information. |
Definition at line 777 of file STreeView.cpp.
|
protected |
Handles the kill focus event.
| wndFocus | Window receiving focus. |
Definition at line 1282 of file STreeView.cpp.
|
protectedvirtual |
Handles language change events.
Reimplemented from SWindow.
Definition at line 1436 of file STreeView.cpp.
|
protected |
Handles the left mouse button down event.
| nFlags | Flags associated with the mouse event. |
| pt | Mouse position. |
Definition at line 1570 of file STreeView.cpp.
|
protected |
Handles mouse events.
| uMsg | Message identifier. |
| wParam | Additional message information. |
| lParam | Additional message information. |
Definition at line 1188 of file STreeView.cpp.
|
protected |
Handles the mouse leave event.
Definition at line 1258 of file STreeView.cpp.
|
protected |
Handles the mouse wheel event.
| nFlags | Flags associated with the mouse event. |
| zDelta | Wheel delta. |
| pt | Mouse position. |
Definition at line 1269 of file STreeView.cpp.
|
protected |
Handles the paint event.
| pRT | Pointer to the rendering target. |
Definition at line 519 of file STreeView.cpp.
|
protectedvirtual |
Rebuilds the font settings.
Reimplemented from SWindow.
Definition at line 1463 of file STreeView.cpp.
|
protectedvirtual |
Handles scale changes.
| nScale | New scale. |
Reimplemented from SPanel.
Definition at line 1427 of file STreeView.cpp.
|
protectedvirtual |
Handles scroll events.
| bVertical | TRUE if the scroll is vertical, FALSE if horizontal. |
| uCode | Scroll code. |
| nPos | New position. |
Reimplemented from SPanel.
Definition at line 1299 of file STreeView.cpp.
|
protectedvirtual |
Sets the cursor for the tree view.
| pt | Mouse position. |
Reimplemented from SWindow.
Definition at line 1385 of file STreeView.cpp.
|
protected |
Handles the set focus event.
| wndOld | Window losing focus. |
Definition at line 1290 of file STreeView.cpp.
|
protected |
Handles the size event.
| nType | Type of size change. |
| size | New size. |
Definition at line 575 of file STreeView.cpp.
|
protected |
Redraws an item.
| pItem | Pointer to the item panel. |
Definition at line 1253 of file STreeView.cpp.
| BOOL STreeView::SetAdapter | ( | ITvAdapter * | adapter | ) |
Sets the adapter for the tree view.
| adapter | Pointer to the adapter. |
Definition at line 443 of file STreeView.cpp.
|
inlineprotectedvirtual |
Reimplemented from SPanel.
Definition at line 488 of file STreeView.h.
| void STreeView::SetItemLocator | ( | ITreeViewItemLocator * | pItemLocator | ) |
Sets the item locator for the tree view.
| pItemLocator | Pointer to the item locator. |
Definition at line 1475 of file STreeView.cpp.
| void STreeView::SetSel | ( | HSTREEITEM | hItem, |
| BOOL | bNotify = FALSE ) |
Sets the selected item.
| hItem | Handle to the item. |
| bNotify | TRUE to notify listeners, FALSE otherwise. |
Definition at line 652 of file STreeView.cpp.
|
protected |
Updates the scroll bar.
Definition at line 793 of file STreeView.cpp.
|
protectedvirtual |
Updates the tooltip information.
| pt | Mouse position. |
| tipInfo | Tooltip information. |
Reimplemented from SWindow.
Definition at line 1405 of file STreeView.cpp.
|
protected |
Updates the visible items.
Definition at line 880 of file STreeView.cpp.
|
friend |
Definition at line 267 of file STreeView.h.
|
protected |
Adapter for the tree view items.
Definition at line 625 of file STreeView.h.
|
protected |
Flag indicating if lines are drawn between items.
Definition at line 648 of file STreeView.h.
|
protected |
Flag indicating if tab is wanted.
Definition at line 647 of file STreeView.h.
|
protected |
Current selected item.
Definition at line 645 of file STreeView.h.
|
protected |
Indentation between levels.
Definition at line 650 of file STreeView.h.
|
protected |
Item that has capture.
Definition at line 642 of file STreeView.h.
|
protected |
Item recycle bin, each style has a list for reuse.
Definition at line 634 of file STreeView.h.
|
protected |
Observer for data set changes.
Definition at line 626 of file STreeView.h.
|
protected |
Item under hover state.
Definition at line 643 of file STreeView.h.
|
protected |
Skin for the lines.
Definition at line 649 of file STreeView.h.
|
protected |
Map of visible items.
Definition at line 638 of file STreeView.h.
|
protected |
Item locator for the tree view.
Definition at line 627 of file STreeView.h.
|
protected |
List of visible items.
Definition at line 635 of file STreeView.h.
|
protected |
XML template for items.
Definition at line 640 of file STreeView.h.