Skip to content

Latest commit

 

History

History
325 lines (217 loc) · 16.8 KB

File metadata and controls

325 lines (217 loc) · 16.8 KB

IupFlatTree Attributes

General

AUTOREDRAW (non-inheritable): automatically redraws the tree when something has change. Set to NO to change many nodes without updating the display. Default: "YES".

BGCOLOR: Background color of the tree. Default: the global attribute TXTBGCOLOR.

EXPAND (non-inheritable): The default value is "YES".

BORDERCOLOR: color used for the internal border. Default: "50 150 255". This is for the internal border.

BORDERWIDTH: line width used for the internal border. Default: "0". The internal borders are hidden by simply setting this value to 0. It is drawn inside the canvas, so inside the scrollbars.

EXTRATEXTWIDTH: width of the extra text area at right.

FGCOLOR: default text foreground color. Once each node is created it will not change its color when FGCOLOR is changed. Default: the global attribute TXTFGCOLOR.

HLCOLOR (non-inheritable): the color of a filled box drawn over the selected node. Default: TXTHLCOLOR global attribute.

HLCOLORALPHA: the transparency used to draw the selection. Default: 128. If set to 0 the selection box is not drawn.

PSCOLOR: background color of a selected node. If not defined BACKCOLORid will be used.

TEXTPSCOLOR: foreground color of a selected node. If not defined FORECOLORid will be used.

ICONSPACING (non-inheritable): spacing between the image and the text. Default: "2".

INDENTATION: sets the indentation level in pixels. Default: 16 for standard resolution, 24 for high resolution display

RASTERSIZE (non-inheritable): the initial size is "400x200". Set to NULL to allow the automatic layout use smaller values.

SPACING: vertical space between nodes. Notice that this is not the same as the IupTree.

CSPACING: same as SPACING but using the units of the vertical part of the SIZE attribute. It will actually set the SPACING attribute.

TOPITEM (write-only): position the given node identifier at the top of the tree or near to make it visible. If any parent node is collapsed then they are automatically expanded.


ACTIVE, EXPAND, FONT, SCREENPOSITION, POSITION, MINSIZE, MAXSIZE, WID, TIP, SIZE, RASTERSIZE, ZORDER, VISIBLE, THEME: also accepted.

Expanders (non-inheritable)

HIDEBUTTONS: hide the expand and collapse buttons.

HIDELINES: hide the lines that connect the nodes in the hierarchy.

LINECOLOR: the color of the dotted guidelines. Default: "110 110 110"

BUTTONBGCOLOR: background color of the expander buttons. Default: "240 240 240"

BUTTONFGCOLOR: sign color of the expander buttons ("+" or "-" signs). Default: "50 100 150"

BUTTONBRDCOLOR: border color of the expander buttons. Default: "150 150 150"

BUTTONSIZE: size of the expander button square. Default: 9 for standard resolution, 16 for high resolution display

BUTTONPLUSIMAGE: the image name that will be shown for all expander button when collapsed. By default, the button is drawn. The "IMGPLUS" pre-defined image is a 9x9 image that can be used.

BUTTONMINUSIMAGE: the image name that will be shown for all expander button when expanded. By default, the button is drawn. The "IMGMINUS" pre-defined image is a 9x9 image that can be used.

Nodes (non-inheritable)

For these attributes, "id" is the specified node identifier. If "id" is empty or invalid, then the focus node is used as the specified node.

COUNT (read-only) (non-inheritable): returns the total number of nodes in the tree.

CHILDCOUNTid (read-only): returns the immediate children count of the specified branch. It does not count children of child that are branches.

TOTALCHILDCOUNTid (read-only): returns the total children count of the specified branch. It counts all grandchildren too.

ROOTCOUNT (read-only): returns the number of root nodes.

COLORid: foreground color of the title at the given id. If not defined FGCOLOR is used.

BACKCOLORid: background color of the title at the given id. If not defined BGCOLOR is used.

ITEMTIPid: tip of the node at the given id. If defined, it will be shown instead of the TIP attribute.

DEPTHid (read-only): returns the depth of the specified node. The first node has depth=0, its immediate children have depth=1, their children have depth=2 and so on.

KINDid (read-only): returns the kind of the specified node. Possible values:

  • "LEAF": The node is a leaf
  • "BRANCH": The node is a branch

PARENTid (read-only): returns the parent of the specified node.

NEXTid (read-only): returns the next brother (same depth) of the specified node. Returns NULLs if at last child node of the parent (at the same depth).

PREVIOUSid (read-only): returns the previous brother (same depth) of the specified node. Returns NULLs if at first child node of the parent (at the same depth).

LASTid (read-only): returns the last brother (same depth) of the specified node.

FIRSTid (read-only): returns the first brother (same depth) of the specified node. This is the same as getting the first child of the parent of the given node. If the specified node is the first child returns the specified node.

STATEid: the state of the specified branch. Returns NULL for a LEAF. Possible values:

  • "EXPANDED": Expanded branch state (shows its children)
  • "COLLAPSED": Collapsed branch state (hides its children)

TITLEid: the text label of the specified node.

TITLEFONTid: the text font of the specified node. The format is the same as the FONT attribute.

TITLEFONTSTYLEid: changes the font style of the specified node. Actually changes the TITLEFONTid attribute.

TITLEFONTSIZEid: changes the font size of the specified node. Actually changes the TITLEFONTid attribute.

USERDATAid: the user data associated with the specified node.

EXTRATEXTid: text displayed at the extra text area at right.

Toggle (non-inheritable)

SHOWTOGGLE: enables the use of toggles for all nodes of the tree. Can be "YES", "3STATE" or NO". Default: "NO".

EMPTYTOGGLE: when SHOWTOGGLE=YES, the empty space left in nodes that TOGGLEVISIBLEid=NO is filled with a blank space. Can be YES or NO. Default: NO.

TOGGLEVALUEid: defines the toggle state. Values can be "ON" or "OFF". If SHOW3STATE=YES then can also be "NOTDEF". Default: "OFF".

TOGGLEVISIBLEid: defines the toggle visible state. Values can be "YES" or "NO". Default: "YES".

TOGGLEBGCOLOR: background color of the toggle. Default: "TXTBGCOLOR"

TOGGLEFGCOLOR: foreground color of the toggle, use to draw the frame and the check mark. Default: "TXTFGCOLOR"

TOGGLESIZE: size of the toggle square. Default: 16 for standard resolution, 24 for high resolution display

Images (non-inheritable)

IMAGEid (write only): image name to be used in the specified node, where id is the specified node identifier. Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. See also IupImage. If node is a branch it is used when collapsed. All images do NOT need to have the same size, but it is recommended that a branch expanded and collapse images to have the same size.

IMAGEEXPANDEDid (write-only): same as the IMAGE attribute but used for expanded branches.

IMAGELEAF: the image name that will be shown for all leaves. Default: "IMGLEAF" (a bullet). Internal values "IMGBLANK" (blank sheet of paper) and "IMGPAPER" (written sheet of paper) are also available. If BGCOLOR is set the image is automatically updated. This image defines the available space for the image in all nodes. "IMGEMPTY" can be used as a totally transparent image .

IMAGEBRANCHCOLLAPSED: the image name that will be shown for all collapsed branches. Default: "IMGCOLLAPSED" (a closed folder).

IMAGEBRANCHEXPANDED: the image name that will be shown for all expanded branches. Default: "IMGEXPANDED" (an open folder).

BACKIMAGE: image name to be used as a background. Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. See also IupImage.

BACKIMAGEZOOM: if set, the back image will be zoomed to occupy the full background. Aspect ratio is NOT preserved. Can be YES or NO. Default: NO.

Focus

VALUE (non-inheritable): The focus node identifier. When retrieved but there isn't a node with focus it returns 0 if there are any nodes, and returns -1 if there are no nodes. When changed and MARKMODE=SINGLE the node is also selected. The tree is always scrolled so the node becomes visible. Additionally, accepts the values:

"ROOT" or "FIRST": the first node (which is always expanded)
"LAST": the last expanded node
"NEXT": the next expanded node, one node after the focus node. If at the last does nothing
"PREVIOUS": the previous expanded node, one node before the focus node. If at the first does nothing
"PGDN": the next expanded node, ten nodes node after the focus node. If at the last does nothing
"PGUP": the previous expanded node, ten nodes before the focus node. If at the first does nothing
"CLEAR": clears the selection of the focus node.

CANFOCUS (creation-only) (non-inheritable): enables the focus traversal of the control. Default: YES.

PROPAGATEFOCUS(non-inheritable): enables the focus callback forwarding to the next native parent with FOCUS_CB defined. Default: NO.

FOCUSFEEDBACK (non-inheritable): draw the focus feedback. Can be YES or NO. Default: YES.

HASFOCUS (read-only): returns the button state if has focus. Can be YES or NO.

Marks

MARK (write only) (non-inheritable): Selects a range of nodes in the format "start-end" (%d-%d). Allowed only when MARKMODE=MULTIPLE. Also accepts the values:

**"INVERTid": Inverts the specified node selected state, where id is the specified node identifier. If id is empty or invalid, then the focus node is used as reference node. **
"BLOCK": Selects all nodes between the focus node and the initial block-marking node defined by MARKSTART
"CLEARALL": Clear the selection of all nodes
"MARKALL": Selects all nodes
"INVERTALL": Inverts the selection of all nodes

MARKEDid (non-inheritable): The selection state of the specified node, where id is the specified node identifier. If id is empty or invalid, then the focus node is used as reference node. Can be: YES or NO. Default: NO

MARKEDNODES (non-inheritable): The selection state of all nodes. It is/accepts a sequence of '+' and '-' symbols indicating the state of each node ('+'=selected, '-'=unselected. When setting this value, if the number of specified symbols is smaller than the total count, then the remaining nodes will not be changed. Can be set only when MARKMODE=MULTIPLE, can also be get when MARKMODE=SINGLE.

MARKMODE: defines how the nodes can be selected. Can be: SINGLE or MULTIPLE. Default: SINGLE.

MARKSTART (non-inheritable): Defines the initial node for the block marking, used when MARK=BLOCK. The value must be the node identifier. Default: 0 (first node).

MARKWHENTOGGLE (non-inheritable): selects or clears the selection of a node when its toggle is changed. Works only if the node has a toggle. Default: NO.

Hierarchy (non-inheritable)

For these attributes "id" is the specified node identifier. If "id" is empty or invalid, then the focus node is used as the specified node.

ADDEXPANDED (non-inheritable): Defines if branches will be expanded when created. The branch will be actually expanded when it receives the first child. Possible values: "YES" = The branches will be created expanded; "NO" = The branches will be created collapsed. Default: "YES".

ADDLEAFid (write-only): Adds a new leaf after the reference node, where id is the reference node identifier. Use id=-1 to add before the first node. The value is used as the text label of the new node. The id of the new node will be the id of the reference node + 1. The attribute LASTADDNODE is set to the new id. The reference node is marked and all others unmarked. The reference node position remains the same. If the reference node does not exist, nothing happens. If the reference node is a branch, then the depth of the new node is one depth increment from the depth of the reference node, if the reference node is a leaf, then the new node has the same depth. If you need to add a node after a specified node but at a different depth use INSERTLEAF.

ADDBRANCHid (write-only): Same as ADDLEAF for branches. Branches can be created expanded or collapsed depending on ADDEXPANDED.

COPYNODEid (write-only): Copies a node and its children, where id is the specified node identifier. The value is the destination node identifier. If the destination node is a branch, and it is expanded, then the specified node is inserted as the first child of the destination node. If the branch is not expanded or the destination node is a leaf, then it is inserted as the next brother of the leaf. The specified node is not changed. All node attributes are copied, except user data.

DELNODEid (write-only): Removes a node and/or its children, where id is the specified node identifier. Possible values:

  • "ALL": deletes all nodes, id is ignored.
  • "SELECTED": deletes the specified node and its children
  • "CHILDREN": deletes only the children of the specified node
  • "MARKED": deletes all the selected nodes (and all their children), id is ignored

EXPANDALL (write-only): expand or contracts all nodes. Can be YES (expand all), or NO (contract all).

INSERTLEAFid, INSERTBRANCHid (write-only): Same as ADDLEAF and ADDBRANCH but the depth of the new node is always the same of the reference node. If the reference node is a leaf, then the id of the new node will be the id of the reference node + 1. If the reference node is a branch the id of the new node will be the id of the reference node + 1 + the total number of child nodes of the reference node.

MOVENODEid (write-only): Moves a node and its children, where id is the specified node identifier. The value is the destination node identifier. If the destination node is a branch, and it is expanded, then the specified node is inserted as the first child of the destination node. If the branch is not expanded or the destination node is a leaf, then it is inserted as the next brother of the leaf. The specified node is removed. User data and all node attributes are preserved.

Editing

RENAME (write-only): Forces a rename action to take place. Valid only when SHOWRENAME=YES.

RENAMECARET (write-only): the caret’s position of the text box when in-place renaming. Same as the CARET attribute for IupText, but here is used only once after SHOWRENAME_CB is called and before the text box is shown.

RENAMESELECTION (write-only): the selection interval of the text box when in-place renaming. Same as the SELECTION attribute for IupText, but here is used only once after SHOWRENAME_CB is called and before the text box is shown.

SHOWRENAME (non-inheritable): Allows the in place rename of a node. Default: "NO". F2 and clicking twice only starts to rename a node if SHOWRENAME=YES.

Drag&Drop

SHOWDRAGDROP (non-inheritable): Enables the internal drag and drop of nodes, and enables the DRAGDROP_CB callback. Default: "NO". Works only if MARKMODE=SINGLE. Drag & Drop attributes are NOT used.

DRAGDROPTREE (non-inheritable): prepare the Drag & Drop callbacks to support drag and drop of nodes between trees (IupFlatTree only), in the same IUP application. Drag & Drop attributes still need to be set in order to activate the drag & drop support, so the application can control if this tree will be source and/or target. Default: NO.

DROPFILESTARGET (non-inheritable): Enable or disable the drop of files. Default: NO, but if DROPFILES_CB is defined when the element is mapped then it will be automatically enabled. This is NOT related to the drag&drop of nodes inside the tree.

DROPEQUALDRAG (non-inheritable): if enabled will allow a drop node to be equal to the drag node. Used only if SHOWDRAGDROP=YES. In the case the nodes are equal the callback return value is ignored and nothing is done after.

Drag & Drop attributes are supported, but SHOWDRAGDROP must be set to NO.