|
|
|
|
- Overview
- Handling an Organization Chart control programmatically
- Adding a root element
- Adding child elements
- Deleting an element
- Handling an element found in the Organization Chart control
- Changing the orientation of an element
- Properties specific to Organization Chart controls
Handling an Organization Chart control through programming (prefix syntax)
An Organization Chart control can be: - handled programmatically.
- linked to a data file.
This help page explains how to programmatically handle Organizational Chart controls. Handling an Organization Chart control programmatically Adding a root element A root element of an organization chart is the element from which the entire tree structure is built. A "root" element can be added to an Organization Chart control with <Organization Chart>.Add. This function accepts two syntaxes: - syntax used to specify the element characteristics: title, image, etc, ...
Example:
// Adds a root element ORG_HR.Add("Emma Brown")
Remark: <Organization Chart>.Add inserts an image into the element (to the left of the text). - syntax that handles a variable of type OrgElement.
// Add elements to the Organization Chart control // Root element ElementCEO is OrgElement ElementCEO..Title = "Big Boss" ORG_EXECUTIVE.Add(ElementCEO)
Remark: The OrgElement type can be used to configure different specific options: - tooltip,
- background color of the element,
- background image of the element,
- font of the title and content,
- orientation of the element.
Adding child elements - syntax used to specify the element characteristics: title, content, ...
ORG_NoName1.Add("Emma") ORG_NoName1.AddChild(1, "Paul Martin") ORG_NoName1.AddChild(1, "Florence Mitchell") ORG_NoName1.AddChild(3, "Gary Prince") ORG_NoName1.AddChild(3, "Joey Moore")
- syntax that handles a variable of type OrgElement.
// Add elements into the Organization Chart control // Root element ElementCEO is OrgElement ElementCEO.Title = "Big Boss" ORG_EXECUTIVE.Add(ElementCEO) // Child elements Element2 is OrgElement Element2.Title = "Production" ORG_EXECUTIVE.AddChild(1, Element2) Element3 is OrgElement Element3.Title = "Sales" ORG_EXECUTIVE.AddChild(1, Element3)
The BackgroundColor property of the OrgElement variable is used to define the color used to display an element. If no background color is defined, the Organization Chart control will automatically use the default color.
Deleting an element
// Deletes the element 15 and its children ORG_MyOrganizationChart.Delete(15)
Handling an element found in the Organization Chart control The elements of an Organization Chart control are handled using their indexes. Each element of the Organization Chart control is associated with an identifier (index). This index is returned: This index is used by all functions for handling elements (selection, deletion, etc.). To handle or modify a specific element in the Organization Chart control, simply: - define a variable of type OrgElement.
- assign the desired element of the Organizational Chart control to it.
Then, the element can be handled by the OrgElement properties. For example:
MyElement is OrgElement MyElement = ORG_MyOrganizationChart[2] Trace(MyElement.Title)
Changing the orientation of an element To change the orientation of an element in the Organization Chart control, use the Orientation90 property of the OrgElement type. Therefore, a child element can be displayed on the right of its parent. The following code is used to change the orientation of the element that was clicked:
// Select an element of ORG_NoName1 MyElement is OrgElement MyElement = ORG_NoName1[ORG_NoName1] MyElement.Orientation90 = NOT MyElement.Orientation90 ORG_NoName1[ORG_NoName1] <- MyElement
Properties specific to Organization Chart controls The following properties are used to manage an Organization Chart control through programming.
| | Count | The Count property returns the number of elements in a given set. | ElementHeight | The ElementHeight property is used to:- Find out or modify the height of the elements in an Organization Chart control.
- Find out or modify the height of the cells in a Dashboard control.
| ElementOrientation | The ElementOrientation property is used to get and change the orientation of an Organization Chart control. | ElementWidth | The ElementWidth property is used to:- Find out or modify the width of the elements in an Organization Chart control.
- Find out or modify the width of the cells in a Dashboard control.
| MaxLeafPerRow | The MaxLeafPerRow property is used to get and change the maximum number of elements in a row in an Organization Chart control. | Vertical | The Vertical property is used to:- determine if a control is oriented horizontally or vertically.
- change the orientation of Table and Looper controls (switch from vertical to horizontal and conversely).
| Zoom | The Zoom property gets or sets the zoom value: - in an Image control.
- in a Map control.
- in an Organization Chart control.
- in a Table, TreeView Table, Pivot Table, Spreadsheet or List Box control.
- in a Word Processing control.
- in a PDF Reader control.
- in a Camera control.
- in a Diagram Editor control;
- in a window.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|