TreeViewCustomGui Class Reference

#include <customgui_listview.h>

Inheritance diagram for TreeViewCustomGui:

Detailed Description

The tree view custom GUI (CUSTOMGUI_TREEVIEW) is a very versatile list view interface.
Here are the settings: TREEVIEW_CUSTOMGUISETTINGS

Public Member Functions

Bool SetRoot (void *root, TreeViewFunctions *functions, void *userdata)
 
Bool SetLayout (Int32 columns, const BaseContainer &data)
 
Bool SetHeaderText (Int32 lColumnID, const maxon::String &str)
 
GeUserAreaGetTreeViewArea ()
 
GeUserAreaGetHeaderArea ()
 
void Refresh ()
 
Int32 GetAutoColumnWidth (Int32 lColID)
 
Int32 GetColumnWidthUser (Int32 lColID)
 
Int32 GetRealColumnWidth (Int32 lColID)
 
Bool SetColumnWidthUser (Int32 lColID, Int32 lWidth)
 
Bool MakeVisible (void *pObj)
 
Bool ShowObject (void *pObj)
 
Bool GetCellPosition (void *pObj, Int32 lColID, GeUserArea *&pArea, Int32 &x, Int32 &y, Int32 &w, Int32 &h, Int32 &lTextOffset)
 
Bool GetVisibleScrollArea (Int32 &x1, Int32 &y1, Int32 &x2, Int32 &y2)
 
Int32 GetVisibleLineCount ()
 
Bool IsFocusItem (void *pObj)
 
void * GetFocusItem ()
 
void SetFocusItem (void *pItem)
 
const BaseContainerGetLayout ()
 
void * GetObject (Int32 line, Int32 *level)
 
void * GetSelectionItem ()
 
void SetSelectionItem (void *pItem)
 
Bool SetVisibleScrollArea (Int32 x1, Int32 y1, Int32 x2, Int32 y2)
 
void SetShowLines (Bool show)
 
Bool GetShowLines () const
 
Bool GetLineAndColumnHit (Int32 screenX, Int32 screenY, Int32 &lineHit, Int32 &columnHit)
 
- Public Member Functions inherited from BaseCustomGui< 1000475 >
Int32 GetWidth ()
 
Int32 GetHeight ()
 
void Redraw ()
 
Bool LayoutChanged ()
 
Bool Activate ()
 
Bool SetDefaultForResEdit ()
 
Bool SetData (const TriState< GeData > &tristate)
 
TriState< GeDataGetData ()
 
void SetLayoutMode (Int32 mode)
 
Int32 GetLayoutMode ()
 
Bool SupportLayoutSwitch ()
 
- Public Member Functions inherited from _BaseCustomGui
Int32 GetWidth (Int32 plugid)
 
Int32 GetHeight (Int32 plugid)
 
void Redraw (Int32 plugid)
 
Bool LayoutChanged (Int32 plugid)
 
Bool Activate (Int32 plugid)
 
Bool SetDefaultForResEdit (Int32 plugid)
 
Bool SetData (Int32 plugid, const TriState< GeData > &tristate)
 
TriState< GeDataGetData (Int32 plugid)
 
void SetLayoutMode (Int32 plugid, Int32 mode)
 
Int32 GetLayoutMode (Int32 plugid)
 
Bool SupportLayoutSwitch (Int32 plugid)
 

Private Member Functions

 TreeViewCustomGui ()
 
 ~TreeViewCustomGui ()
 

Additional Inherited Members

- Static Public Attributes inherited from BaseCustomGui< 1000475 >
static constexpr Int32 VALUE
 

Constructor & Destructor Documentation

◆ TreeViewCustomGui()

TreeViewCustomGui ( )
private

◆ ~TreeViewCustomGui()

~TreeViewCustomGui ( )
private

Member Function Documentation

◆ SetRoot()

Bool SetRoot ( void *  root,
TreeViewFunctions functions,
void *  userdata 
)

Initializes the tree.

Parameters
[in]rootThe root object. The caller owns the pointed object.
[in]functionsThe tree view functions. The caller owns the pointed object.
[in]userdataThe user data. The caller owns the pointed object.
Returns
true if successful, otherwise false.

◆ SetLayout()

Bool SetLayout ( Int32  columns,
const BaseContainer data 
)

Sets the layout of the tree view.

Parameters
[in]columnsThe number of columns.
[in]dataThe layout container, with one column type entry for each column: LV_COLUMN
Returns
true if successful, otherwise false.

◆ SetHeaderText()

Bool SetHeaderText ( Int32  lColumnID,
const maxon::String str 
)

Sets the header text for a column.

Parameters
[in]lColumnIDThe column index.
[in]strThe header text.
Returns
true if successful, otherwise false.

◆ GetTreeViewArea()

GeUserArea* GetTreeViewArea ( )

Gets the tree view user area.

Returns
The tree view user area. The tree view owns the pointed user area.

◆ GetHeaderArea()

GeUserArea* GetHeaderArea ( )

Gets the header user area.

Returns
The header user area. The tree view owns the pointed user area.

◆ Refresh()

void Refresh ( )

Refreshes the tree view.

◆ GetAutoColumnWidth()

Int32 GetAutoColumnWidth ( Int32  lColID)

Gets the auto-width of the column.

Parameters
[in]lColIDThe column index.
Returns
The column auto width.

◆ GetColumnWidthUser()

Int32 GetColumnWidthUser ( Int32  lColID)

Gets the size of the column the user has set.

Parameters
[in]lColIDThe column index.
Returns
The column user width.

◆ GetRealColumnWidth()

Int32 GetRealColumnWidth ( Int32  lColID)

Gets the real column width.

Parameters
[in]lColIDThe column index.
Returns
The real column width.

◆ SetColumnWidthUser()

Bool SetColumnWidthUser ( Int32  lColID,
Int32  lWidth 
)

Sets the user column width.

Parameters
[in]lColIDThe column index.
[in]lWidthThe column width to set.
Returns
true if successful, otherwise false.

◆ MakeVisible()

Bool MakeVisible ( void *  pObj)

Scrolls to pObj and expands the tree if necessary.

Parameters
[in]pObjThe object to scroll to.
Returns
true if successful, otherwise false.

◆ ShowObject()

Bool ShowObject ( void *  pObj)

Expands the tree to pObj.

Parameters
[in]pObjThe object to show.
Returns
true if successful, otherwise false.

◆ GetCellPosition()

Bool GetCellPosition ( void *  pObj,
Int32  lColID,
GeUserArea *&  pArea,
Int32 x,
Int32 y,
Int32 w,
Int32 h,
Int32 lTextOffset 
)

Gets the cell position of pObj.

Parameters
[in]pObjThe object to get the cell position for.
[in]lColIDThe column index.
[out]pAreaAssigned the user area pointer.
[out]xAssigned the left X coordinate.
[out]yAssigned the left Y coordinate.
[out]wAssigned the width.
[out]hAssigned the height.
[out]lTextOffsetAssigned the text offset.
Returns
true if successful, otherwise false.

◆ GetVisibleScrollArea()

Bool GetVisibleScrollArea ( Int32 x1,
Int32 y1,
Int32 x2,
Int32 y2 
)

Queries the internal scroll group for its currently visible region, a rectangle between (x1,y1) and (x2,y2).

Since
R17.032
Parameters
[out]x1Assigned the X coordinate of the top left visible corner.
[out]y1Assigned the Y coordinate of the top left visible corner.
[out]x2Assigned the X coordinate of the bottom right visible corner.
[out]y2Assigned the Y coordinate of the bottom right visible corner.
Returns
true if the visible area could be retrieved, otherwise false.

◆ GetVisibleLineCount()

Int32 GetVisibleLineCount ( )

Gets the number of currently visible lines related to folded and unfolded items of the tree.

Since
R17.032
Returns
The number of visible lines.

◆ IsFocusItem()

Bool IsFocusItem ( void *  pObj)

Checks if pObj is the focus item.

Parameters
[in]pObjThe object to check.
Returns
true if pObj is the focus item, otherwise false.

◆ GetFocusItem()

void* GetFocusItem ( )

Retrieves the focus item.

Returns
The focus item.

◆ SetFocusItem()

void SetFocusItem ( void *  pItem)

Sets the focus item.

Parameters
[in]pItemThe new focus item.

◆ GetLayout()

const BaseContainer* GetLayout ( )

Retrieves the layout container of the tree view.

Returns
The container of the tree view layout. Basically the same container passed in SetLayout() but reflecting any change of the column order.

◆ GetObject()

void* GetObject ( Int32  line,
Int32 level 
)

Gets the object for a line in the tree view.

Parameters
[in]lineThe line in the tree view.
[out]levelAssigned the hierarchy level of the tree.
Returns
The object, or nullptr if there is no object.

◆ GetSelectionItem()

void* GetSelectionItem ( )

Retrieves the selected item.

Returns
The selected item.

◆ SetSelectionItem()

void SetSelectionItem ( void *  pItem)

Sets the selected item.

Parameters
[in]pItemThe new selected item.

◆ SetVisibleScrollArea()

Bool SetVisibleScrollArea ( Int32  x1,
Int32  y1,
Int32  x2,
Int32  y2 
)

Sets the internal scroll group currently visible region, a rectangle between (x1,y1) and (x2,y2).

Since
R18
Parameters
[in]x1The left x value.
[in]y1The top y value.
[in]x2The right x value.
[in]y2The bottom y value.
Returns
true if it succeeds, false if it fails.

◆ SetShowLines()

void SetShowLines ( Bool  show)

Shows/hides the hierarchical tree lines.

Parameters
[in]showSet to true to show the lines, to false to hide them.

◆ GetShowLines()

Bool GetShowLines ( ) const

Shows/hides the tree hierarchical lines.

Returns
true if lines are visible, false if are hidden.

◆ GetLineAndColumnHit()

Bool GetLineAndColumnHit ( Int32  screenX,
Int32  screenY,
Int32 lineHit,
Int32 columnHit 
)

Gets the line and column hit at coordinates. Input coordinates must be on screen space.

Parameters
[in]screenXThe x coordinate in screen space.
[in]screenYThe y coordinate in screen space.
[in]lineHitThe line hit.
[in]columnHitThe column hit.
Returns
true if a valid element is hit, otherwise false.