PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Handling the Organization Chart control by programming
  • 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
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
An Organization Chart control can be:
  • handled by programming.
  • linked to a data file.
To handle an Organization Chart control by programming, WINDEV proposes the Organization Chart functions.
This help page explains how to handle an Organizational Chart control by programming.
Handling the Organization Chart control by programming

Adding a root element

A root element of an organization chart is the element from which the entire tree structure is built. Adding a "root" element into an Organization Chart control is performed by OrgAdd.
This function accepts two syntaxes:
  • syntax used to specify the element characteristics: title, image, ...
    Example:
    // Adds a root element
    OrgAdd(ORG_HR, "Emma Brown")

    Note: OrgAdd is used to insert an image into the element (on the left of the text).
  • syntax that is using an OrgElement variable.
    // Add elements into the Organization Chart control
    // Root element
    ElementCEO is OrgElement
    ElementCEO..Title = "Big Boss"
    OrgAdd(ORG_EXECUTIVE, ElementCEO)

    Note: The OrgElement type is used to configure several specific options:
    • tooltip,
    • background color of element,
    • background image of element,
    • font for title and content,
    • orientation of element.

Adding child elements

Adding child elements into an Organization Chart control is performed by OrgAddChild. This function accepts two syntaxes:
  • syntax used to specify the element characteristics: title, content, ...
    OrgAdd(ORG_NoName1, "Emma")
    OrgAddChild(ORG_NoName1, 1, "Paul Martin")
    OrgAddChild(ORG_NoName1, 1, "Florence Mitchell")
    OrgAddChild(ORG_NoName1, 3, "Gary Prince")
    OrgAddChild(ORG_NoName1, 3, "John Desanti")
  • syntax that is using an OrgElement variable.
    // Add elements into the Organization Chart control
    // Root element
    ElementCEO is OrgElement
    ElementCEO..Title = "Big Boss"
    OrgAdd(ORG_EXECUTIVE, ElementCEO)

    // Child elements
    Element2 is OrgElement
    Element2..Title = "Production"
    OrgAddChild(ORG_EXECUTIVE, 1, Element2)

    Element3 is OrgElement
    Element3..Title = "Sales"
    OrgAddChild(ORG_EXECUTIVE, 1, Element3)

    The ..BrushColor property of OrgElement variable is used to define a display color for an element. If no background color is defined, the Organization Chart control will automatically use the default color.

Deleting an element

OrgDelete is used to delete an element (as well as its children) from an Organization Chart control.
// Deletes the element 15 and its children
OrgDelete(ORG_MyOrganizationChart, 15)
OrgDeleteAll is used to delete all the elements found in an Organization Chart control.
Handling an element found in the Organization Chart control
The elements found in an Organization Chart control are handled via their subscripts. Each element found the Organization Chart control is associated with an identifier (subscript). This subscript is returned:
This subscript is used by all the functions for handling elements (selection, deletion, ...).
To handle or modify a specific element found in the organization chart, you must:
  • define an OrgElement variable.
  • assign it to the requested element of the organization chart.
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 modify the orientation of an element found in the organization chart, use the ..Orientation90 property of the OrgElement type. Therefore, a child element can be displayed on the right of its parent.
For example:
The following code is used to change the orientation of the element that was clicked:
// Select an element of ORG_NoName1
ORG_NoName1[ORG_NoName1]..Orientation90 = NOT ORG_NoName1[ORG_NoName1]..Orientation90
Properties specific to Organization Chart controls
The following properties are used to manage an Organization Chart control by programming.
ElementHeight..ElementHeight 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..ElementOrientation is used to find out and modify the orientation of an Organization Chart control
ElementWidth..ElementWidth 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..MaxLeafPerRow is used to find out and modify the maximum number of elements per row in an Organization Chart control
Occurrence..Occurrence is used to find out the number of elements found in a set.
Vertical..Vertical is used to:
  • find out whether a control is oriented horizontally or vertically.
  • modify the display direction of Table and Looper controls (switch from vertical to horizontal and conversely)
Zoom..Zoom allows you to find out and modify the zoom value used:
  • 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 window.
To find out the entire list of WLanguage properties that can be used with an Organization Chart control, see Properties associated with the Organization Chart control.
Minimum required version
  • Version 17
Comments
Click [Add] to post a comment