MGUI::CTRL_TREE Class Reference

Tree control with support for expand/collapse. More...

#include <mgui/tree.h>

Inheritance diagram for MGUI::CTRL_TREE:
Inheritance graph
[legend]

List of all members.

Classes

class  ITEMINFO
 Container for individual item information. More...

Public Types

enum  CHILDPRESENCE { CHILDPRESENCE_No = 0, CHILDPRESENCE_Yes = 1, CHILDPRESENCE_Ask = 2 }
enum  CHILDVISIBILITY { CHILDVISIBILITY_Expand, CHILDVISIBILITY_Collapse, CHILDVISIBILITY_CollapseReset, CHILDVISIBILITY_Toggle }
enum  CTRLSTYLE {
  CTRLSTYLE_Default = 0x0000, CTRLSTYLE_ShowLines = 0x0001, CTRLSTYLE_ShowLinesAtRoot = 0x0002, CTRLSTYLE_NoButtons = 0x0004,
  CTRLSTYLE_SingleExpand = 0x0008, CTRLSTYLE_NoToolTips = 0x0010, CTRLSTYLE_EditableText = 0x0020, CTRLSTYLE_NoScrollHorizontal = 0x0040,
  CTRLSTYLE_SizeInPixels = 0x0080, CTRLSTYLE_ImageIdxIsIconID = 0x0100
}
typedef
fastdelegate::FastDelegate
< void(ITEMHND,
CHILDVISIBILITY)> 
DELEGATE_ONCHILDVISIBILITYCHANGED
typedef
fastdelegate::FastDelegate
< bool(ITEMHND,
CHILDVISIBILITY)> 
DELEGATE_ONCHILDVISIBILITYCHANGING
typedef
fastdelegate::FastDelegate
< MGUI::CUSTOMDRAW::RETVALUE(CUSTOMDRAW_TREE &)> 
DELEGATE_ONCUSTOMDRAW
typedef
fastdelegate::FastDelegate
< void(CTRL_TREE::ITEMVALUES,
CTRL_TREE::ITEMINFO &)> 
DELEGATE_ONGETITEMINFO
typedef
fastdelegate::FastDelegate
< void(ITEMHND)> 
DELEGATE_ONITEM
typedef
fastdelegate::FastDelegate
< void(ITEMHND, HITRESULT,
const LPOINT2D
&, MGUI::KEYSTATE,
MGUI::KEYCODE)> 
DELEGATE_ONKEY
typedef
fastdelegate::FastDelegate
< bool(ITEMHND, HITRESULT,
const LPOINT2D
&, MGUI::KEYSTATE)> 
DELEGATE_ONMOUSE
typedef
fastdelegate::FastDelegate
< bool(ITEMHND, HITRESULT,
const LPOINT2D
&, MGUI::POINTERBUTTON,
MGUI::KEYSTATE)> 
DELEGATE_ONPOINTER
typedef
fastdelegate::FastDelegate
< void(ITEMINFO &)> 
DELEGATE_ONPREINSERTITEM
typedef
fastdelegate::FastDelegate
< void(CTRL_TREE::ITEMVALUES,
const CTRL_TREE::ITEMINFO &)> 
DELEGATE_ONSETITEMINFO
typedef
fastdelegate::FastDelegate
< bool(ITEMHND, HITRESULT,
const LPOINT2D
&, MGUI::CTRL_TOOLTIP &)> 
DELEGATE_ONTOOLTIPREQUEST
enum  FIND {
  FIND_Selected, FIND_DropHighlight, FIND_Parent, FIND_FirstChild,
  FIND_NextSibling, FIND_PreviousSibling, FIND_TopParent
}
enum  HITRESULT {
  HITRESULT_Nowhere = 0x0001, HITRESULT_OnItemIcon = 0x0002, HITRESULT_OnItemText = 0x0004, HITRESULT_OnItemIndent = 0x0008,
  HITRESULT_OnItemButton = 0x0010, HITRESULT_OnItemRight = 0x0020, HITRESULT_OnItemStateIcon = 0x0040, HITRESULT_OnItem = (HITRESULT_OnItemIcon | HITRESULT_OnItemText | HITRESULT_OnItemStateIcon)
}
enum  IMAGETYPE { IMAGETYPE_Primary, IMAGETYPE_State }
enum  ITEMHND { ITEMHND_Last = -2, ITEMHND_None = -1, ITEMHND_Root = 0 }
enum  ITEMSTATUS {
  ITEMSTATUS_None = 0x00, ITEMSTATUS_Bold = 0x01, ITEMSTATUS_DropHighlighted = 0x10, ITEMSTATUS_Expanded = 0x02,
  ITEMSTATUS_ExpandedOnce = 0x04, ITEMSTATUS_Selected = 0x08
}
enum  ITEMSTYLE { ITEMSTYLE_Default = 0x0000, ITEMSTYLE_OwnerText = 0x0001, ITEMSTYLE_OwnerImages = 0x0002, ITEMSTYLE_AllowChildReorder = 0x0004 }
enum  ITEMVALUES {
  ITEMVALUES_None = 0x0000, ITEMVALUE_ChildPresence = 0x0001, ITEMVALUE_ImageNormal = 0x0002, ITEMVALUE_ImageSelected = 0x0004,
  ITEMVALUE_ImageState = 0x0008, ITEMVALUE_Status = 0x0010, ITEMVALUE_Text = 0x0020, ITEMVALUE_ID = 0x0040,
  ITEMVALUE_Style = 0x0080, ITEMVALUE_HeightMult = 0x0100, ITEMVALUES_All = 0x0FFF
}

Public Member Functions

 CTRL_TREE ()
 ~CTRL_TREE ()
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, int height=20, int width=40, CTRLSTYLE style=CTRLSTYLE_Default, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_Expand)
void DeleteChildren (ITEMHND hndParent)
void DeleteItem (ITEMHND hndItem)
void DrawItem (ITEMHND hndItem, bool erase=true)
void EnsureVisible (ITEMHND hndItem, bool ScrollToShow=true)
ITEMHND FindChildByID (ITEMHND hndParent, ID id, bool recursive=false) const
ITEMHND FindItem (FIND find, ITEMHND hndItem=ITEMHND_None) const
int GetBaseItemHeight () const
CHILDPRESENCE GetChildPresence (ITEMHND hndItem) const
ITEMHND GetFirstChild (ITEMHND hndParent) const
ID GetItemID (ITEMHND hndItem) const
void GetItemInfo (ITEMHND hndItem, ITEMVALUES ItemValues, ITEMINFO &ItemInfo) const
ITEMSTATUS GetItemStatus (ITEMHND hndItem) const
ITEMHND GetNextSibling (ITEMHND hndItem) const
ITEMHND GetParent (ITEMHND hndChild) const
ITEMHND GetSelectedItem () const
ITEMHND InsertItem (ITEMHND hndParent, ITEMHND hndInsertAfter, ITEMINFO &ItemInfo)
ITEMHND InsertItem (ITEMHND hndParent, ITEMHND hndInsertAfter, const MISTRING text, ID id=0)
bool IsRedrawDisabled () const
void Redraw (bool erase=true)
void RedrawDisable ()
void RedrawEnable ()
void SetAutoSelectOnClick (bool AutoSelectOnClick)
void SetBackgroundColor (const COLOR &color)
void SetBaseItemHeight (int baseheight)
void SetChildVisibility (ITEMHND hndParent, CHILDVISIBILITY visibility)
void SetDelegateOnChildVisibilityChanged (DELEGATE_ONCHILDVISIBILITYCHANGED)
void SetDelegateOnChildVisibilityChanging (DELEGATE_ONCHILDVISIBILITYCHANGING)
void SetDelegateOnCustomDraw (DELEGATE_ONCUSTOMDRAW)
void SetDelegateOnDestroyItem (DELEGATE_ONITEM)
void SetDelegateOnGetItemInfo (DELEGATE_ONGETITEMINFO)
void SetDelegateOnItemChangePosition (DELEGATE_ONITEM delegate)
void SetDelegateOnItemDeselected (DELEGATE_ONITEM delegate)
void SetDelegateOnItemSelected (DELEGATE_ONITEM delegate)
void SetDelegateOnKeyPress (DELEGATE_ONKEY)
void SetDelegateOnLeftButtonDoubleClick (DELEGATE_ONMOUSE)
void SetDelegateOnPointerButtonDown (DELEGATE_ONPOINTER delegate)
void SetDelegateOnPointerButtonUp (DELEGATE_ONPOINTER delegate)
void SetDelegateOnPreInsertItem (DELEGATE_ONPREINSERTITEM)
void SetDelegateOnSetItemInfo (DELEGATE_ONSETITEMINFO)
void SetDelegateOnSize (DELEGATE_ONSIZE delegate)
void SetDelegateOnToolTipRequest (DELEGATE_ONTOOLTIPREQUEST)
void SetImageList (IMAGELIST &ImageList, IMAGETYPE ImageType)
void SetItemBold (ITEMHND hndItem, bool bold)
void SetItemImageNormal (ITEMHND hndItem, int IdxNormal)
void SetItemImageState (ITEMHND hndItem, unsigned int IdxState)
void SetItemInfo (const ITEMINFO &ItemInfo)
void SetItemInfo (ITEMHND hndItem, const ITEMINFO &ItemInfo)
void SetItemPosition (ITEMHND hndItem, ITEMHND hndInsertAfter)
void SetItemText (ITEMHND hndItem, const MISTRING &text)
void SetLineColor (const COLOR &color)
void SetSelectedItem (ITEMHND hndItem)

Protected Member Functions

ITEMHND HitTest (const LPOINT2D &point, HITRESULT *pHitResult=0) const
virtual void v_OnItemChangePosition (ITEMHND hndItem)
virtual void v_OnLeftButtonDown (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D &point, KEYSTATE keystate)
virtual void v_OnLeftButtonUp (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D &point, KEYSTATE keystate)
virtual void v_OnPointerButtonDown (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D &point, POINTERBUTTON button, KEYSTATE keystate)
virtual void v_OnPointerButtonUp (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D &point, POINTERBUTTON button, KEYSTATE keystate)
virtual void v_OnRightButtonDown (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D &point, KEYSTATE keystate)
virtual void v_OnRightButtonUp (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D &point, KEYSTATE keystate)
virtual bool v_OnToolTipRequest (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D &point, MGUI::CTRL_TOOLTIP &ToolTipCtrl)

Private Member Functions

virtual void v_OnChildVisibilityChanged (ITEMHND hndItem, CHILDVISIBILITY visibility)
virtual bool v_OnChildVisibilityChanging (ITEMHND hndItem, CHILDVISIBILITY visibility)
virtual void v_OnCreateEnd ()
virtual MGUI::CUSTOMDRAW::RETVALUE v_OnCustomDraw (CUSTOMDRAW_TREE &CustomDraw)
virtual void v_OnDestroyItem (ITEMHND hndItem)
virtual void v_OnGetItemInfo (ITEMVALUES RequestedValue, ITEMINFO &ItemInfo)
virtual void v_OnItemDeselected (ITEMHND hndItem)
virtual void v_OnItemSelected (ITEMHND hndItem)
virtual void v_OnPreInsertItem (ITEMINFO &ItemInfo)
virtual void v_OnSetItemInfo (ITEMVALUES ChangedValue, const ITEMINFO &ItemInfo)

Detailed Description

Tree control with support for expand/collapse.


Member Typedef Documentation

Delegate called when the visibility of a child has changed.

Delegate called when the visibility of a child is about to change.

Return 'false' to prevent action for occuring. Must be used to create chiltd items if item has CHILDPRESENCE_Ask

Called to perform custom drawing.

Delegate called to obtain info for item stored externally to control.

typedef fastdelegate::FastDelegate<void(ITEMHND)> MGUI::CTRL_TREE::DELEGATE_ONITEM

Delegate for various item events.

OnDestroyItem, OnItemDeselected, OnItemSelected all use this delegate

typedef fastdelegate::FastDelegate<void(ITEMHND, HITRESULT, const LPOINT2D&, MGUI::KEYSTATE, MGUI::KEYCODE)> MGUI::CTRL_TREE::DELEGATE_ONKEY

Delegate for Key presses.

typedef fastdelegate::FastDelegate<bool(ITEMHND, HITRESULT, const LPOINT2D&, MGUI::KEYSTATE)> MGUI::CTRL_TREE::DELEGATE_ONMOUSE

Delegate for mouse clicks.

Delegate should return 'true' to accept the default behaviour, or false to prevent it. The default behaviour for left click is to select the item clicked.

Delegate for pointer messages.

Delegate should return 'true' to accept the default behaviour or false to prevent it. The default behaviour for left click is to select the item clicked.

typedef fastdelegate::FastDelegate<void(ITEMINFO&)> MGUI::CTRL_TREE::DELEGATE_ONPREINSERTITEM

Delegate called before an item is created.

typedef fastdelegate::FastDelegate<void(CTRL_TREE::ITEMVALUES, const CTRL_TREE::ITEMINFO&)> MGUI::CTRL_TREE::DELEGATE_ONSETITEMINFO

Delegate called to obtain info for item stored externally to control.

Only applies to text value and only if CTRLSTYLE_EditableText specified when control created

typedef fastdelegate::FastDelegate<bool(ITEMHND, HITRESULT, const LPOINT2D&, MGUI::CTRL_TOOLTIP&)> MGUI::CTRL_TREE::DELEGATE_ONTOOLTIPREQUEST

Delegate for tooltips.


Member Enumeration Documentation

Indicator for presence or absence of children for item.

Enumerator:
CHILDPRESENCE_No 

Item has no children.

CHILDPRESENCE_Yes 

Item has children.

CHILDPRESENCE_Ask 

Determine children via v_OnGetItemInfo when first expand item.

Child visibility setting.

Enumerator:
CHILDVISIBILITY_Expand 

Expand to show children.

CHILDVISIBILITY_Collapse 

Collapse to hide children.

CHILDVISIBILITY_CollapseReset 

Collapse and remove children, resets to CHILDPRESENCE_Ask.

CHILDVISIBILITY_Toggle 

Toggle visibility.

Style for control specified when created.

Enumerator:
CTRLSTYLE_Default 
CTRLSTYLE_ShowLines 

Show lines linking child items to corresponding parent item.

CTRLSTYLE_ShowLinesAtRoot 

Show lines linking root items, required if want buttons for root items.

CTRLSTYLE_NoButtons 

Don't show buttons for expand/collapse.

CTRLSTYLE_SingleExpand 

Only expand one item at a time, collapsing previously expanded item.

CTRLSTYLE_NoToolTips 

Disable automatic tool tips for text items when not entirely visible.

CTRLSTYLE_EditableText 

Allow in-place editing of text items.

CTRLSTYLE_NoScrollHorizontal 

Disallow horizontal scrolling and don't show horizontal scrollbar.

CTRLSTYLE_SizeInPixels 

Size parameters specified in pixels.

CTRLSTYLE_ImageIdxIsIconID 

Index for "normal" image is an ICONID.

Type of search or relationship, used in FindItem().

Enumerator:
FIND_Selected 

Currently selected item.

FIND_DropHighlight 

Item which is target of drag-and-drop operation.

FIND_Parent 

Parent of item.

FIND_FirstChild 

First child item.

FIND_NextSibling 

Next sibling item.

FIND_PreviousSibling 

Previous sibling item.

FIND_TopParent 

Topmost parent (child of root).

Results of HitTest.

Enumerator:
HITRESULT_Nowhere 

Not on any item.

HITRESULT_OnItemIcon 

On icon (primary image) for item.

HITRESULT_OnItemText 

On text for item.

HITRESULT_OnItemIndent 

On indentation for item.

HITRESULT_OnItemButton 

On visibility toggle for item.

HITRESULT_OnItemRight 

To right of item.

HITRESULT_OnItemStateIcon 

On state icon.

HITRESULT_OnItem 

On item icons or text.

Image list type, used in SetImageList().

Enumerator:
IMAGETYPE_Primary 
IMAGETYPE_State 

'Handle' used to reference items in tree.

Enumerator:
ITEMHND_Last 

Indicates insertion as last item in child list.

ITEMHND_None 

Indicates insertion as first child item, as well as non-existent item.

ITEMHND_Root 

Indicates root of tree.

Item status values.

Enumerator:
ITEMSTATUS_None 
ITEMSTATUS_Bold 

Item text shown in bold.

ITEMSTATUS_DropHighlighted 

Item is highlighted as target for drag-and-drop operation.

ITEMSTATUS_Expanded 

Item is presently expanded.

ITEMSTATUS_ExpandedOnce 

Item has been expanded at least once.

ITEMSTATUS_Selected 

Item is 'selected'.

Style for item specified when created.

Enumerator:
ITEMSTYLE_Default 

Default style.

ITEMSTYLE_OwnerText 

Call v_OnGetItemInfo to obtain text and v_OnSetDispInfo when text edited.

ITEMSTYLE_OwnerImages 

Call v_OnGetItemInfo to obtain normal/selected images.

ITEMSTYLE_AllowChildReorder 

Allow reordering of child items via drag-and-drop within parent.

Values to set or request for item.

Enumerator:
ITEMVALUES_None 
ITEMVALUE_ChildPresence 
ITEMVALUE_ImageNormal 
ITEMVALUE_ImageSelected 
ITEMVALUE_ImageState 
ITEMVALUE_Status 
ITEMVALUE_Text 
ITEMVALUE_ID 
ITEMVALUE_Style 
ITEMVALUE_HeightMult 
ITEMVALUES_All 

Constructor & Destructor Documentation

MGUI::CTRL_TREE::CTRL_TREE (  ) 

Constructor.

MGUI::CTRL_TREE::~CTRL_TREE (  ) 

Destructor.


Member Function Documentation

void MGUI::CTRL_TREE::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
int  height = 20,
int  width = 40,
CTRLSTYLE  style = CTRLSTYLE_Default,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_Expand 
)

Create control.

Parameters:
ParentPane Parent pane
height Height in rows (or pixels if CTRLSTYLE_SizeInPixels)
width Width in 'em' characters (or pixels if CTRLSTYLE_SizeInPixels)
style Control style
void MGUI::CTRL_TREE::DeleteChildren ( ITEMHND  hndParent  ) 

Delete all children of specified parent.

Parameters:
hndParent Handle to parent item
void MGUI::CTRL_TREE::DeleteItem ( ITEMHND  hndItem  ) 

Delete item and all children.

Parameters:
hndItem Item handle
void MGUI::CTRL_TREE::DrawItem ( ITEMHND  hndItem,
bool  erase = true 
)

Draw single item.

Parameters:
hndItem Item handle
erase Erase existing item
void MGUI::CTRL_TREE::EnsureVisible ( ITEMHND  hndItem,
bool  ScrollToShow = true 
)

Ensure that specified item is visible, expanding or scrolling as needed.

Parameters:
hndItem Item handle
ScrollToShow Scroll if needed to show item
ITEMHND MGUI::CTRL_TREE::FindChildByID ( ITEMHND  hndParent,
ID  id,
bool  recursive = false 
) const

Find child using ID.

Parameters:
hndParent Handle to parent item
id Programmer-specified ID
recursive Search descendents recursively if not found directly under parent
ITEMHND MGUI::CTRL_TREE::FindItem ( FIND  find,
ITEMHND  hndItem = ITEMHND_None 
) const

Find item matching specified criteria or relationship.

Parameters:
find Relationship for finding item
hndItem Item to search from if needed
int MGUI::CTRL_TREE::GetBaseItemHeight (  )  const

Get base item height.

Items must be integer multiple of the base height.

Returns:
Base height in pixels.
CHILDPRESENCE MGUI::CTRL_TREE::GetChildPresence ( ITEMHND  hndItem  )  const

Get child presence for item.

Parameters:
hndItem Item handle
ITEMHND MGUI::CTRL_TREE::GetFirstChild ( ITEMHND  hndParent  )  const [inline]

Get first child for given parent.

Parameters:
hndParent Handle to parent item
ID MGUI::CTRL_TREE::GetItemID ( ITEMHND  hndItem  )  const

Get item ID.

Parameters:
hndItem Item handle
void MGUI::CTRL_TREE::GetItemInfo ( ITEMHND  hndItem,
ITEMVALUES  ItemValues,
ITEMINFO ItemInfo 
) const

Get information for item.

Parameters:
hndItem Item handle
ItemValues Values to retrieve
ItemInfo Item information returned
ITEMSTATUS MGUI::CTRL_TREE::GetItemStatus ( ITEMHND  hndItem  )  const

Get item status.

Parameters:
hndItem Item handle
ITEMHND MGUI::CTRL_TREE::GetNextSibling ( ITEMHND  hndItem  )  const [inline]

Get next "sibling" item.

Parameters:
hndItem Item handle
ITEMHND MGUI::CTRL_TREE::GetParent ( ITEMHND  hndChild  )  const [inline]

Get parent of item.

Parameters:
hndChild Child handle
ITEMHND MGUI::CTRL_TREE::GetSelectedItem (  )  const [inline]

get 'selected' item.

Returns:
Handle to selected item, ITEMHND_None if none selected.
ITEMHND MGUI::CTRL_TREE::HitTest ( const LPOINT2D point,
HITRESULT pHitResult = 0 
) const [protected]

Determine location of point relative to tree control.

Returns:
Handle for item point is on or ITEMHND_None if none.
Parameters:
point Point to test
pHitResult Result of test, NULL if not needed
ITEMHND MGUI::CTRL_TREE::InsertItem ( ITEMHND  hndParent,
ITEMHND  hndInsertAfter,
ITEMINFO ItemInfo 
)

Insert item into tree.

Returns:
Handle to ITEM added.
Parameters:
hndParent Parent item, ITEMHND_Root to insert as root item
hndInsertAfter Item to insert after, ITEMHND_None to insert at beginning, ITEMHND_Last to insert at end
ItemInfo Item information, will be updated to contain handle and actual status on return
ITEMHND MGUI::CTRL_TREE::InsertItem ( ITEMHND  hndParent,
ITEMHND  hndInsertAfter,
const MISTRING  text,
ID  id = 0 
)

Insert simple text item into tree.

Returns:
Handle to ITEM added.
Parameters:
hndParent Parent item, ITEMHND_Root to insert as root item
hndInsertAfter Item to insert after, ITEMHND_None to insert at beginning, ITEMHND_Last to insert at end
text Item text
id Item ID
bool MGUI::CTRL_TREE::IsRedrawDisabled (  )  const

Determine if redraw is disabled.

void MGUI::CTRL_TREE::Redraw ( bool  erase = true  ) 

Redraw entire control.

Parameters:
erase Erase before redraw
void MGUI::CTRL_TREE::RedrawDisable (  ) 

Disable redraw, incrementing disable count.

void MGUI::CTRL_TREE::RedrawEnable (  ) 

Enable redraw, decrementing disable count.

Will redraw the control if was disabled and is no longer.

void MGUI::CTRL_TREE::SetAutoSelectOnClick ( bool  AutoSelectOnClick  ) 

Set whether to autoselect item when click on.

void MGUI::CTRL_TREE::SetBackgroundColor ( const COLOR color  ) 

Set background color.

Parameters:
color Color to set

Reimplemented from MGUI::CTRL.

void MGUI::CTRL_TREE::SetBaseItemHeight ( int  baseheight  ) 

Set base item height.

Individual Items will be integer multiple of the base height.

Parameters:
baseheight Base height in pixels
void MGUI::CTRL_TREE::SetChildVisibility ( ITEMHND  hndParent,
CHILDVISIBILITY  visibility 
)

Set visibility for children of item.

Parameters:
hndParent Parent handle
visibility Child visibility
void MGUI::CTRL_TREE::SetDelegateOnChildVisibilityChanged ( DELEGATE_ONCHILDVISIBILITYCHANGED   ) 

Delegate called when the visibility of a child has changed.

void MGUI::CTRL_TREE::SetDelegateOnChildVisibilityChanging ( DELEGATE_ONCHILDVISIBILITYCHANGING   ) 

Set the delegate to call when the visibility of a child is about to change.

Return 'false' to prevent action for occuring. Must be used to create chiltd items if item has CHILDPRESENCE_Ask

void MGUI::CTRL_TREE::SetDelegateOnCustomDraw ( DELEGATE_ONCUSTOMDRAW   ) 

Set delegate to perform custom drawing.

void MGUI::CTRL_TREE::SetDelegateOnDestroyItem ( DELEGATE_ONITEM   ) 
void MGUI::CTRL_TREE::SetDelegateOnGetItemInfo ( DELEGATE_ONGETITEMINFO   ) 

Delegate called to obtain info for item stored externally to control.

void MGUI::CTRL_TREE::SetDelegateOnItemChangePosition ( DELEGATE_ONITEM  delegate  )  [inline]
void MGUI::CTRL_TREE::SetDelegateOnItemDeselected ( DELEGATE_ONITEM  delegate  )  [inline]
void MGUI::CTRL_TREE::SetDelegateOnItemSelected ( DELEGATE_ONITEM  delegate  )  [inline]
void MGUI::CTRL_TREE::SetDelegateOnKeyPress ( DELEGATE_ONKEY   ) 

Set the delegate to call on a key press.

void MGUI::CTRL_TREE::SetDelegateOnLeftButtonDoubleClick ( DELEGATE_ONMOUSE   ) 

Set the delegate to call on left mouse button double-click The return value of the delegate is ignored (there is no default action).

void MGUI::CTRL_TREE::SetDelegateOnPointerButtonDown ( DELEGATE_ONPOINTER  delegate  )  [inline]

Set the delegate to call on pointer button down Delegate should return to accept the default action.

void MGUI::CTRL_TREE::SetDelegateOnPointerButtonUp ( DELEGATE_ONPOINTER  delegate  )  [inline]

Set the delegate to call on pointer button up Delegate should return to accept the default action.

void MGUI::CTRL_TREE::SetDelegateOnPreInsertItem ( DELEGATE_ONPREINSERTITEM   ) 
void MGUI::CTRL_TREE::SetDelegateOnSetItemInfo ( DELEGATE_ONSETITEMINFO   ) 

Delegate called to obtain info for item stored externally to control.

Only applies to text value and only if CTRLSTYLE_EditableText specified when control created

void MGUI::CTRL_TREE::SetDelegateOnSize ( DELEGATE_ONSIZE  delegate  ) 

Set delegate to call when control resized.

void MGUI::CTRL_TREE::SetDelegateOnToolTipRequest ( DELEGATE_ONTOOLTIPREQUEST   ) 

Set the delegate for tooltip requests.

void MGUI::CTRL_TREE::SetImageList ( IMAGELIST ImageList,
IMAGETYPE  ImageType 
)

Set primary or 'state' image list for control.

The 'state' image list may contain at most 16 entries, and the first entry is unused.

Parameters:
ImageList Image list
ImageType Image type
void MGUI::CTRL_TREE::SetItemBold ( ITEMHND  hndItem,
bool  bold 
)

Set item to be bold or not.

Parameters:
hndItem Item handle
bold True to make bold, false for normal
void MGUI::CTRL_TREE::SetItemImageNormal ( ITEMHND  hndItem,
int  IdxNormal 
)

Set index for "normal" image.

Parameters:
hndItem Item handle
IdxNormal Image index, -1 for none
void MGUI::CTRL_TREE::SetItemImageState ( ITEMHND  hndItem,
unsigned int  IdxState 
)

Set item image for state.

Parameters:
hndItem Item handle
IdxState Index in 'state' image list (1-15) or 0 for none
void MGUI::CTRL_TREE::SetItemInfo ( const ITEMINFO ItemInfo  )  [inline]

Set item information using handle from ITEMINFO.

Parameters:
ItemInfo Item information to set
void MGUI::CTRL_TREE::SetItemInfo ( ITEMHND  hndItem,
const ITEMINFO ItemInfo 
)

Set item information for specified ITEMHND.

Parameters:
hndItem Item handle
ItemInfo Item information to set
void MGUI::CTRL_TREE::SetItemPosition ( ITEMHND  hndItem,
ITEMHND  hndInsertAfter 
)

Set item position in list.

Parameters:
hndItem Item handle
hndInsertAfter Handle for item to insert after
void MGUI::CTRL_TREE::SetItemText ( ITEMHND  hndItem,
const MISTRING text 
)

Set text for item.

Parameters:
hndItem Item handle
text Text string to set
void MGUI::CTRL_TREE::SetLineColor ( const COLOR color  ) 

Set color for drawing lines linking children to parent.

Parameters:
color Color to set
void MGUI::CTRL_TREE::SetSelectedItem ( ITEMHND  hndItem  ) 

Set selected item.

Parameters:
hndItem Item handle
virtual void MGUI::CTRL_TREE::v_OnChildVisibilityChanged ( ITEMHND  hndItem,
CHILDVISIBILITY  visibility 
) [private, virtual]

Called when child visibility has changed.

Parameters:
hndItem Handle to item
visibility New child visibility
virtual bool MGUI::CTRL_TREE::v_OnChildVisibilityChanging ( ITEMHND  hndItem,
CHILDVISIBILITY  visibility 
) [private, virtual]

Called when child visibility is about to change.

Return 'false' to prevent action from occurring. Must be overridden to create child items if item has CHILDPRESENCE_Ask.

Parameters:
hndItem Handle to item
visibility New child visibility
virtual void MGUI::CTRL_TREE::v_OnCreateEnd (  )  [private, virtual]

Called at end of create.

virtual MGUI::CUSTOMDRAW::RETVALUE MGUI::CTRL_TREE::v_OnCustomDraw ( CUSTOMDRAW_TREE CustomDraw  )  [private, virtual]

Called to perform custom drawing.

Default implementation simply returns RETVALUE_DoDefault.

Parameters:
CustomDraw Custom drawing parameters
virtual void MGUI::CTRL_TREE::v_OnDestroyItem ( ITEMHND  hndItem  )  [private, virtual]

Called when item about to be destroyed.

Parameters:
hndItem Item handle
virtual void MGUI::CTRL_TREE::v_OnGetItemInfo ( ITEMVALUES  RequestedValue,
ITEMINFO ItemInfo 
) [private, virtual]

Called to obtain info for item stored externally to control.

Parameters:
RequestedValue ITEMVALUE_ChildPresence, ITEMVALUE_ImageNormal, ITEMVALUE_ImageSelected or ITEMVALUE_Text
ItemInfo Item information passed/returned
virtual void MGUI::CTRL_TREE::v_OnItemChangePosition ( ITEMHND  hndItem  )  [protected, virtual]

Called when item position changed.

Called after position changed before redrawing. Default behavior is to call delegate.

Parameters:
hndItem Item handle
virtual void MGUI::CTRL_TREE::v_OnItemDeselected ( ITEMHND  hndItem  )  [private, virtual]

Called when item becomes deselected.

Called after status changed before redrawing item.

Parameters:
hndItem Item handle
virtual void MGUI::CTRL_TREE::v_OnItemSelected ( ITEMHND  hndItem  )  [private, virtual]

Called when item becomes selected.

Called after status changed before redrawing item.

Parameters:
hndItem Item handle
virtual void MGUI::CTRL_TREE::v_OnLeftButtonDown ( ITEMHND  hndItem,
HITRESULT  HitResult,
const LPOINT2D point,
KEYSTATE  keystate 
) [protected, virtual]

Called when left mouse button pressed.

Default behavior is to 'select' item if press anywhere in item.

Parameters:
hndItem Item button event occurred over
HitResult Location where event occurred
point Point where event occurred
keystate Modifier key state at time of event
virtual void MGUI::CTRL_TREE::v_OnLeftButtonUp ( ITEMHND  hndItem,
HITRESULT  HitResult,
const LPOINT2D point,
KEYSTATE  keystate 
) [protected, virtual]

Called when left mouse button released.

Default behavior supports visibility toggle, text editing, drag and drop, etc.

Parameters:
hndItem Item button event occurred over
HitResult Location where event occurred
point Point where event occurred
keystate Modifier key state at time of event
virtual void MGUI::CTRL_TREE::v_OnPointerButtonDown ( ITEMHND  hndItem,
HITRESULT  HitResult,
const LPOINT2D point,
POINTERBUTTON  button,
KEYSTATE  keystate 
) [protected, virtual]

Called when pointer button pressed.

Default behavior is to 'select' item if press anywhere in item.

Parameters:
hndItem Item button event occurred over
HitResult Location where event occurred
point Point where event occurred
button Button that was pressed
keystate Modifier key state at time of event
virtual void MGUI::CTRL_TREE::v_OnPointerButtonUp ( ITEMHND  hndItem,
HITRESULT  HitResult,
const LPOINT2D point,
POINTERBUTTON  button,
KEYSTATE  keystate 
) [protected, virtual]

Called when pointer button released.

Default behavior supports visibility toggle, text editing, drag and drop, etc.

Parameters:
hndItem Item button event occurred over
HitResult Location where event occurred
point Point where event occurred
button Button that was released
keystate Modifier key state at time of event
virtual void MGUI::CTRL_TREE::v_OnPreInsertItem ( ITEMINFO ItemInfo  )  [private, virtual]

Called before item created.

Parameters:
ItemInfo Item information passed/returned
virtual void MGUI::CTRL_TREE::v_OnRightButtonDown ( ITEMHND  hndItem,
HITRESULT  HitResult,
const LPOINT2D point,
KEYSTATE  keystate 
) [protected, virtual]

Called when right mouse button pressed.

Default behavior is to 'select' item if press anywhere in item.

Parameters:
hndItem Item button event occurred over
HitResult Location where event occurred
point Point where event occurred
keystate Modifier key state at time of event
virtual void MGUI::CTRL_TREE::v_OnRightButtonUp ( ITEMHND  hndItem,
HITRESULT  HitResult,
const LPOINT2D point,
KEYSTATE  keystate 
) [protected, virtual]

Called when right mouse button released.

Default behavior is to toggle expanded/collapsed if press/release on appropriate button.

Parameters:
hndItem Item button event occurred over
HitResult Location where event occurred
point Point where event occurred
keystate Modifier key state at time of event
virtual void MGUI::CTRL_TREE::v_OnSetItemInfo ( ITEMVALUES  ChangedValue,
const ITEMINFO ItemInfo 
) [private, virtual]

Called when change made to value stored external to control.

Only applies to text value and only if CTRLSTYLE_EditableText specified when control created.

Parameters:
ChangedValue ITEMVALUE_Text
ItemInfo Item information passed/returned
virtual bool MGUI::CTRL_TREE::v_OnToolTipRequest ( ITEMHND  hndItem,
HITRESULT  HitResult,
const LPOINT2D point,
MGUI::CTRL_TOOLTIP ToolTipCtrl 
) [protected, virtual]

Called to obtain ToolTip.

Will not be called if CTRLSTYLE_NoToolTips specified in creation. Default implementation sets ToolTip text to match item text for HITRESULT_OnItem and return true, otherwise returns false.

Returns:
True to show tooltip, false to not and use ToolTipCtrl methods to set text or graphic for tooltip.
Parameters:
hndItem Item cursor was over
HitResult Location where event occurred
point Point where event occurred
ToolTipCtrl ToolTip control

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

Generated on Sun Oct 7 21:35:39 2012 for TNTsdk 2012 by  doxygen 1.6.1