PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview
  • Handling the Organization Chart control through 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
An Organization Chart control can be:
  • handled through 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 through programming.
Handling the Organization Chart control through 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:
    // Ajoute un élément racine
    OrgAdd(ORGA_DRH, "Emma Moutier")

    Remark: OrgAdd is used to insert an image into the element (on the left of the text).
  • syntax that handles an OrgElement variable.
    // Ajout d'éléments dans le champ Organigramme
    // Elément Racine
    ElémentPDG is OrgElement
    ElémentPDG.Title = "Big Boss"
    OrgAdd(ORGA_DIRECTION, ElémentPDG)

    Remark: 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(ORGA_SansNom1, "Emma")
    OrgAddChild(ORGA_SansNom1, 1, "Paul Moulin")
    OrgAddChild(ORGA_SansNom1, 1, "Florence Marcellin")
    OrgAddChild(ORGA_SansNom1, 3, "Gilles Preau")
    OrgAddChild(ORGA_SansNom1, 3, "Jérome Deschamps")
  • syntax that handles 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 Property ColorFond of the Variable OrgElement allows 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.
// Supprime l'élément 15 et ses fils
OrgDelete(ORGA_MonOrganigramme, 15)
OrgDeleteAll is used to delete all elements found in an Organization Chart control.
Handling an element found in the Organization Chart control
The elements of an Organization Chart control are handled via their subscripts. Each element of the Organization Chart control is associated with an identifier (subscript). This subscript is returned:
This subscript is used by all functions for handling elements (selection, deletion, ...).
To handle or modify a specific element in the Organization Chart control, simply:
  • define an OrgElement variable.
  • assign the desired element of the Organizational Chart control to it.
Then, the element can be handled by the OrgElement properties.
For example:
MonElément is OrgElement
MonElément = ORGA_MonOrganigramme[2]
 
Trace(MonElément.Title)

Changing the orientation of an element

It is possible to change the orientation of an element of the Organization Chart control using the Property Orientation90 of the type OrgElement. 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:
// Sélection d'un élément de ORGA_SansNom1
MonElément is OrgElement
MonElément = ORGA_SansNom1[ORGA_SansNom1]
MonElément.Orientation90 = NOT MonElément.Orientation90
ORGA_SansNom1[ORGA_SansNom1] <- MonElément
Properties specific to Organization Chart controls
The following properties are used to manage an Organization Chart control through programming.
CountThe Count property returns the number of elements in a given set.
ElementHeightThe 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.
ElementOrientationThe ElementOrientation property is used to get and change the orientation of an Organization Chart control.
ElementWidthThe 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.
MaxLeafPerRowThe MaxLeafPerRow property is used to get and change the maximum number of elements in a row in an Organization Chart control.
VerticalVertical 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).
ZoomThe Zoom property is used to get or change 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 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 version required
  • Version 17
Comments
Click [Add] to post a comment