soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
STreeView.h
1#ifndef __STREEVIEW__H__
2#define __STREEVIEW__H__
3
4#include <core/SWnd.h>
5#include <core/SPanel.h>
6#include <core/SItemPanel.h>
7#include <interface/SAdapter-i.h>
8#include <interface/STreeViewItemLocator-i.h>
9#include <proxy/SPanelProxy.h>
10
11SNSBEGIN
12
13/**
14 * @class STreeViewItemLocator
15 * @brief Class responsible for locating and managing tree view items.
16 */
17class SOUI_EXP STreeViewItemLocator : public TObjRefImpl<ITreeViewItemLocator> {
18 public:
19 /**
20 * @brief Constructor for STreeViewItemLocator.
21 * @param nIndent Indentation between levels.
22 */
23 STreeViewItemLocator(int nIndent = 16);
24
25 /**
26 * @brief Destructor for STreeViewItemLocator.
27 */
29
30 public:
31 /**
32 * @brief Sets the adapter for the tree view items.
33 * @param pAdapter Pointer to the adapter.
34 */
35 STDMETHOD_(void, SetAdapter)(THIS_ ITvAdapter *pAdapter) OVERRIDE;
36
37 /**
38 * @brief Notifies the locator that a branch has changed.
39 * @param hItem Handle to the branch item.
40 */
41 STDMETHOD_(void, OnBranchChanged)(THIS_ HSTREEITEM hItem) OVERRIDE;
42
43 /**
44 * @brief Notifies the locator that the expanded state of a branch has changed.
45 * @param hItem Handle to the branch item.
46 * @param bExpandedOld Old expanded state.
47 * @param bExpandedNew New expanded state.
48 */
49 STDMETHOD_(void, OnBranchExpandedChanged)
50 (THIS_ HSTREEITEM hItem, BOOL bExpandedOld, BOOL bExpandedNew) OVERRIDE;
51
52 /**
53 * @brief Gets the total height of the tree view.
54 * @return Total height.
55 */
56 STDMETHOD_(int, GetTotalHeight)(THIS) SCONST OVERRIDE;
57
58 /**
59 * @brief Gets the total width of the tree view.
60 * @return Total width.
61 */
62 STDMETHOD_(int, GetTotalWidth)(THIS) SCONST OVERRIDE;
63
64 /**
65 * @brief Converts an item handle to its position.
66 * @param hItem Handle to the item.
67 * @return Position of the item.
68 */
69 STDMETHOD_(int, Item2Position)(THIS_ HSTREEITEM hItem) SCONST OVERRIDE;
70
71 /**
72 * @brief Converts a position to an item handle.
73 * @param position Position in the tree view.
74 * @return Handle to the item.
75 */
76 STDMETHOD_(HSTREEITEM, Position2Item)(THIS_ int position) SCONST OVERRIDE;
77
78 /**
79 * @brief Gets the scroll line size.
80 * @return Scroll line size.
81 */
82 STDMETHOD_(int, GetScrollLineSize)(THIS) SCONST OVERRIDE;
83
84 /**
85 * @brief Sets the width of an item.
86 * @param hItem Handle to the item.
87 * @param nWidth New width of the item.
88 */
89 STDMETHOD_(void, SetItemWidth)(THIS_ HSTREEITEM hItem, int nWidth) OVERRIDE;
90
91 /**
92 * @brief Gets the width of an item.
93 * @param hItem Handle to the item.
94 * @return Width of the item.
95 */
96 STDMETHOD_(int, GetItemWidth)(THIS_ HSTREEITEM hItem) SCONST OVERRIDE;
97
98 /**
99 * @brief Sets the height of an item.
100 * @param hItem Handle to the item.
101 * @param nHeight New height of the item.
102 */
103 STDMETHOD_(void, SetItemHeight)(THIS_ HSTREEITEM hItem, int nHeight) OVERRIDE;
104
105 /**
106 * @brief Gets the height of an item.
107 * @param hItem Handle to the item.
108 * @return Height of the item.
109 */
110 STDMETHOD_(int, GetItemHeight)(THIS_ HSTREEITEM hItem) SCONST OVERRIDE;
111
112 /**
113 * @brief Gets the indentation of an item.
114 * @param hItem Handle to the item.
115 * @return Indentation of the item.
116 */
117 STDMETHOD_(int, GetItemIndent)(THIS_ HSTREEITEM hItem) SCONST OVERRIDE;
118
119 /**
120 * @brief Gets the indentation between levels.
121 * @return Indentation between levels.
122 */
123 STDMETHOD_(int, GetIndent)(CTHIS) SCONST OVERRIDE;
124
125 /**
126 * @brief Sets the indentation between levels.
127 * @param nIndent New indentation value.
128 */
129 STDMETHOD_(void, SetIndent)(THIS_ int nIndent) OVERRIDE;
130
131 protected:
132 /**
133 * @brief Checks if an item is expanded.
134 * @param hItem Handle to the item.
135 * @return TRUE if the item is expanded, otherwise FALSE.
136 */
137 BOOL IsItemExpanded(HSTREEITEM hItem) const;
138
139 /**
140 * @brief Updates the branch width data in the parent window.
141 * @param hItem Handle to the item.
142 * @param nOldWidth Old width of the branch.
143 * @param nNewWidth New width of the branch.
144 */
145 void _UpdateBranchWidth(HSTREEITEM hItem, int nOldWidth, int nNewWidth);
146
147 /**
148 * @brief Gets the width of a branch.
149 * @param hBranch Handle to the branch.
150 * @return Width of the branch.
151 */
152 int _GetBranchWidth(HSTREEITEM hBranch) const;
153
154 /**
155 * @brief Sets the width of a branch.
156 * @param hBranch Handle to the branch.
157 * @param nWidth New width of the branch.
158 */
159 void _SetBranchWidth(HSTREEITEM hBranch, int nWidth);
160
161 /**
162 * @brief Sets the width of an item.
163 * @param hItem Handle to the item.
164 * @param nWidth New width of the item.
165 */
166 void _SetItemWidth(HSTREEITEM hItem, int nWidth);
167
168 /**
169 * @brief Gets the height of a branch.
170 * @param hItem Handle to the item.
171 * @return Height of the branch.
172 */
173 int _GetBranchHeight(HSTREEITEM hItem) const;
174
175 /**
176 * @brief Sets the height of a branch.
177 * @param hItem Handle to the item.
178 * @param nHeight New height of the branch.
179 */
180 void _SetBranchHeight(HSTREEITEM hItem, int nHeight);
181
182 /**
183 * @brief Updates the height of a branch.
184 * @param hItem Handle to the item.
185 * @param nDiff Difference in height.
186 */
187 void _UpdateBranchHeight(HSTREEITEM hItem, int nDiff);
188
189 /**
190 * @brief Updates the offset of sibling items.
191 * @param hItem Handle to the item.
192 */
193 void _UpdateSiblingsOffset(HSTREEITEM hItem);
194
195 /**
196 * @brief Gets the offset of an item.
197 * @param hItem Handle to the item.
198 * @return Offset of the item.
199 */
200 int _GetItemOffset(HSTREEITEM hItem) const;
201
202 /**
203 * @brief Sets the offset of an item.
204 * @param hItem Handle to the item.
205 * @param nOffset New offset of the item.
206 */
207 void _SetItemOffset(HSTREEITEM hItem, int nOffset);
208
209 /**
210 * @brief Sets the height of an item.
211 * @param hItem Handle to the item.
212 * @param nHeight New height of the item.
213 */
214 void _SetItemHeight(HSTREEITEM hItem, int nHeight);
215
216 /**
217 * @brief Gets the visible height of an item.
218 * @param hItem Handle to the item.
219 * @return Visible height of the item.
220 */
221 int _GetItemVisibleHeight(HSTREEITEM hItem) const;
222
223 /**
224 * @brief Gets the visible width of an item.
225 * @param hItem Handle to the item.
226 * @return Visible width of the item.
227 */
228 int _GetItemVisibleWidth(HSTREEITEM hItem) const;
229
230 /**
231 * @brief Converts a position to an item handle.
232 * @param position Position in the tree view.
233 * @param hParent Handle to the parent item.
234 * @param nParentPosition Position of the parent item.
235 * @return Handle to the item.
236 */
237 HSTREEITEM _Position2Item(int position, HSTREEITEM hParent, int nParentPosition) const;
238
239 /**
240 * @brief Checks if an item is visible.
241 * @param hItem Handle to the item.
242 * @return TRUE if the item is visible, otherwise FALSE.
243 */
244 BOOL _IsItemVisible(HSTREEITEM hItem) const;
245
246 /**
247 * @brief Initializes a branch.
248 * @param hItem Handle to the item.
249 */
250 void _InitBranch(HSTREEITEM hItem);
251
252 SAutoRefPtr<ITvAdapter> m_adapter; /**< Adapter for the tree view items. */
253 int m_nLineHeight; /**< Line height. */
254 int m_nIndent; /**< Indentation between levels. */
255 CSize m_szDef; /**< Default size. */
256};
257
258/**
259 * @class STreeView
260 * @brief Class representing a tree view control.
261 */
262class SOUI_EXP STreeView
263 : public TPanelProxy<ITreeView>
264 , protected SHostProxy
265 , protected IItemContainer {
266 DEF_SOBJECT(SPanel, L"treeview")
267 friend class STreeViewDataSetObserver;
268
269 public:
270 /**
271 * @brief Constructor for STreeView.
272 */
273 STreeView();
274
275 /**
276 * @brief Destructor for STreeView.
277 */
278 ~STreeView();
279
280 public:
281 /**
282 * @brief Sets the adapter for the tree view.
283 * @param adapter Pointer to the adapter.
284 * @return TRUE if successful, otherwise FALSE.
285 */
286 STDMETHOD_(BOOL, SetAdapter)(THIS_ ITvAdapter *adapter) OVERRIDE;
287
288 /**
289 * @brief Gets the adapter for the tree view.
290 * @return Pointer to the adapter.
291 */
292 STDMETHOD_(ITvAdapter *, GetAdapter)(THIS) SCONST OVERRIDE;
293
294 /**
295 * @brief Sets the item locator for the tree view.
296 * @param pItemLocator Pointer to the item locator.
297 */
298 STDMETHOD_(void, SetItemLocator)(THIS_ ITreeViewItemLocator *pItemLocator) OVERRIDE;
299
300 /**
301 * @brief Gets the item locator for the tree view.
302 * @return Pointer to the item locator.
303 */
304 STDMETHOD_(ITreeViewItemLocator *, GetItemLocator)(THIS) SCONST OVERRIDE;
305
306 /**
307 * @brief Sets the selected item.
308 * @param hItem Handle to the item.
309 * @param bNotify TRUE to notify listeners, FALSE otherwise.
310 */
311 STDMETHOD_(void, SetSel)(THIS_ HSTREEITEM hItem, BOOL bNotify = FALSE) OVERRIDE;
312
313 /**
314 * @brief Gets the selected item.
315 * @return Handle to the selected item.
316 */
317 STDMETHOD_(HSTREEITEM, GetSel)(THIS) SCONST OVERRIDE;
318
319 /**
320 * @brief Ensures an item is visible.
321 * @param hItem Handle to the item.
322 */
323 STDMETHOD_(void, EnsureVisible)(THIS_ HSTREEITEM hItem) OVERRIDE;
324
325 /**
326 * @brief Performs a hit test on the tree view.
327 * @param pt Mouse position.
328 * @return Pointer to the item panel at the specified position.
329 */
330 STDMETHOD_(IItemPanel *, HitTest)(THIS_ const POINT *pt) SCONST OVERRIDE;
331
332 public:
333 /**
334 * @brief Performs a hit test on the tree view.
335 * @param pt Mouse position.
336 * @return Pointer to the item panel at the specified position.
337 */
338 SItemPanel *HitTest(CPoint &pt) const;
339
340 protected:
341 /**
342 * @brief Handles the item click event.
343 * @param pEvt Event arguments.
344 * @return TRUE if the event is handled, otherwise FALSE.
345 */
346 BOOL OnItemClick(IEvtArgs *pEvt);
347
348 /**
349 * @brief Handles the item double-click event.
350 * @param pEvt Event arguments.
351 * @return TRUE if the event is handled, otherwise FALSE.
352 */
353 BOOL OnItemDblClick(IEvtArgs *pEvt);
354
355 /**
356 * @brief Notifies the tree view that a branch has changed.
357 * @param hBranch Handle to the branch item.
358 */
359 void onBranchChanged(HSTREEITEM hBranch);
360
361 /**
362 * @brief Notifies the tree view that a branch has been invalidated.
363 * @param hBranch Handle to the branch item.
364 * @param bInvalidParents TRUE to invalidate parent branches, FALSE otherwise.
365 * @param bInvalidChildren TRUE to invalidate child branches, FALSE otherwise.
366 */
367 void onBranchInvalidated(HSTREEITEM hBranch, BOOL bInvalidParents, BOOL bInvalidChildren);
368
369 /**
370 * @brief Notifies the tree view that the expanded state of a branch has changed.
371 * @param hBranch Handle to the branch item.
372 * @param bExpandedOld Old expanded state.
373 * @param bExpandedNew New expanded state.
374 */
375 void onBranchExpandedChanged(HSTREEITEM hBranch, BOOL bExpandedOld, BOOL bExpandedNew);
376
377 /**
378 * @brief Notifies the tree view that an item is about to be removed.
379 * @param hItem Handle to the item.
380 */
381 void onItemBeforeRemove(HSTREEITEM hItem);
382
383 protected:
384 /**
385 * @brief Handles the paint event.
386 * @param pRT Pointer to the rendering target.
387 */
388 void OnPaint(IRenderTarget *pRT);
389
390 /**
391 * @brief Handles the size event.
392 * @param nType Type of size change.
393 * @param size New size.
394 */
395 void OnSize(UINT nType, CSize size);
396
397 /**
398 * @brief Handles the destruction event.
399 */
400 void OnDestroy();
401
402 /**
403 * @brief Handles the key down event.
404 * @param nChar Character code.
405 * @param nRepCnt Repeat count.
406 * @param nFlags Flags associated with the key event.
407 */
408 void OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags);
409
410 /**
411 * @brief Handles key events.
412 * @param uMsg Message identifier.
413 * @param wParam Additional message information.
414 * @param lParam Additional message information.
415 * @return Result of the message processing.
416 */
417 LRESULT OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
418
419 /**
420 * @brief Handles the mouse leave event.
421 */
422 void OnMouseLeave();
423
424 /**
425 * @brief Handles the mouse wheel event.
426 * @param nFlags Flags associated with the mouse event.
427 * @param zDelta Wheel delta.
428 * @param pt Mouse position.
429 * @return TRUE if the event is handled, otherwise FALSE.
430 */
431 BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
432
433 /**
434 * @brief Handles mouse events.
435 * @param uMsg Message identifier.
436 * @param wParam Additional message information.
437 * @param lParam Additional message information.
438 * @return Result of the message processing.
439 */
440 LRESULT OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
441
442 /**
443 * @brief Handles the kill focus event.
444 * @param wndFocus Window receiving focus.
445 */
446 void OnKillFocus(SWND wndFocus);
447
448 /**
449 * @brief Handles the set focus event.
450 * @param wndOld Window losing focus.
451 */
452 void OnSetFocus(SWND wndOld);
453
454 /**
455 * @brief Handles the left mouse button down event.
456 * @param nFlags Flags associated with the mouse event.
457 * @param pt Mouse position.
458 */
459 void OnLButtonDown(UINT nFlags, CPoint pt);
460
461 SOUI_MSG_MAP_BEGIN()
462 MSG_WM_PAINT_EX(OnPaint)
463 MSG_WM_SIZE(OnSize)
464 MSG_WM_DESTROY(OnDestroy)
465 MSG_WM_KEYDOWN(OnKeyDown)
466 MSG_WM_KILLFOCUS_EX(OnKillFocus)
467 MSG_WM_SETFOCUS_EX(OnSetFocus)
468 MSG_WM_MOUSEWHEEL(OnMouseWheel)
469 MSG_WM_MOUSELEAVE(OnMouseLeave)
470 MSG_WM_LBUTTONDOWN(OnLButtonDown)
471 MSG_WM_LBUTTONDBLCLK(OnLButtonDown)
472 MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseEvent)
473 MESSAGE_RANGE_HANDLER_EX(WM_KEYFIRST, WM_KEYLAST, OnKeyEvent)
474 MESSAGE_RANGE_HANDLER_EX(WM_IME_STARTCOMPOSITION, WM_IME_KEYLAST, OnKeyEvent)
475 MESSAGE_HANDLER_EX(WM_IME_CHAR, OnKeyEvent)
476 MESSAGE_HANDLER_EX(WM_IME_REQUEST, OnKeyEvent)
477 SOUI_MSG_MAP_END()
478
479 protected:
480 /**
481 * @brief Handles the indentation attribute.
482 * @param strValue Attribute value.
483 * @param bLoading TRUE if loading, FALSE otherwise.
484 * @return Result of the attribute handling.
485 */
486 HRESULT OnAttrIndent(const SStringW &strValue, BOOL bLoading);
487
488 SOUI_ATTRS_BEGIN()
489 ATTR_CUSTOM(L"indent", OnAttrIndent)
490 ATTR_INT(L"wantTab", m_bWantTab, FALSE)
491 ATTR_BOOL(L"hasLines", m_bHasLines, TRUE)
492 ATTR_SKIN(L"lineSkin", m_pLineSkin, TRUE)
493 SOUI_ATTRS_END()
494
495 protected:
496 /**
497 * @brief Gets the dialog code for the tree view.
498 * @return Dialog code.
499 */
500 virtual UINT WINAPI OnGetDlgCode() const;
501
502 /**
503 * @brief Sets the cursor for the tree view.
504 * @param pt Mouse position.
505 * @return TRUE if the cursor is set, otherwise FALSE.
506 */
507 virtual BOOL OnSetCursor(const CPoint &pt);
508
509 /**
510 * @brief Updates the tooltip information.
511 * @param pt Mouse position.
512 * @param tipInfo Tooltip information.
513 * @return TRUE if the tooltip is updated, otherwise FALSE.
514 */
515 virtual BOOL UpdateToolTip(CPoint pt, SwndToolTipInfo &tipInfo);
516
517 /**
518 * @brief Applies colorization to the tree view.
519 * @param cr Color reference.
520 */
521 virtual void OnColorize(COLORREF cr);
522
523 /**
524 * @brief Handles scale changes.
525 * @param nScale New scale.
526 */
527 virtual void OnScaleChanged(int nScale);
528
529 /**
530 * @brief Handles language change events.
531 * @return Result of the language change handling.
532 */
533 virtual HRESULT OnLanguageChanged();
534
535 /**
536 * @brief Rebuilds the font settings.
537 */
538 virtual void OnRebuildFont();
539
540 /**
541 * @brief Handles scroll events.
542 * @param bVertical TRUE if the scroll is vertical, FALSE if horizontal.
543 * @param uCode Scroll code.
544 * @param nPos New position.
545 * @return TRUE if the scroll event is handled, otherwise FALSE.
546 */
547 virtual BOOL OnScroll(BOOL bVertical, UINT uCode, int nPos);
548
549 /**
550 * @brief Gets the scroll line size.
551 * @param bVertical TRUE if the scroll is vertical, FALSE if horizontal.
552 * @return Scroll line size.
553 */
554 virtual int GetScrollLineSize(BOOL bVertical);
555
556 /**
557 * @brief Creates child elements from XML node.
558 * @param xmlNode XML node containing child elements.
559 * @return TRUE if successful, otherwise FALSE.
560 */
561 virtual BOOL CreateChildren(SXmlNode xmlNode);
562
563 /**
564 * @brief Sets or releases mouse capture for an item.
565 * @param pItem Pointer to the item panel.
566 * @param bCapture TRUE to set capture, FALSE to release capture.
567 */
568 virtual void OnItemSetCapture(SOsrPanel *pItem, BOOL bCapture);
569
570 /**
571 * @brief Gets the rectangle of an item.
572 * @param pItem Pointer to the item panel.
573 * @param rcItem Rectangle to receive the item position.
574 * @return TRUE if successful, otherwise FALSE.
575 */
576 virtual BOOL OnItemGetRect(const SOsrPanel *pItem, CRect &rcItem) const;
577
578 /**
579 * @brief Indicates if item redraw is delayed.
580 * @return TRUE if redraw is delayed, otherwise FALSE.
581 */
582 virtual BOOL IsItemRedrawDelay() const;
583
584 /**
585 * @brief Draws lines for an item.
586 * @param pRT Pointer to the rendering target.
587 * @param rc Rectangle to draw the lines.
588 * @param hItem Handle to the item.
589 */
590 virtual void DrawLines(IRenderTarget *pRT, const CRect &rc, HSTREEITEM hItem);
591
592 protected:
593 /**
594 * @brief Updates the scroll bar.
595 */
596 void UpdateScrollBar();
597
598 /**
599 * @brief Updates the visible items.
600 */
601 void UpdateVisibleItems();
602
603 /**
604 * @brief Redraws an item.
605 * @param pItem Pointer to the item panel.
606 */
607 void RedrawItem(SItemPanel *pItem);
608
609 /**
610 * @brief Gets the item panel for a given item handle.
611 * @param hItem Handle to the item.
612 * @return Pointer to the item panel.
613 */
614 SItemPanel *GetItemPanel(HSTREEITEM hItem);
615
616 /**
617 * @brief Dispatches a message to items.
618 * @param uMsg Message identifier.
619 * @param wParam Additional message information.
620 * @param lParam Additional message information.
621 */
622 void DispatchMessage2Items(UINT uMsg, WPARAM wParam, LPARAM lParam);
623
624 protected:
625 SAutoRefPtr<ITvAdapter> m_adapter; /**< Adapter for the tree view items. */
626 SAutoRefPtr<ITvDataSetObserver> m_observer; /**< Observer for data set changes. */
627 SAutoRefPtr<ITreeViewItemLocator> m_tvItemLocator; /**< Item locator for the tree view. */
628
629 struct ItemInfo
630 {
631 SItemPanel *pItem; /**< Pointer to the item panel. */
632 int nType; /**< Type of the item. */
633 };
634 SArray<SList<SItemPanel *> *> m_itemRecycle; /**< Item recycle bin, each style has a list for reuse. */
635 SList<ItemInfo> m_visible_items; /**< List of visible items. */
636
637 typedef SMap<HSTREEITEM, ItemInfo> VISIBLEITEMSMAP;
638 VISIBLEITEMSMAP *m_pVisibleMap; /**< Map of visible items. */
639
640 SXmlDoc m_xmlTemplate; /**< XML template for items. */
641
642 SOsrPanel *m_itemCapture; /**< Item that has capture. */
643 SOsrPanel *m_pHoverItem; /**< Item under hover state. */
644
645 HSTREEITEM m_hSelected; /**< Current selected item. */
646
647 BOOL m_bWantTab; /**< Flag indicating if tab is wanted. */
648 BOOL m_bHasLines; /**< Flag indicating if lines are drawn between items. */
649 SAutoRefPtr<ISkinObj> m_pLineSkin; /**< Skin for the lines. */
650 SLayoutSize m_indent; /**< Indentation between levels. */
651};
652SNSEND
653#endif // __STREEVIEW__H__
SOUI Panel with Scrollbar Support.
SOUI基础DUI窗口模块
Smart pointer class for managing COM-style reference-counted objects.
布局大小类
Definition SLayoutSize.h:10
SPanel()
Constructor for SPanel.
Definition SPanel.cpp:165
A class representing an ASCII string.
Definition sstringw.h:96
BOOL m_bHasLines
Definition STreeView.h:648
virtual BOOL OnItemGetRect(const SOsrPanel *pItem, CRect &rcItem) const
Gets the rectangle of an item.
virtual void OnItemSetCapture(SOsrPanel *pItem, BOOL bCapture)
Sets or releases mouse capture for an item.
SItemPanel * GetItemPanel(HSTREEITEM hItem)
Gets the item panel for a given item handle.
void OnDestroy()
Handles the destruction event.
void SetSel(HSTREEITEM hItem, BOOL bNotify=FALSE) OVERRIDE
Sets the selected item.
virtual void OnColorize(COLORREF cr)
Applies colorization to the tree view.
ITreeViewItemLocator * GetItemLocator() SCONST OVERRIDE
Gets the item locator for the tree view.
void onBranchChanged(HSTREEITEM hBranch)
Notifies the tree view that a branch has changed.
VISIBLEITEMSMAP * m_pVisibleMap
Definition STreeView.h:638
void onBranchExpandedChanged(HSTREEITEM hBranch, BOOL bExpandedOld, BOOL bExpandedNew)
Notifies the tree view that the expanded state of a branch has changed.
virtual BOOL UpdateToolTip(CPoint pt, SwndToolTipInfo &tipInfo)
Updates the tooltip information.
BOOL SetAdapter(ITvAdapter *adapter) OVERRIDE
Sets the adapter for the tree view.
BOOL OnItemClick(IEvtArgs *pEvt)
Handles the item click event.
SAutoRefPtr< ITvDataSetObserver > m_observer
Definition STreeView.h:626
void OnSetFocus(SWND wndOld)
Handles the set focus event.
void OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags)
Handles the key down event.
SAutoRefPtr< ISkinObj > m_pLineSkin
Definition STreeView.h:649
SLayoutSize m_indent
Definition STreeView.h:650
void UpdateScrollBar()
Updates the scroll bar.
virtual BOOL IsItemRedrawDelay() const
Indicates if item redraw is delayed.
HSTREEITEM m_hSelected
Definition STreeView.h:645
HSTREEITEM GetSel() SCONST OVERRIDE
Gets the selected item.
LRESULT OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles key events.
SArray< SList< SItemPanel * > * > m_itemRecycle
Definition STreeView.h:634
virtual void OnScaleChanged(int nScale)
Handles scale changes.
SAutoRefPtr< ITreeViewItemLocator > m_tvItemLocator
Definition STreeView.h:627
virtual HRESULT OnLanguageChanged()
Handles language change events.
virtual BOOL OnSetCursor(const CPoint &pt)
Sets the cursor for the tree view.
virtual int GetScrollLineSize(BOOL bVertical)
Gets the scroll line size.
void OnKillFocus(SWND wndFocus)
Handles the kill focus event.
BOOL m_bWantTab
Definition STreeView.h:647
virtual BOOL OnScroll(BOOL bVertical, UINT uCode, int nPos)
Handles scroll events.
SOsrPanel * m_pHoverItem
Definition STreeView.h:643
BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
Handles the mouse wheel event.
void EnsureVisible(HSTREEITEM hItem) OVERRIDE
Ensures an item is visible.
SXmlDoc m_xmlTemplate
Definition STreeView.h:640
void RedrawItem(SItemPanel *pItem)
Redraws an item.
SAutoRefPtr< ITvAdapter > m_adapter
Definition STreeView.h:625
void SetItemLocator(ITreeViewItemLocator *pItemLocator) OVERRIDE
Sets the item locator for the tree view.
void UpdateVisibleItems()
Updates the visible items.
ITvAdapter * GetAdapter() SCONST OVERRIDE
Gets the adapter for the tree view.
void OnMouseLeave()
Handles the mouse leave event.
STreeView()
Constructor for STreeView.
virtual void OnRebuildFont()
Rebuilds the font settings.
HRESULT OnAttrIndent(const SStringW &strValue, BOOL bLoading)
Handles the indentation attribute.
IItemPanel * HitTest(const POINT *pt) SCONST OVERRIDE
Performs a hit test on the tree view.
void OnLButtonDown(UINT nFlags, CPoint pt)
Handles the left mouse button down event.
virtual BOOL CreateChildren(SXmlNode xmlNode)
Creates child elements from XML node.
SOsrPanel * m_itemCapture
Definition STreeView.h:642
void onBranchInvalidated(HSTREEITEM hBranch, BOOL bInvalidParents, BOOL bInvalidChildren)
Notifies the tree view that a branch has been invalidated.
void OnSize(UINT nType, CSize size)
Handles the size event.
void onItemBeforeRemove(HSTREEITEM hItem)
Notifies the tree view that an item is about to be removed.
virtual UINT WINAPI OnGetDlgCode() const
Gets the dialog code for the tree view.
void OnPaint(IRenderTarget *pRT)
Handles the paint event.
BOOL OnItemDblClick(IEvtArgs *pEvt)
Handles the item double-click event.
SList< ItemInfo > m_visible_items
Definition STreeView.h:635
void DispatchMessage2Items(UINT uMsg, WPARAM wParam, LPARAM lParam)
Dispatches a message to items.
LRESULT OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles mouse events.
virtual void DrawLines(IRenderTarget *pRT, const CRect &rc, HSTREEITEM hItem)
Draws lines for an item.
int _GetItemOffset(HSTREEITEM hItem) const
Gets the offset of an item.
int GetItemIndent(HSTREEITEM hItem) SCONST OVERRIDE
Gets the indentation of an item.
void _SetItemOffset(HSTREEITEM hItem, int nOffset)
Sets the offset of an item.
void SetIndent(int nIndent) OVERRIDE
Sets the indentation between levels.
int GetScrollLineSize() SCONST OVERRIDE
Gets the scroll line size.
BOOL IsItemExpanded(HSTREEITEM hItem) const
Checks if an item is expanded.
HSTREEITEM _Position2Item(int position, HSTREEITEM hParent, int nParentPosition) const
Converts a position to an item handle.
Definition STreeView.cpp:95
int GetItemWidth(HSTREEITEM hItem) SCONST OVERRIDE
Gets the width of an item.
int _GetBranchWidth(HSTREEITEM hBranch) const
Gets the width of a branch.
void _UpdateSiblingsOffset(HSTREEITEM hItem)
Updates the offset of sibling items.
void OnBranchExpandedChanged(HSTREEITEM hItem, BOOL bExpandedOld, BOOL bExpandedNew) OVERRIDE
Notifies the locator that the expanded state of a branch has changed.
BOOL _IsItemVisible(HSTREEITEM hItem) const
Checks if an item is visible.
Definition STreeView.cpp:90
void _UpdateBranchHeight(HSTREEITEM hItem, int nDiff)
Updates the height of a branch.
int _GetItemVisibleWidth(HSTREEITEM hItem) const
Gets the visible width of an item.
void _SetBranchWidth(HSTREEITEM hBranch, int nWidth)
Sets the width of a branch.
int GetTotalWidth() SCONST OVERRIDE
Gets the total width of the tree view.
SAutoRefPtr< ITvAdapter > m_adapter
Definition STreeView.h:252
void SetAdapter(ITvAdapter *pAdapter) OVERRIDE
Sets the adapter for the tree view items.
Definition STreeView.cpp:50
HSTREEITEM Position2Item(int position) SCONST OVERRIDE
Converts a position to an item handle.
int GetTotalHeight() SCONST OVERRIDE
Gets the total height of the tree view.
void _SetItemHeight(HSTREEITEM hItem, int nHeight)
Sets the height of an item.
void SetItemHeight(HSTREEITEM hItem, int nHeight) OVERRIDE
Sets the height of an item.
void _InitBranch(HSTREEITEM hItem)
Initializes a branch.
Definition STreeView.cpp:55
int _GetBranchHeight(HSTREEITEM hItem) const
Gets the height of a branch.
int _GetItemVisibleHeight(HSTREEITEM hItem) const
Gets the visible height of an item.
void _SetItemWidth(HSTREEITEM hItem, int nWidth)
Sets the width of an item.
int GetIndent() SCONST OVERRIDE
Gets the indentation between levels.
int GetItemHeight(HSTREEITEM hItem) SCONST OVERRIDE
Gets the height of an item.
void SetItemWidth(HSTREEITEM hItem, int nWidth) OVERRIDE
Sets the width of an item.
int Item2Position(HSTREEITEM hItem) SCONST OVERRIDE
Converts an item handle to its position.
STreeViewItemLocator(int nIndent=16)
Constructor for STreeViewItemLocator.
Definition STreeView.cpp:39
void _SetBranchHeight(HSTREEITEM hItem, int nHeight)
Sets the height of a branch.
void _UpdateBranchWidth(HSTREEITEM hItem, int nOldWidth, int nNewWidth)
Updates the branch width data in the parent window.
void OnBranchChanged(HSTREEITEM hItem) OVERRIDE
Notifies the locator that a branch has changed.
Implementation of IXmlDoc.
Definition SXml.h:912
Class representing an XML node.
Definition SXml.h:352
Interface for rendering target objects.
Definition SRender-i.h:1440
Information for window tooltips.
Definition SWnd.h:208