|
- Overview
- Initializing a TreeView Table control
- Adding or modifying rows in a TreeView Table control
- Adding rows into a TreeView Table control
- Modifying a row or a column
- Resuming the input in a column
- Adding or deleting a column
- Managing calculated columns
- Operations on the rows and cells
- Deleting a row
- Selecting a row
- Retrieving the row content or the cell content
- Value of a cell in the current row
- Value of a cell in a specific row
- Content of current row
- Content of specific row
- Operations on the tree structure
- Collapsing all nodes of a TreeView Table control
- Expanding all nodes of a TreeView Table control
- Finding out the number of collapsed/expanded row
- Defining the next status during an addition
- Finding out and modifying the images of rows
- Check Box TreeView column
- Finding out the parent or the children of an element
- Properties specific to the TreeView Table controls
Handling a TreeView Table control by programming (prefixed syntax)
The main concepts for programming TreeView Table controls are as follows. Several WLanguage functions allow you to manage the TreeView Table controls by programming. Versions 18 and later New in version 18 Initializing a TreeView Table control To fill a TreeView Table control by programming, you have the ability to use the following functions: Versions 19 and later New in version 19Adding or modifying rows in a TreeView Table control Adding rows into a TreeView Table control The creation of a row in a TreeView Table control is not automatically performed. It must be explicitly requested via a call to: Modifying a row or a column The content of the rows and columns found in a TreeVview Table control can be modified: - by the user, by performing an input in the columns. The modifications are automatically stored in the TreeView Table control without additional programming. ..Modified is set to True.
- by programming:
- with <Table>.Modify or <Table>.ModifyLine to modify the content of the current row or the content of a given row.
For example:
TVT_CUSTOMER.Modify("MOORE" + TAB + "Vince" + TAB + "Miami")
Remark: You also have the ability to use the name of TreeView Table control directly:
// Modify the current row TVT_CUSTOMER = "MOORE" + TAB + "Vince" + TAB + "Miami" // Modify the COL_DAY coloumn of row 3 SHUTDOWN COL_JOUR.Modify("Wednesday"+ TAB + "Vaqué", 3)
- by specifying the column name (like for an edit control) to modify the column content. To modify a column of a specific row, the row number must be specified (subscript).
For example:
COL_NAME[Subscript] = CustomerName
To modify a column of the current row, there is no need to specify the subscript. For example:
..Modified is set to False (it is set to True when an input is performed in the TreeView Table control).
Managing calculated columns The calculation formula of a calculated column must be described in the event "Displaying a table row" of a Table control. For example:
// COL_PBT: calculated column // COL_UPBT and COL_QTY: columns linked to memory zones COL_PBT = COL_UPBT * COL_QTY
Operations on the rows and cells Deleting a row - The syntax used for <Table>.Delete is as follows:
If the subscript is specified, <Table>.Delete deletes the row corresponding to the subscript. Otherwise, the current row is deleted. Deleting a row from the TreeView Table deletes all values of columns for this row. - The syntax used for <TreeView Table>.DeleteChild is as follows:
All child elements of the row identified by the subscript will be deleted.
Selecting a row The following syntax is used:
Retrieving the row content or the cell content The content of a TreeView Table control can be retrieved: - for the entire row.
- cell by cell.
Value of a cell in the current row To retrieve the value of a column (or cell) for the current row, the syntax is the same as for a simple edit control:
For example:
// COL_QTY is a column of a TreeView Table control IF COL_QTY < 10 THEN Info("Insufficient quantity") END
Value of a cell in a specific row To retrieve the value of a column not found on the current row, the row subscript must be specified:
<Value> = <Column name>[<Subscript>]
For example:
// Add the total price before tax (PBT) for all the order lines TotalPrice = 0 FOR Subscript = 1 TO TVT_ORDERS..Occurrence TotalPrice = TotalPrice + COL_PBT[Subscript] END
Content of current row To retrieve the content of the current row:
<Value> = <Name of TreeView Table control>
Content of specific row To retrieve the content of the row whose subscript is <Subscript>:
<Value> = <Name of TreeView Table control>[<Subscript>]
Remark: the subscript of the current row can be known by the <Table>.Select function. For example: Operations on the tree structure Collapsing all nodes of a TreeView Table control To wind all the nodes of a TreeView Table control shaft, use the <Table>.CollapseAll function. The syntax used is:
<Nom du TreeView Table control>.CollapseAll()
Expanding all nodes of a TreeView Table control To unroll all nodes of a TreeView Table control tree, use the <Table>.ExpandAll function. The following syntax is used: Versions 19 and later New in version 19Finding out the number of collapsed/expanded row To find out the number of the row that is expanded or collapsed, all you have to do is use the "Collapsed, expanded" code of a node found in the TreeView Table control:
// Which row is used? Info(TVT_TreeviewTable[TVT_TreeviewTable])
Defining the next status during an addition You have the ability to define the status of the next row that will be added into a TreeView Table control, which means collapsed or expanded. To do so, use ..Collapsed.
// The next added rows will be automatically collapsed TVT_TreeviewTable..Collapsed = True
Finding out and modifying the images of rows To find out and modify the images of rows in a TreeView Table control, use the following properties:
// Modify the images of rows in a TreeView Table control TVT_TreeviewTable..ExpandedImage = "OpenedFolder.gif" TVT_TreeviewTable..CollapsedImage = "ClosedFolder.gif"
Check Box TreeView column A Check Box column can be defined as "TreeView Table column" in a TreeView Table control. In this case, the Check Box column can be used to manage the tree structure. The Property ..Caption of the row makes it possible to know and modify the wording present next to the switch.
The Property ..Value of the row makes it possible to know and modify the value of the switch. Finding out the parent or the children of an element The following functions can be used to find out the parent or the children of an element: Properties specific to the TreeView Table controls The following properties are used to manage the characteristics of a TreeView Table control by programming. | | AddChildDelayed | Used to define the procedure that will be called later to fill a branch. | Collapsed | Allows you to define the status (collapsed or expanded) that will be used when adding new rows into a TreeView Table control. | merger | Used to find out whether the cells (or the titles of columns) found in a TreeView Table control are merged and to merge the cells (or the titles of columns) found in a TreeView Table control. | ExpandedImage | Used to find out and modify the default image in an expanded row of a TreeView Table control. | CollapsedImage | Used to find out and modify the default image in a collapsed row of a TreeView Table control. | Multiselection | Used to find out and modify the mode for selecting a TreeView Table control. | TotalNbChildren | Returns the total number of children for a branch in a TreeView Table control. | SortOption | Used to find out and modify the sort options defined for a column in TreeView Table control. | LeftIndent | Used to find out or modify the available space found on the left of text in the columns of TreeView Table control. | BrowsedItem | Allows you to find out and modify the item used for the automatic browse of TreeView Table controls. | Size | Allows you to find out and modify the number of columns in a TreeView Table control. | TotalsEnabled | Allows you to find out the operating mode of automatic calculations in a TreeView Table control and to forbid or force the automatic calculations in a TreeView Table control. |
To find out the entire list of WLanguage properties that can be used:
This page is also available for…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |