Pyro higlevel API
Classes | Public Member Functions | List of all members
os::TreeView Class Reference

Flexible multicolumn tree view. More...

Inheritance diagram for os::TreeView:
os::ListView os::Control os::View os::Invoker os::Handler

Classes

class  Private
 

Public Member Functions

 TreeView (const Rect &cFrame, const String &cTitle, uint32 nModeFlags=F_MULTI_SELECT|F_RENDER_BORDER, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_FULL_UPDATE_ON_RESIZE)
 
 ~TreeView ()
 
void InsertNode (TreeViewNode *pcNode, bool bUpdate=true)
 Insert a node at the end. More...
 
void InsertNode (int nPos, TreeViewNode *pcNode, bool bUpdate=true)
 Insert a node at a certain position. More...
 
TreeViewNodeRemoveNode (int nIndex, bool bUpdate=true)
 Remove a node. More...
 
ListViewRowRemoveRow (int nIndex, bool bUpdate=true)
 
void Clear ()
 
void Expand (TreeViewNode *pcNode)
 Expand a node. More...
 
void Collapse (TreeViewNode *pcNode)
 Collapse a node. More...
 
bool HasChildren (TreeViewNode *pcRow)
 Find out if a node has sub nodes. More...
 
TreeViewNodeGetParent (TreeViewNode *pcNode=NULL)
 Get parent node. More...
 
TreeViewNodeGetChild (TreeViewNode *pcNode=NULL)
 Get child node. More...
 
TreeViewNodeGetNext (TreeViewNode *pcNode=NULL)
 Get next sibling. More...
 
TreeViewNodeGetPrev (TreeViewNode *pcNode=NULL)
 Get previous sibling. More...
 
void GetChildren (std::vector< TreeViewNode * > &cvecChildren, TreeViewNode *pcNode=NULL)
 Get subnodes. More...
 
void GetSiblings (std::vector< TreeViewNode * > &cvecSiblings, TreeViewNode *pcNode=NULL)
 Get sibling nodes. More...
 
void SetExpandedMessage (Message *pcMsg)
 Set expand/collapse message. More...
 
MessageGetExpandedMessage () const
 Set expand/collapse message. More...
 
void SetExpandedImage (Image *pcImage)
 Set expander image when expanded. More...
 
void SetCollapsedImage (Image *pcImage)
 Set expander image when collapsed. More...
 
ImageGetExpandedImage () const
 Get expander image when expanded. More...
 
ImageGetCollapsedImage () const
 Get expander image when expanded. More...
 
bool GetDrawExpanderBox () const
 Draw box around expander image. More...
 
void SetDrawExpanderBox (const bool bDraw)
 Draw box around expander image. More...
 
uint GetIndentWidth () const
 Get indentation width. More...
 
void SetIndentWidth (uint nIndentWidth)
 Set indentation width. More...
 
bool GetDrawTrunk () const
 Draw tree trunk. More...
 
void SetDrawTrunk (bool bDraw)
 Draw tree trunk. More...
 
const RectGetExpanderImageBounds () const
 Get max size of expander image. More...
 
virtual void SortRows (std::vector< ListViewRow * > *pcRows, int nColumn)
 Sort rows. More...
 
virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view. More...
 
- Public Member Functions inherited from os::ListView
 ListView (const Rect &cFrame, const String &cTitle, uint32 nModeFlags=F_MULTI_SELECT|F_RENDER_BORDER, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_FULL_UPDATE_ON_RESIZE)
 
 ~ListView ()
 
virtual void LabelChanged (const String &cNewLabel)
 
virtual void EnableStatusChanged (bool bIsEnabled)
 
virtual bool Invoked (Message *pcMessage)
 Intercept outgoing messages. More...
 
virtual void Invoked (int nFirstRow, int nLastRow)
 
virtual void SelectionChanged (int nFirstRow, int nLastRow)
 
virtual bool DragSelection (const Point &cPos)
 
void StartScroll (scroll_direction eDirection, bool bSelect)
 
void StopScroll ()
 
bool IsMultiSelect () const
 
void SetMultiSelect (bool bMulti)
 
bool IsAutoSort () const
 
void SetAutoSort (bool bAuto)
 
bool HasBorder () const
 
void SetRenderBorder (bool bRender)
 
bool HasColumnHeader () const
 
void SetHasColumnHeader (bool bFlag)
 Turn column header on or off. More...
 
void MakeVisible (int nRow, bool bCenter=true)
 Make row visible. More...
 
int InsertColumn (const char *pzTitle, int nWidth, int nPos=-1)
 
const column_mapGetColumnMapping () const
 
void SetColumnMapping (const column_map &cMap)
 
void InsertRow (int nPos, ListViewRow *pcRow, bool bUpdate=true)
 Insert a row. More...
 
void InsertRow (ListViewRow *pcRow, bool bUpdate=true)
 Insert a row. More...
 
ListViewRowRemoveRow (int nIndex, bool bUpdate=true)
 Remove a row. More...
 
void InvalidateRow (int nRow, uint32 nFlags)
 Refresh row. More...
 
uint GetRowCount () const
 Get row count. More...
 
ListViewRowGetRow (const Point &cPos) const
 Find row at a certain position. More...
 
ListViewRowGetRow (uint nIndex) const
 Get a row. More...
 
int HitTest (const Point &cPos) const
 Find row at a certain position. More...
 
float GetRowPos (int nRow)
 Get row vertical position. More...
 
void Clear ()
 Clear list. More...
 
bool IsSelected (uint nRow) const
 Check if a row is selected. More...
 
void Select (int nFirst, int nLast, bool bReplace=true, bool bSelect=true)
 
void Select (int nRow, bool bReplace=true, bool bSelect=true)
 
void ClearSelection ()
 
void Highlight (int nFirst, int nLast, bool bReplace, bool bHighlight=true)
 
void Highlight (int nRow, bool bReplace, bool bHighlight=true)
 
void SetCurrentRow (int nRow)
 
void Sort ()
 Sort rows. More...
 
int GetFirstSelected () const
 Get first selected row. More...
 
int GetLastSelected () const
 
void SetSelChangeMsg (Message *pcMsg)
 
void SetInvokeMsg (Message *pcMsg)
 
MessageGetSelChangeMsg () const
 
MessageGetInvokeMsg () const
 
virtual void FrameSized (const Point &cDelta)
 Virtual hook called by the system when the view is resized. More...
 
virtual void KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers)
 Hook called by the system when a key is pressed while the view has focus. More...
 
virtual void AllAttached ()
 
virtual bool HasFocus (void) const
 
virtual void MouseDown (const Point &, uint32)
 Hook called by the system when a mouse button is pressed. More...
 
virtual void MouseUp (const Point &cPosition, uint32 nButton, Message *pcData)
 Hook called by the system when a mouse button is release. More...
 
virtual void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved. More...
 
const_iterator begin () const
 STL iterator interface. More...
 
const_iterator end () const
 STL iterator interface. More...
 
void RefreshLayout ()
 Refresh layout. More...
 
- Public Member Functions inherited from os::Control
 Control (const Rect &cFrame, const String &cName, const String &cLabel, Message *pcMessage, uint32 nResizeMask, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND)
 
 ~Control ()
 
virtual void AttachedToWindow (void)
 
virtual void DetachedFromWindow (void)
 
virtual bool PreValueChange (Variant *pcNewValue)
 
virtual void PostValueChange (const Variant &cNewValue)
 
virtual void SetEnable (bool bEnabled)
 
virtual bool IsEnabled (void) const
 
virtual void SetLabel (const String &cLabel)
 
virtual String GetLabel (void) const
 
virtual void SetValue (Variant cValue, bool bInvoke=true)
 
virtual Variant GetValue () const
 
virtual void __CTRL_reserved1__ ()
 
virtual void __CTRL_reserved2__ ()
 
virtual void __CTRL_reserved3__ ()
 
virtual void __CTRL_reserved4__ ()
 
virtual void __CTRL_reserved5__ ()
 
- Public Member Functions inherited from os::View
 View (const Rect &cFrame, const String &cTitle, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND)
 View constructor. More...
 
virtual ~View ()
 View destructor. More...
 
virtual void AllDetached ()
 
virtual void Activated (bool bIsActive)
 Hook called when the view gain or loose focus. More...
 
virtual void WindowActivated (bool bIsActive)
 Hook called when the window hosting this view gain or loose focus. More...
 
virtual void KeyUp (const char *pzString, const char *pzRawString, uint32 nQualifiers)
 Hook called by the system when a key is released while the view has focus. More...
 
virtual void FrameMoved (const Point &cDelta)
 Virtual hook called by the system when the view is moved within it's parent. More...
 
virtual void ViewScrolled (const Point &cDelta)
 Virtual hook called by the system when the view content is scrolled. More...
 
virtual void FontChanged (Font *pcNewFont)
 Called to notify the view that the font has changed. More...
 
virtual Point GetPreferredSize (bool bLargest) const
 
virtual Point GetContentSize () const
 
virtual void WheelMoved (const Point &cDelta)
 Hook called by the system when the scroll-wheel is rotated. More...
 
virtual void AddChild (View *pcView, bool bAssignTabOrder=false)
 
void RemoveChild (View *pcChild)
 
void RemoveThis ()
 
ViewGetChildAt (const Point &cPos) const
 
ViewGetChildAt (int nIndex) const
 
ViewGetParent () const
 
ScrollBarGetVScrollBar () const
 
ScrollBarGetHScrollBar () const
 
WindowGetWindow () const
 
String GetTitle () const
 
virtual int GetTabOrder () const
 Get the keybord manouvering order. More...
 
virtual void SetTabOrder (int nOrder=NEXT_TAB_ORDER)
 Set the keyboard manouvering sorting order. More...
 
virtual const ShortcutKeyGetShortcut () const
 
virtual void SetShortcut (const ShortcutKey &cShortcut)
 Set keyboard shortcut. More...
 
virtual void SetShortcutFromLabel (const String &cLabel)
 Set keyboard shortcut from Label. More...
 
void SetContextMenu (Menu *pcMenu)
 Set popup menu for a View. More...
 
MenuGetContextMenu () const
 Get popup menu. More...
 
uint32 GetQualifiers () const
 
void GetMouse (Point *pcPosition, uint32 *pnButtons) const
 
void SetMousePos (const Point &cPosition)
 
void BeginDrag (Message *pcData, const Point &cOffset, const Bitmap *pcBitmap, Handler *pcReplyTarget=NULL)
 Start a drag and drop operation. More...
 
void BeginDrag (Message *pcData, const Point &cOffset, const Rect &cBounds, Handler *pcReplyTarget=NULL)
 Start a drag and drop operation. More...
 
void SetFlags (uint32 nFlags)
 
uint32 GetFlags (uint32 nMask=~0L) const
 
void SetResizeMask (uint32 nFlags)
 
uint32 GetResizeMask () const
 
void Show (bool bVisible=true)
 Show/hide a view and all it's children. More...
 
void Hide ()
 
bool IsVisible () const
 
virtual void MakeFocus (bool bFocus=true)
 
Rect GetFrame () const
 
Rect GetBounds () const
 
Rect GetNormalizedBounds () const
 
float Width () const
 
float Height () const
 
Point GetLeftTop () const
 
virtual void SetFrame (const Rect &cRect, bool bNotifyServer=true)
 Set the size and position relative to the parent view. More...
 
virtual void MoveBy (const Point &cDelta)
 Move the view within the parent coordinate system. More...
 
virtual void MoveBy (float vDeltaX, float vDeltaY)
 
virtual void MoveTo (const Point &cPos)
 Set the views position within the parent coordinate system. More...
 
virtual void MoveTo (float x, float y)
 
virtual void ResizeBy (const Point &cDelta)
 
virtual void ResizeBy (float vDeltaW, float vDeltaH)
 
virtual void ResizeTo (const Point &cSize)
 Set a new absolute size for the view. More...
 
virtual void ResizeTo (float W, float H)
 Set a new absolute size for the view. More...
 
void SetDrawingRegion (const Region &cReg)
 Restrict rendering using a clipping region. More...
 
void ClearDrawingRegion ()
 Remove any previously assigned drawing region. More...
 
void SetShapeRegion (const Region &cReg)
 Define a non-square shape for the view. More...
 
void ClearShapeRegion ()
 Remove any previously assigned shape region. More...
 
virtual int ToggleDepth ()
 
Point ConvertFromParent (const Point &cPoint) const
 
void ConvertFromParent (Point *cPoint) const
 
Rect ConvertFromParent (const Rect &cRect) const
 
void ConvertFromParent (Rect *cRect) const
 
Point ConvertToWindow (const Point &cPoint) const
 
void ConvertToWindow (Point *cPoint) const
 
Rect ConvertToWindow (const Rect &cRect) const
 
void ConvertToWindow (Rect *cRect) const
 
Point ConvertFromWindow (const Point &cPoint) const
 
void ConvertFromWindow (Point *cPoint) const
 
Rect ConvertFromWindow (const Rect &cRect) const
 
void ConvertFromWindow (Rect *cRect) const
 
Point ConvertToScreen (const Point &cPoint) const
 
void ConvertToScreen (Point *cPoint) const
 
Rect ConvertToScreen (const Rect &cRect) const
 
void ConvertToScreen (Rect *cRect) const
 
Point ConvertFromScreen (const Point &cPoint) const
 
void ConvertFromScreen (Point *cPoint) const
 
Rect ConvertFromScreen (const Rect &cRect) const
 
void ConvertFromScreen (Rect *cRect) const
 
void Invalidate (const Rect &cRect, bool bRecurse=false)
 Add a rectangle to the damage list. More...
 
void Invalidate (bool bRecurse=false)
 Invalidate the whole view. More...
 
void Flush ()
 Flush the render queue. More...
 
void Sync ()
 Flush the render queue. More...
 
void SetDrawingMode (drawing_mode nMode)
 
drawing_mode GetDrawingMode () const
 
void SetFont (Font *pcFont)
 Change the views text font. More...
 
FontGetFont () const
 
void SetFgColor (int nRed, int nGreen, int nBlue, int nAlpha=255)
 
void SetFgColor (Color32_s sColor)
 
Color32_s GetFgColor () const
 
void SetBgColor (int nRed, int nGreen, int nBlue, int nAlpha=255)
 
void SetBgColor (Color32_s sColor)
 
Color32_s GetBgColor () const
 
void SetEraseColor (int nRed, int nGreen, int nBlue, int nAlpha=255)
 
void SetEraseColor (Color32_s sColor)
 
Color32_s GetEraseColor () const
 
void MovePenTo (const Point &cPos)
 
void MovePenTo (float x, float y)
 
void MovePenBy (const Point &cPos)
 
void MovePenBy (float x, float y)
 
Point GetPenPosition () const
 Get the current pen position. More...
 
void DrawLine (const Point &cToPoint)
 
void DrawLine (const Point &cFromPnt, const Point &cToPnt)
 
virtual void ScrollBy (const Point &cDelta)
 
virtual void ScrollBy (float vDeltaX, float vDeltaY)
 
virtual void ScrollTo (Point cTopLeft)
 
virtual void ScrollTo (float x, float y)
 
Point GetScrollOffset () const
 
void ScrollRect (const Rect &cSrcRect, const Rect &cDstRect)
 Copy a rectangle from one location to another within the view. More...
 
void FillRect (const Rect &cRect)
 
void FillRect (const Rect &cRect, Color32_s sColor)
 
void DrawBitmap (const Bitmap *pcBitmap, const Rect &cSrcRect, const Rect &cDstRect)
 Render a bitmap into the view. More...
 
void EraseRect (const Rect &cRect)
 
void DrawFrame (const Rect &cRect, uint32 nFlags)
 
void DrawRoundedFrame (const os::Rect &cReizeFrame=os::Rect(1, 4,-1,-4), const os::Color32_s &cColor=get_default_color(COL_SHADOW))
 
void DrawRoundedFrame (const os::Rect &cFrame, const os::Rect &cReizeFrame=os::Rect(1, 4,-1,-4), const os::Color32_s &cColor=get_default_color(COL_SHADOW))
 
void DrawString (const Point &cPos, const String &cString)
 
void DrawString (const String &cString)
 Render a text-string at the current pen position. More...
 
void DrawString (const char *pzStr, int Len=-1)
 
void DrawText (const Rect &cPos, const String &cString, uint32 nFlags=0)
 Render a text-string in a specified rectangle. More...
 
void DrawSelectedText (const Rect &cPos, const String &cString, const IPoint &cSel1, const IPoint &cSel2, uint32 nMode=SEL_CHAR, uint32 nFlags=0)
 
void GetSelection (const String &cClipboard="__system_clipboard__")
 
void GetTruncatedStrings (const char **pazStringArray, int nStringCount, uint32 nMode, float nWidth, char **pazResultArray) const
 
float GetStringWidth (const String &cString) const
 
float GetStringWidth (const char *pzString, int nLen=-1) const
 
void GetStringWidths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float *avWidthArray) const
 
Point GetTextExtent (const String &cString, uint32 nFlags=0, int nTargetWidth=-1) const
 
int GetStringLength (const String &cString, float vWidth, bool bIncludeLast=false) const
 
int GetStringLength (const char *pzString, int nLen, float vWidth, bool bIncludeLast=false) const
 
void GetStringLengths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float vWidth, int *anMaxLengthArray, bool bIncludeLast=false) const
 
void GetFontHeight (font_height *psHeight) const
 
void Ping (int nSize=0) const
 
void SetToolTip (const os::String &t)
 
os::String GetToolTip () const
 
Point ConvertToParent (const Point &cPoint) const
 Translate a os::Point into our parents coordinate system. More...
 
void ConvertToParent (Point *cPoint) const
 Translate a os::Point into our parents coordinate system. More...
 
Rect ConvertToParent (const Rect &cRect) const
 
void ConvertToParent (Rect *cRect) const
 
- Public Member Functions inherited from os::Handler
 Handler (const String &cName)
 Construct a handler. More...
 
virtual ~Handler ()
 Destructor. More...
 
virtual void TimerTick (int nID)
 Timer dispatch member. More...
 
virtual void HandleMessage (Message *pcMessage)
 Handle a message targeted at this handler. More...
 
String GetName () const
 Get the handlers name. More...
 
void SetName (const String &cName)
 Rename the handler. More...
 
LooperGetLooper () const
 Get a pointer to the looper this handler belongs to. More...
 
void SetNextHandler (Handler *pcNextHandler)
 Set a handler that should handle messages this handler is not interrested in. More...
 
HandlerGetNextHandler () const
 Get the next handler in a handler chain. More...
 
void AddFilter (MessageFilter *pcFilter)
 
void RemoveFilter (MessageFilter *pcFilter)
 
const MsgFilterListGetFilterList () const
 
const uint32 GetToken ()
 Get the handlers token. More...
 
- Public Member Functions inherited from os::Invoker
 Invoker ()
 Default constructor. More...
 
 Invoker (Message *pcMessage)
 Constructor. More...
 
 Invoker (Message *pcMessage, const Handler *pcHandler, const Looper *pcLooper=NULL)
 Constructor. More...
 
 Invoker (Message *pcMessage, const Messenger &cTarget)
 Constructor. More...
 
virtual ~Invoker ()
 Destructor. More...
 
virtual status_t SetMessage (Message *pcMessage)
 Assign a new message to the invoker. More...
 
MessageGetMessage () const
 Get the message currently assigned to the invoker. More...
 
uint32 GetCode () const
 Get the code field from the currently assigned message. More...
 
virtual void TargetChanged (const Messenger &cOldTarget)
 Virtual hook called by the system after the target has been changed. More...
 
virtual void MessageChanged (const Message &cOldMsg)
 Virtual hook called by the system after the message has been changed. More...
 
virtual status_t SetTarget (const Handler *pcHandler, const Looper *pcLooper=NULL)
 Set a new message target. More...
 
virtual status_t SetTarget (const Messenger &cMessenger)
 Set a new message target. More...
 
bool IsTargetLocal () const
 Check if the target lives in our process. More...
 
HandlerGetTarget (Looper **ppcLooper=NULL) const
 Get the current target. More...
 
Messenger GetMessenger () const
 Get the messenger used to target messages sendt by the invoker. More...
 
virtual status_t SetHandlerForReply (Handler *pcHandler)
 Set a reply target for messages sendt by this messenger. More...
 
HandlerGetHandlerForReply () const
 Get the current reply target for replies on messages sendt by the invoker. More...
 
virtual status_t Invoke (Message *pcMessage=NULL)
 Send the current message to the current target. More...
 

Additional Inherited Members

- Public Types inherited from os::ListView
enum  scroll_direction {
  SCROLL_UP,
  SCROLL_DOWN
}
 
enum  { AUTOSCROLL_BORDER = 20 }
 
enum  {
  F_MULTI_SELECT = 0x0001,
  F_NO_AUTO_SORT = 0x0002,
  F_RENDER_BORDER = 0x0004,
  F_DONT_SCROLL = 0x0008,
  F_NO_HEADER = 0x0010,
  F_NO_COL_REMAP = 0x0020,
  F_NO_SORT = 0x0040
}
 
enum  {
  INV_HEIGHT = 0x01,
  INV_WIDTH = 0x02,
  INV_VISUAL = 0x04
}
 
typedef std::vector
< ListViewRow * >
::const_iterator 
const_iterator
 
typedef std::vector< int > column_map
 

Detailed Description

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

Constructor & Destructor Documentation

TreeView::TreeView ( const Rect cFrame,
const String cTitle,
uint32  nModeFlags = F_MULTI_SELECT | F_RENDER_BORDER,
uint32  nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP,
uint32  nFlags = WID_WILL_DRAW | WID_FULL_UPDATE_ON_RESIZE 
)
TreeView::~TreeView ( )

Member Function Documentation

void TreeView::Clear ( void  )
void TreeView::Collapse ( TreeViewNode pcNode)
void TreeView::Expand ( TreeViewNode pcNode)
TreeViewNode * TreeView::GetChild ( TreeViewNode pcNode = NULL)
Description:
Returns a pointer to the child node (sub node) of pcNode, or the child node of the currently selected node, if pcNode is NULL.
Parameters
pcNodePointer to node.
See Also
GetParent(), GetNext(), GetPrev(), ListView::GetRow()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::GetIndent(), os::ListView::GetLastSelected(), and os::ListView::GetRow().

void TreeView::GetChildren ( std::vector< TreeViewNode * > &  cvecChildren,
TreeViewNode pcNode = NULL 
)
Description:
Fills a std::vector with the sub nodes (children) of a supplied node that is attached to this TreeView, or the currently selected node if pcNode is NULL.
Parameters
cvecChildrenstd::vector to be filled with pointers to nodes.
pcNodePointer to node to examine or NULL for selected node.
See Also
GetSiblings()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::ListView::begin(), os::TreeViewNode::GetIndent(), os::ListView::GetLastSelected(), os::ListView::GetRow(), and os::ListView::GetRowCount().

Referenced by GetSiblings(), and os::TreeViewCheckNode::Toggle().

Image * TreeView::GetCollapsedImage ( ) const
Description:
Returns the image used for expander icons in collapsed state.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_pcCollapsedImage.

Referenced by os::TreeViewNode::_DrawExpanderCross().

bool TreeView::GetDrawExpanderBox ( ) const
Description:
Returns true if a box is drawn around the expander image.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_bDrawBox.

Referenced by os::TreeViewNode::_DrawExpanderCross().

bool TreeView::GetDrawTrunk ( ) const
Description:
Returns true if lines are drawn to each node (aka. tree trunk).
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_bDrawTrunk.

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

Image * TreeView::GetExpandedImage ( ) const
Description:
Returns the image used for expander icons in expanded state.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_pcExpandedImage.

Referenced by os::TreeViewNode::_DrawExpanderCross().

Message * TreeView::GetExpandedMessage ( ) const
Description:
Get expanded/collapsed message.
See Also
SetExpandedMessage()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_pcExpandMsg.

const Rect & TreeView::GetExpanderImageBounds ( ) const
Description:
Returns a Rect with the maximum dimensions for the expander icon. Normally there is no reason to call this method directly, it is used by the TreeViewNodes to calculate what their sizes will be.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_cExpImgBounds.

Referenced by os::TreeViewNode::_ExpanderCrossPos().

uint TreeView::GetIndentWidth ( ) const
Description:
Returns the size of indentations. Default is 10 pixels.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_nIndentWidth.

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

TreeViewNode * TreeView::GetNext ( TreeViewNode pcNode = NULL)
Description:
Returns a pointer to the next sibling of pcNode, or the sibling of the currently selected node, if pcNode is NULL.
Parameters
pcNodePointer to node.
See Also
GetChild(), GetPrev(), GetParent(), ListView::GetRow()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::ListView::begin(), os::TreeViewNode::GetIndent(), os::ListView::GetLastSelected(), os::ListView::GetRow(), and os::ListView::GetRowCount().

TreeViewNode * TreeView::GetParent ( TreeViewNode pcNode = NULL)
Description:
Returns a pointer to the parent node of pcNode, or the parent of the currently selected node, if pcNode is NULL.
Parameters
pcNodePointer to node.
See Also
GetChild(), GetNext(), GetPrev(), ListView::GetRow()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::ListView::begin(), os::TreeViewNode::GetIndent(), os::ListView::GetLastSelected(), os::ListView::GetRow(), and os::ListView::GetRowCount().

TreeViewNode * TreeView::GetPrev ( TreeViewNode pcNode = NULL)
Description:
Returns a pointer to the previous sibling of pcNode, or the sibling of the currently selected node, if pcNode is NULL.
Parameters
pcNodePointer to node.
See Also
GetChild(), GetNext(), GetParent(), ListView::GetRow()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::ListView::begin(), os::TreeViewNode::GetIndent(), os::ListView::GetLastSelected(), os::ListView::GetRow(), and os::ListView::GetRowCount().

void TreeView::GetSiblings ( std::vector< TreeViewNode * > &  cvecSiblings,
TreeViewNode pcNode = NULL 
)
Description:
Fills a std::vector with the siblings of a supplied node that is attached to this TreeView, or the currently selected node if pcNode is NULL.
Parameters
cvecSiblingstd::vector to be filled with pointers to nodes.
pcNodePointer to node to examine or NULL for selected node.
See Also
GetChildren()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References GetChildren(), and os::View::GetParent().

bool TreeView::HasChildren ( TreeViewNode pcNode)
Description:
Returns true if a node has at least one child node.
Parameters
pcNodePointer to node.
See Also
GetChild
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::ListView::begin(), os::TreeViewNode::GetIndent(), os::ListView::GetRow(), and os::ListView::GetRowCount().

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

void TreeView::InsertNode ( TreeViewNode pcNode,
bool  bUpdate = true 
)
Description:
Insert a node at the end of the tree.
Parameters
nPosZero-based index to insert position.
pcNodePointer to node to insert.
bUpdateSet to true to refresh TreeView.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::_SetOwner(), os::ListView::InsertRow(), and os::TreeView::Private::m_bTrunkValid.

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

void TreeView::InsertNode ( int  nPos,
TreeViewNode pcNode,
bool  bUpdate = true 
)
Description:
Insert a node at position nPos.
Parameters
nPosZero-based index to insert position.
pcNodePointer to node to insert.
bUpdateSet to true to refresh TreeView.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeViewNode::_SetOwner(), os::ListView::InsertRow(), and os::TreeView::Private::m_bTrunkValid.

void TreeView::Paint ( const Rect cUpdateRect)
virtual
Description:
Note:
Warning:
Parameters
cUpdateRectA rectangle enclosing all damaged areas. This is just a rough "worst-case", further fine-grained clipping will be performed by the Application Server to avoid updating non-damaged pixels and make the update as fast and flicker-free as possible.
See Also
Invalidate(), Flush()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::ListView.

References os::TreeView::Private::m_bDrawTrunk, os::TreeView::Private::m_bTrunkValid, and os::ListView::Paint().

TreeViewNode * TreeView::RemoveNode ( int  nIndex,
bool  bUpdate = true 
)
Description:
Does exactly the same thing as RemoveRow().
See Also
ListView::RemoveRow()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_bTrunkValid, and RemoveRow().

ListViewRow * TreeView::RemoveRow ( int  nIndex,
bool  bUpdate = true 
)
void TreeView::SetCollapsedImage ( Image pcImage)
Description:
Used to set the expander image (in collapsed state). Normally you should not use this function, but instead use the system default image.
Parameters
pcImagePointer to image to use for expander image.
See Also
GetCollapsedImage(), SetExpandedImage()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::CalcExpImgBounds(), and os::TreeView::Private::m_pcCollapsedImage.

void TreeView::SetDrawExpanderBox ( const bool  bDraw)
Description:
Set to true to have a box drawn around the expander image.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_bDrawBox.

Referenced by InfoWin::InfoWin().

void TreeView::SetDrawTrunk ( bool  bDraw)
Description:
Set to true to have lines drawn to each node (aka. tree trunk).
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_bDrawTrunk.

Referenced by InfoWin::InfoWin().

void TreeView::SetExpandedImage ( Image pcImage)
Description:
Used to set the expander image (in expanded state). Normally you should not use this function, but instead use the system default image.
Parameters
pcImagePointer to image to use for expander image.
See Also
GetExpandedImage(), SetCollapsedImage()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::CalcExpImgBounds(), and os::TreeView::Private::m_pcExpandedImage.

void TreeView::SetExpandedMessage ( Message pcMsg)
Description:
Set a message to be sent when a node is expanded or collapsed. When the message is sent, a boolean named "expanded" is added, containing the new expanded state of the node (true = expanded, false = collapsed). A pointer named "node" points to the node that has been expanded/collapsed.
Parameters
pcMsgPointer to message to send.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_pcExpandMsg.

void TreeView::SetIndentWidth ( uint  nIndentWidth)
Description:
Set the size of indentations. Default is 10 pixels.
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::TreeView::Private::m_nIndentWidth.

void TreeView::SortRows ( std::vector< ListViewRow * > *  pcRows,
int  nColumn 
)
virtual
Description:
Overridable default sorting routine.
Parameters
pcRowsstd::vector of ListViewRows to be sorted.
nColumnThe column to sort by.
See Also
Sort()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

Reimplemented from os::ListView.

References os::TreeView::Private::m_bTrunkValid.