Pyro higlevel API
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
os::TreeViewNode Class Referenceabstract

Baseclass for TreeView nodes. More...

Inheritance diagram for os::TreeViewNode:
os::ListViewRow os::TreeViewStringNode os::TreeViewCheckNode

Classes

class  Private
 

Public Member Functions

 TreeViewNode ()
 
virtual ~TreeViewNode ()
 
void AttachToView (View *pcView, int nColumn)=0
 
void SetRect (const Rect &cRect, int nColumn)=0
 
virtual float GetWidth (View *pcView, int nColumn)=0
 
virtual float GetHeight (View *pcView)=0
 
virtual void Paint (const Rect &cFrame, View *pcView, uint nColumn, bool bSelected, bool bHighlighted, bool bHasFocus)=0
 
virtual bool IsLessThan (const ListViewRow *pcOther, uint nColumn) const =0
 
virtual bool HitTest (View *pcView, const Rect &cFrame, int nColumn, Point cPos)
 
void SetIndent (uint nIndent)
 Set indentation depth. More...
 
uint GetIndent () const
 Get indentation depth. More...
 
void SetExpanded (bool bExpanded)
 Set expanded state. More...
 
bool IsExpanded () const
 Get expanded state. More...
 
TreeViewGetOwner () const
 Get owner. More...
 
bool IsLastSibling () const
 Check if node has more siblings. More...
 
- Public Member Functions inherited from os::ListViewRow
 ListViewRow ()
 
virtual ~ListViewRow ()
 
virtual void SetCookie (Variant cCookie)
 
virtual Variant GetCookie (void)
 
void SetIsSelectable (bool bSelectable)
 
bool IsSelectable () const
 
bool IsSelected () const
 
bool IsHighlighted () const
 
void SetIsVisible (bool bVisible)
 
bool IsVisible () const
 

Protected Member Functions

void _DrawExpanderCross (View *pcView, const Rect &cRect)
 Draw expander cross. More...
 
Rect _ExpanderCrossPos (const Rect &cFrame) const
 Get expander position. More...
 
void _SetOwner (TreeView *pcOwner)
 Set owner. More...
 
void _SetLinePositions (uint32 nLPos)
 Set line positions. More...
 
uint32 _GetLinePositions () const
 Get line positions. More...
 
void _SetLastSibling (bool bIsLast)
 Set LastSibling. More...
 

Friends

class TreeView
 

Detailed Description

Description:
See Also
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

Constructor & Destructor Documentation

TreeViewNode::TreeViewNode ( )
TreeViewNode::~TreeViewNode ( )
virtual

Member Function Documentation

void TreeViewNode::_DrawExpanderCross ( View pcView,
const Rect cRect 
)
protected
Rect TreeViewNode::_ExpanderCrossPos ( const Rect cFrame) const
protected
Description:
Returns a rect with dimensions and position for where the expander image should be drawn.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::GetExpanderImageBounds(), GetIndent(), GetOwner(), os::Rect::Height(), os::TreeViewNode::Private::m_pcOwner, and os::Rect::right.

Referenced by HitTest(), os::TreeViewCheckNode::Paint(), and os::TreeViewStringNode::Paint().

uint32 TreeViewNode::_GetLinePositions ( ) const
protected
void TreeViewNode::_SetLastSibling ( bool  bIsLast)
protected
Description:
Used by TreeView to keep the LastSibling attribute up to date. Should not be called elsewhere.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::Private::m_bLastSibling.

void TreeViewNode::_SetLinePositions ( uint32  nLPos)
protected
Description:
A 'one' in the line positions integer means that a tree trunk segment should be drawn at the corresponding indentation depth on the current row.
See Also
_GetLinePositions()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::Private::m_nLPos.

void TreeViewNode::_SetOwner ( TreeView pcOwner)
protected
Description:
This method is used by TreeView to tell nodes which TreeView they belong to. It is called automatically by TreeView::InsertNode(), so you should never need to use this method directly.
See Also
TreeView::InsertNode(), GetOwner()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::Private::m_pcOwner.

Referenced by os::TreeView::InsertNode().

void os::TreeViewNode::AttachToView ( View pcView,
int  nColumn 
)
pure virtual

Implements os::ListViewRow.

Implemented in os::TreeViewStringNode.

virtual float os::TreeViewNode::GetHeight ( View pcView)
pure virtual

Implements os::ListViewRow.

Implemented in os::TreeViewStringNode.

uint TreeViewNode::GetIndent ( ) const
TreeView * TreeViewNode::GetOwner ( ) const
Description:
Returns a pointer to the TreeView this node belongs to. Returns NULL if the node is not attached to a TreeView.
See Also
_SetOwner()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::Private::m_pcOwner.

Referenced by _ExpanderCrossPos(), os::TreeViewCheckNode::HitTest(), os::TreeViewCheckNode::Paint(), and os::TreeViewStringNode::Paint().

virtual float os::TreeViewNode::GetWidth ( View pcView,
int  nColumn 
)
pure virtual

Implements os::ListViewRow.

Implemented in os::TreeViewStringNode.

bool TreeViewNode::HitTest ( View pcView,
const Rect cFrame,
int  nColumn,
Point  cPos 
)
virtual
bool TreeViewNode::IsExpanded ( ) const
Description:
Returns true if the node is in expanded state (ie. sub nodes are displayed).
See Also
SetIndent()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::Private::m_bExpanded.

Referenced by _DrawExpanderCross(), HitTest(), os::TreeViewCheckNode::Paint(), and os::TreeViewStringNode::Paint().

bool TreeViewNode::IsLastSibling ( ) const
Description:
Check if there is a sibling following the current node. Used when rendering the "tree trunk", to know if it should continue to the next node or if it should be finished at this node.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::Private::m_bLastSibling.

Referenced by os::TreeViewCheckNode::Paint(), and os::TreeViewStringNode::Paint().

virtual bool os::TreeViewNode::IsLessThan ( const ListViewRow pcOther,
uint  nColumn 
) const
pure virtual

Implements os::ListViewRow.

Implemented in os::TreeViewStringNode.

virtual void os::TreeViewNode::Paint ( const Rect cFrame,
View pcView,
uint  nColumn,
bool  bSelected,
bool  bHighlighted,
bool  bHasFocus 
)
pure virtual
void TreeViewNode::SetExpanded ( bool  bExpanded)
Description:
Set expanded state of a node. Do not call this method directly, as it does not update sub nodes. Use TreeView::Expand() instead.
See Also
TreeView::Expand(), GetExpanded()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::Private::m_bExpanded.

Referenced by os::TreeView::Collapse(), and os::TreeView::Expand().

void TreeViewNode::SetIndent ( uint  nIndent)
Description:
Set indentation depth for a node. The hierarchical relations between nodes is decided by their indentation depths. A node with a higher indentation depth than the node before it, is considered a sub node.
Parameters
nIndentIndentation depth.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::Private::m_nIndent.

Referenced by InfoWin::InfoWin(), MountDialogScanner::Run(), and MountDialogScanner::ScanPath().

void os::TreeViewNode::SetRect ( const Rect cRect,
int  nColumn 
)
pure virtual

Implements os::ListViewRow.

Implemented in os::TreeViewStringNode.

Friends And Related Function Documentation

friend class TreeView
friend