soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
STreeViewItemLocator Class Reference

Class responsible for locating and managing tree view items. More...

#include <STreeView.h>

Inheritance diagram for STreeViewItemLocator:
TObjRefImpl< ITreeViewItemLocator >

Public Member Functions

 STreeViewItemLocator (int nIndent=16)
 Constructor for STreeViewItemLocator.
 
 ~STreeViewItemLocator ()
 Destructor for STreeViewItemLocator.
 
void SetAdapter (ITvAdapter *pAdapter) OVERRIDE
 Sets the adapter for the tree view items.
 
void OnBranchChanged (HSTREEITEM hItem) OVERRIDE
 Notifies the locator that a branch has changed.
 
void OnBranchExpandedChanged (HSTREEITEM hItem, BOOL bExpandedOld, BOOL bExpandedNew) OVERRIDE
 Notifies the locator that the expanded state of a branch has changed.
 
int GetTotalHeight () SCONST OVERRIDE
 Gets the total height of the tree view.
 
int GetTotalWidth () SCONST OVERRIDE
 Gets the total width of the tree view.
 
int Item2Position (HSTREEITEM hItem) SCONST OVERRIDE
 Converts an item handle to its position.
 
HSTREEITEM Position2Item (int position) SCONST OVERRIDE
 Converts a position to an item handle.
 
int GetScrollLineSize () SCONST OVERRIDE
 Gets the scroll line size.
 
void SetItemWidth (HSTREEITEM hItem, int nWidth) OVERRIDE
 Sets the width of an item.
 
int GetItemWidth (HSTREEITEM hItem) SCONST OVERRIDE
 Gets the width of an item.
 
void SetItemHeight (HSTREEITEM hItem, int nHeight) OVERRIDE
 Sets the height of an item.
 
int GetItemHeight (HSTREEITEM hItem) SCONST OVERRIDE
 Gets the height of an item.
 
int GetItemIndent (HSTREEITEM hItem) SCONST OVERRIDE
 Gets the indentation of an item.
 
int GetIndent () SCONST OVERRIDE
 Gets the indentation between levels.
 
void SetIndent (int nIndent) OVERRIDE
 Sets the indentation between levels.
 
- Public Member Functions inherited from TObjRefImpl< ITreeViewItemLocator >
 TObjRefImpl ()
 Constructor that initializes the reference count to 1.
 
virtual ~TObjRefImpl ()
 Virtual destructor.
 
long AddRef () override
 Increments the reference count.
 
long Release () override
 Decrements the reference count and deletes the object if the count reaches zero.
 
void OnFinalRelease () override
 Deletes the object.
 

Protected Member Functions

BOOL IsItemExpanded (HSTREEITEM hItem) const
 Checks if an item is expanded.
 
void _UpdateBranchWidth (HSTREEITEM hItem, int nOldWidth, int nNewWidth)
 Updates the branch width data in the parent window.
 
int _GetBranchWidth (HSTREEITEM hBranch) const
 Gets the width of a branch.
 
void _SetBranchWidth (HSTREEITEM hBranch, int nWidth)
 Sets the width of a branch.
 
void _SetItemWidth (HSTREEITEM hItem, int nWidth)
 Sets the width of an item.
 
int _GetBranchHeight (HSTREEITEM hItem) const
 Gets the height of a branch.
 
void _SetBranchHeight (HSTREEITEM hItem, int nHeight)
 Sets the height of a branch.
 
void _UpdateBranchHeight (HSTREEITEM hItem, int nDiff)
 Updates the height of a branch.
 
void _UpdateSiblingsOffset (HSTREEITEM hItem)
 Updates the offset of sibling items.
 
int _GetItemOffset (HSTREEITEM hItem) const
 Gets the offset of an item.
 
void _SetItemOffset (HSTREEITEM hItem, int nOffset)
 Sets the offset of an item.
 
void _SetItemHeight (HSTREEITEM hItem, int nHeight)
 Sets the height of an item.
 
int _GetItemVisibleHeight (HSTREEITEM hItem) const
 Gets the visible height of an item.
 
int _GetItemVisibleWidth (HSTREEITEM hItem) const
 Gets the visible width of an item.
 
HSTREEITEM _Position2Item (int position, HSTREEITEM hParent, int nParentPosition) const
 Converts a position to an item handle.
 
BOOL _IsItemVisible (HSTREEITEM hItem) const
 Checks if an item is visible.
 
void _InitBranch (HSTREEITEM hItem)
 Initializes a branch.
 

Protected Attributes

SAutoRefPtr< ITvAdapter > m_adapter
 
int m_nLineHeight
 
int m_nIndent
 
CSize m_szDef
 
- Protected Attributes inherited from TObjRefImpl< ITreeViewItemLocator >
LONG m_cRef
 Reference count.
 

Detailed Description

Class responsible for locating and managing tree view items.

Definition at line 17 of file STreeView.h.

Constructor & Destructor Documentation

◆ STreeViewItemLocator()

STreeViewItemLocator::STreeViewItemLocator ( int nIndent = 16)

Constructor for STreeViewItemLocator.

Parameters
nIndentIndentation between levels.

Definition at line 39 of file STreeView.cpp.

◆ ~STreeViewItemLocator()

STreeViewItemLocator::~STreeViewItemLocator ( )

Destructor for STreeViewItemLocator.

Definition at line 46 of file STreeView.cpp.

Member Function Documentation

◆ _GetBranchHeight()

int STreeViewItemLocator::_GetBranchHeight ( HSTREEITEM hItem) const
protected

Gets the height of a branch.

Parameters
hItemHandle to the item.
Returns
Height of the branch.

Definition at line 214 of file STreeView.cpp.

◆ _GetBranchWidth()

int STreeViewItemLocator::_GetBranchWidth ( HSTREEITEM hBranch) const
protected

Gets the width of a branch.

Parameters
hBranchHandle to the branch.
Returns
Width of the branch.

Definition at line 229 of file STreeView.cpp.

◆ _GetItemOffset()

int STreeViewItemLocator::_GetItemOffset ( HSTREEITEM hItem) const
protected

Gets the offset of an item.

Parameters
hItemHandle to the item.
Returns
Offset of the item.

Definition at line 173 of file STreeView.cpp.

◆ _GetItemVisibleHeight()

int STreeViewItemLocator::_GetItemVisibleHeight ( HSTREEITEM hItem) const
protected

Gets the visible height of an item.

Parameters
hItemHandle to the item.
Returns
Visible height of the item.

Definition at line 155 of file STreeView.cpp.

◆ _GetItemVisibleWidth()

int STreeViewItemLocator::_GetItemVisibleWidth ( HSTREEITEM hItem) const
protected

Gets the visible width of an item.

Parameters
hItemHandle to the item.
Returns
Visible width of the item.

Definition at line 145 of file STreeView.cpp.

◆ _InitBranch()

void STreeViewItemLocator::_InitBranch ( HSTREEITEM hItem)
protected

Initializes a branch.

Parameters
hItemHandle to the item.

Definition at line 55 of file STreeView.cpp.

◆ _IsItemVisible()

BOOL STreeViewItemLocator::_IsItemVisible ( HSTREEITEM hItem) const
protected

Checks if an item is visible.

Parameters
hItemHandle to the item.
Returns
TRUE if the item is visible, otherwise FALSE.

Definition at line 90 of file STreeView.cpp.

◆ _Position2Item()

HSTREEITEM STreeViewItemLocator::_Position2Item ( int position,
HSTREEITEM hParent,
int nParentPosition ) const
protected

Converts a position to an item handle.

Parameters
positionPosition in the tree view.
hParentHandle to the parent item.
nParentPositionPosition of the parent item.
Returns
Handle to the item.

Definition at line 95 of file STreeView.cpp.

◆ _SetBranchHeight()

void STreeViewItemLocator::_SetBranchHeight ( HSTREEITEM hItem,
int nHeight )
protected

Sets the height of a branch.

Parameters
hItemHandle to the item.
nHeightNew height of the branch.

Definition at line 209 of file STreeView.cpp.

◆ _SetBranchWidth()

void STreeViewItemLocator::_SetBranchWidth ( HSTREEITEM hBranch,
int nWidth )
protected

Sets the width of a branch.

Parameters
hBranchHandle to the branch.
nWidthNew width of the branch.

Definition at line 224 of file STreeView.cpp.

◆ _SetItemHeight()

void STreeViewItemLocator::_SetItemHeight ( HSTREEITEM hItem,
int nHeight )
protected

Sets the height of an item.

Parameters
hItemHandle to the item.
nHeightNew height of the item.

Definition at line 163 of file STreeView.cpp.

◆ _SetItemOffset()

void STreeViewItemLocator::_SetItemOffset ( HSTREEITEM hItem,
int nOffset )
protected

Sets the offset of an item.

Parameters
hItemHandle to the item.
nOffsetNew offset of the item.

Definition at line 168 of file STreeView.cpp.

◆ _SetItemWidth()

void STreeViewItemLocator::_SetItemWidth ( HSTREEITEM hItem,
int nWidth )
protected

Sets the width of an item.

Parameters
hItemHandle to the item.
nWidthNew width of the item.

Definition at line 219 of file STreeView.cpp.

◆ _UpdateBranchHeight()

void STreeViewItemLocator::_UpdateBranchHeight ( HSTREEITEM hItem,
int nDiff )
protected

Updates the height of a branch.

Parameters
hItemHandle to the item.
nDiffDifference in height.

Definition at line 198 of file STreeView.cpp.

◆ _UpdateBranchWidth()

void STreeViewItemLocator::_UpdateBranchWidth ( HSTREEITEM hItem,
int nOldWidth,
int nNewWidth )
protected

Updates the branch width data in the parent window.

Parameters
hItemHandle to the item.
nOldWidthOld width of the branch.
nNewWidthNew width of the branch.

Definition at line 234 of file STreeView.cpp.

◆ _UpdateSiblingsOffset()

void STreeViewItemLocator::_UpdateSiblingsOffset ( HSTREEITEM hItem)
protected

Updates the offset of sibling items.

Parameters
hItemHandle to the item.

Definition at line 178 of file STreeView.cpp.

◆ GetIndent()

int STreeViewItemLocator::GetIndent ( )

Gets the indentation between levels.

Returns
Indentation between levels.

Definition at line 293 of file STreeView.cpp.

◆ GetItemHeight()

int STreeViewItemLocator::GetItemHeight ( HSTREEITEM hItem)

Gets the height of an item.

Parameters
hItemHandle to the item.
Returns
Height of the item.

Definition at line 303 of file STreeView.cpp.

◆ GetItemIndent()

int STreeViewItemLocator::GetItemIndent ( HSTREEITEM hItem)

Gets the indentation of an item.

Parameters
hItemHandle to the item.
Returns
Indentation of the item.

Definition at line 280 of file STreeView.cpp.

◆ GetItemWidth()

int STreeViewItemLocator::GetItemWidth ( HSTREEITEM hItem)

Gets the width of an item.

Parameters
hItemHandle to the item.
Returns
Width of the item.

Definition at line 308 of file STreeView.cpp.

◆ GetScrollLineSize()

int STreeViewItemLocator::GetScrollLineSize ( )

Gets the scroll line size.

Returns
Scroll line size.

Definition at line 365 of file STreeView.cpp.

◆ GetTotalHeight()

int STreeViewItemLocator::GetTotalHeight ( )

Gets the total height of the tree view.

Returns
Total height.

Definition at line 375 of file STreeView.cpp.

◆ GetTotalWidth()

int STreeViewItemLocator::GetTotalWidth ( )

Gets the total width of the tree view.

Returns
Total width.

Definition at line 370 of file STreeView.cpp.

◆ IsItemExpanded()

BOOL STreeViewItemLocator::IsItemExpanded ( HSTREEITEM hItem) const
protected

Checks if an item is expanded.

Parameters
hItemHandle to the item.
Returns
TRUE if the item is expanded, otherwise FALSE.

Definition at line 275 of file STreeView.cpp.

◆ Item2Position()

int STreeViewItemLocator::Item2Position ( HSTREEITEM hItem)

Converts an item handle to its position.

Parameters
hItemHandle to the item.
Returns
Position of the item.

Definition at line 342 of file STreeView.cpp.

◆ OnBranchChanged()

void STreeViewItemLocator::OnBranchChanged ( HSTREEITEM hItem)

Notifies the locator that a branch has changed.

Parameters
hItemHandle to the branch item.

Definition at line 400 of file STreeView.cpp.

◆ OnBranchExpandedChanged()

void STreeViewItemLocator::OnBranchExpandedChanged ( HSTREEITEM hItem,
BOOL bExpandedOld,
BOOL bExpandedNew )

Notifies the locator that the expanded state of a branch has changed.

Parameters
hItemHandle to the branch item.
bExpandedOldOld expanded state.
bExpandedNewNew expanded state.

Definition at line 380 of file STreeView.cpp.

◆ Position2Item()

HSTREEITEM STreeViewItemLocator::Position2Item ( int position)

Converts a position to an item handle.

Parameters
positionPosition in the tree view.
Returns
Handle to the item.

Definition at line 337 of file STreeView.cpp.

◆ SetAdapter()

void STreeViewItemLocator::SetAdapter ( ITvAdapter * pAdapter)

Sets the adapter for the tree view items.

Parameters
pAdapterPointer to the adapter.

Definition at line 50 of file STreeView.cpp.

◆ SetIndent()

void STreeViewItemLocator::SetIndent ( int nIndent)

Sets the indentation between levels.

Parameters
nIndentNew indentation value.

Definition at line 298 of file STreeView.cpp.

◆ SetItemHeight()

void STreeViewItemLocator::SetItemHeight ( HSTREEITEM hItem,
int nHeight )

Sets the height of an item.

Parameters
hItemHandle to the item.
nHeightNew height of the item.

Definition at line 313 of file STreeView.cpp.

◆ SetItemWidth()

void STreeViewItemLocator::SetItemWidth ( HSTREEITEM hItem,
int nWidth )

Sets the width of an item.

Parameters
hItemHandle to the item.
nWidthNew width of the item.

Definition at line 324 of file STreeView.cpp.

Member Data Documentation

◆ m_adapter

SAutoRefPtr<ITvAdapter> STreeViewItemLocator::m_adapter
protected

Adapter for the tree view items.

Definition at line 252 of file STreeView.h.

◆ m_nIndent

int STreeViewItemLocator::m_nIndent
protected

Indentation between levels.

Definition at line 254 of file STreeView.h.

◆ m_nLineHeight

int STreeViewItemLocator::m_nLineHeight
protected

Line height.

Definition at line 253 of file STreeView.h.

◆ m_szDef

CSize STreeViewItemLocator::m_szDef
protected

Default size.

Definition at line 255 of file STreeView.h.


The documentation for this class was generated from the following files: