c4d.gui.TreeViewCustomGui¶
-
class
c4d.gui.
TreeViewCustomGui
¶ The tree view GUI (CUSTOMGUI_TREEVIEW) is a very versatile list view interface.
New in version R13.029.
It looks like this:
The settings are:
TREEVIEW_BORDER
int
Border type:
BORDER_NONE
No border.
BORDER_THIN_IN
Thin border inward.
BORDER_THIN_OUT
Thin border outward.
BORDER_IN
Normal border inward.
BORDER_OUT
Normal border outward.
BORDER_GROUP_IN
Group border inside.
BORDER_GROUP_OUT
Group border outside.
BORDER_OUT2
Outward border 2.
BORDER_OUT3
Outward border 3
BORDER_BLACK
Thin black line.
BORDER_ACTIVE_1
Active border 1.
BORDER_ACTIVE_2
Active border 2.
BORDER_ACTIVE_3
Active border 3.
BORDER_ACTIVE_4
Active border 4.
BORDER_GROUP_TOP
Border along the top.
BORDER_ROUND
Border with round corners.
BORDER_SCHEME_EDIT
Edit field border like the shortcut gadget for example.
BORDER_SCHEME_EDIT_NUMERIC
Edit field border that is open to the right like the link field for example.
BORDER_OUT3l
Outward border 3, open to the left.
BORDER_OUT3r
Outward border 3, open to the right.
BORDER_THIN_INb
Thin border inward, open to the botton.
BORDER_MASK
Masks out border type.
BORDER_TEXT_DOTTED
New in version R21:Only used withGeDialog.AddStaticText()
.Draws a dotted line at right of text, useful to visually connect the text with its parameter.BORDER_WITH_TITLE_MONO
Display group title with monospaced font.
BORDER_WITH_TITLE_BOLD
Display group title with bold font.
BORDER_WITH_TITLE
Display group title in the border.
TREEVIEW_OUTSIDE_DROP
bool
True if an object may be dropped under all the objects in the tree view.
TREEVIEW_HIDE_LINES
bool
True if no lines should be drawn.
TREEVIEW_CTRL_DRAG
bool
True if item may be duplicated by Ctrl + Drag.
TREEVIEW_NO_MULTISELECT
bool
True if no multiple selection is allowed.
TREEVIEW_HAS_HEADER
bool
True if the tree view may have a header line.
TREEVIEW_RESIZE_HEADER
bool
True if the column width can be changed by the user.
TREEVIEW_MOVE_COLUMN
bool
True if the user can move the columns.
TREEVIEW_FIXED_LAYOUT
bool
True if all lines have the same height.
TREEVIEW_NOAUTOCOLUMNS
bool
True if only the first line is asked for the columns width, resulting in a huge speedup.
TREEVIEW_NO_OPEN_CTRLCLK
bool
True if it is not allowed to open the complete tree with Ctrl + Click.
TREEVIEW_ALT_DRAG
bool
True if Alt should be used instead of Ctrl for drag and drop; implies item may be duplicated by Alt + Drag.
TREEVIEW_NO_BACK_DELETE
bool
Disable “delete pressed” messages if backspace was hit.
TREEVIEW_NO_DELETE
bool
Disable Delete Message Callback completely for backspace and delete.
TREEVIEW_ALTERNATE_BG
bool
Alternate background per line.
TREEVIEW_CURSORKEYS
bool
True if cursor keys should be processed. Note: The focus item has to be set to None if it is deleted and this flag is set.
TREEVIEW_CUSTOM_BG_COLOR
int or c4d.Vector
New in version R23:Custom Background Color. Can be an color ID (COLOR constants) or a Vector color in range [0.0, 1.0].If unset, default application background color will be used.Note
Only is applied if TREEVIEW_ALTERNATE_BG is False;TreeViewFunctions.GetBackgroundColor()
overrides it.TREEVIEW_NOENTERRENAME
bool
Suppresses the rename popup when the user presses enter.
TREEVIEW_NO_VERTICALSCROLL
bool
True to disable vertical scrolling and show the full list.
TREEVIEW_ADDROW
bool
Show an add new column row at the bottom of the list.
TREEVIEW_RESIZABLE
bool
The treeview is resizable from the bottom edge.
Methods Signatures
Initializes the tree. |
|
Sets the layout for the tree view. |
|
Refreshes the tree view. |
|
Set the header text for a column. |
|
Scrolls to pObj and expands the tree if necessary. |
|
Expands the tree to pObj. |
|
Queries the internal scroll group for its currently visible region. |
|
|
Sets the internal scroll group currently visible region, a rectangle between (x1, y1) and (x2, y2). |
Gets the number of currently visible lines related to folded and unfolded items of the tree. |
|
Sets the focus item. |
|
Checks if pItem is the focus item. |
Inheritance
Parent Class:
Methods Documentation
-
TreeViewCustomGui.
SetRoot
(self, root, functions, userdata)¶ Initializes the tree.
- Parameters
root (any) – Root object.
functions (c4d.gui.TreeViewFunctions) – Tree view functions.
userdata (any) – User data.
- Return type
bool
- Returns
True if successful, otherwise False.
-
TreeViewCustomGui.
SetLayout
(self, columns, data)¶ Sets the layout for the tree view.
- Parameters
columns (int) – Number of columns.
data (c4d.BaseContainer) –
Column data container, with one column type entry for each column:
LV_TREE
Tree or list.
LV_USERTREE
User tree. If set, the tree view calls
TreeViewFunctions.DrawCell()
for the left cell of each line (otherwise it would display the object’s name in the cell).LV_USER
Custom.
LV_CHECKBOX
Checkbox. If set, the tree view calls
TreeViewFunctions.IsChecked()
andTreeViewFunctions.SetCheck()
for each column and row.LV_CHECKBOXUSER
Checkbox. If set, the tree view calls
TreeViewFunctions.IsChecked()
andTreeViewFunctions.SetCheck()
for each column and row. User draw byTreeViewFunctions.DrawCell()
.LV_SLIDER
Slider. If set, the tree view calls TreeViewFunctions.GetFloatValue and TreeViewFunctions.SetFloatValue() for each column and row. NOT AVAILABLE IN PYTHON.
LV_DROPDOWN
Dropdown cycle box. If set, the tree view calls TreeViewFunctions.GetDropDownMenu() and TreeViewFunctions.SetDropDownMenu() for each column and row. NOT AVAILABLE IN PYTHON.
- Return type
bool
- Returns
True if successful, otherwise False.
-
TreeViewCustomGui.
Refresh
(self)¶ Refreshes the tree view.
-
TreeViewCustomGui.
SetHeaderText
(self, lColumnID, str)¶ Set the header text for a column.
- Parameters
lColumnID (int) – Column index.
str (str) – Header text.
- Return type
bool
- Returns
True if successful, otherwise False.
-
TreeViewCustomGui.
MakeVisible
(self, pObj)¶ Scrolls to pObj and expands the tree if necessary.
- Parameters
pObj (any) – The object to scroll to.
- Return type
bool
- Returns
True if successful, otherwise False.
-
TreeViewCustomGui.
ShowObject
(self, pObj)¶ Expands the tree to pObj.
- Parameters
pObj (any) – The object to expand to.
- Return type
bool
- Returns
True if successful, otherwise False.
-
TreeViewCustomGui.
GetVisibleScrollArea
(self)¶ Queries the internal scroll group for its currently visible region.
New in version R17.048.
- Return type
tuple(int,int,int,int)
- Returns
The X and Y coordinates of the top/bottom left/right visible corner: tuple(x1,y1,x2,y2).
-
TreeViewCustomGui.
SetVisibleScrollArea
(self, x1, y1, x2, y2)¶ Sets the internal scroll group currently visible region, a rectangle between (x1, y1) and (x2, y2).
New in version R18.020.
- Parameters
x1 (int) – The left X value.
y1 (int) – The top Y value.
x2 (int) – The right X value.
y2 (int) – The bottom Y value.
- Return type
bool
- Returns
True if successful, otherwise False.
-
TreeViewCustomGui.
GetVisibleLineCount
(self)¶ Gets the number of currently visible lines related to folded and unfolded items of the tree.
New in version R17.048.
- Return type
int
- Returns
The number of visible lines.
-
TreeViewCustomGui.
SetFocusItem
(self, pItem)¶ Sets the focus item.
- Parameters
pItem (any) – The new focus item.
-
TreeViewCustomGui.
IsFocusItem
(self, pItem)¶ Checks if pItem is the focus item.
- Parameters
pItem (any) – The item to check.
- Return type
bool
- Returns
True if pItem is the focus item, otherwise False.