AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control Organigrama
  • Presentación
  • Manipular controles Organigrama mediante programación
  • Adding a root element
  • Adding child elements
  • Deleting an element
  • Manipular un elemento en un control Organigrama
  • Changing the orientation of an element
  • Propiedades específicas de los controles Organigrama
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Presentación
An Organization Chart control can be:
  • manipulated programmatically.
  • linked to a data file.
WINDEV includes Organization Chart functions to programmatically manipulate Organization Chart controls.
This help page explains how to programmatically manipulate Organizational Chart controls.
Manipular controles Organigrama mediante programación

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 for specifying element characteristics: title, image, etc, ...
    Example:
    // Ajoute un élément racine 
    ORGA_DRH.Ajoute("Emma Moutier")

    Note The <Organization Chart>.add function inserts an image into the element (to the left of the text).
  • syntax that handles a variable of type OrgElement.
    // Ajout d'éléments dans le champ Organigramme
    // Elément Racine
    ElémentPDG is OrgElement
    ElémentPDG..Title = "Big Boss"
    ORGA_DIRECTION.Ajoute(ElémentPDG)

    Note Using the OrgElement type allows you to configure many 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

Adding child elements into an Organization Chart control is performed by <Organization Chart>.AddChild. This function accepts two syntaxes:
  • syntax for specifying element characteristics: title, content, etc, ...
    ORGA_SansNom1.Ajoute("Emma")
    ORGA_SansNom1.AjouteFils(1, "Paul Moulin")
    ORGA_SansNom1.AjouteFils(1, "Florence Marcellin")
    ORGA_SansNom1.AjouteFils(3, "Gilles Preau")
    ORGA_SansNom1.AjouteFils(3, "Jérome Deschamps")
  • syntax that handles a variable of type OrgElement.
    // Ajout d'éléments dans le champ Organigramme
    // Elément Racine
    ElémentPDG is OrgElement
    ElémentPDG.Title = "Big Boss"
    ORGA_DIRECTION.Ajoute(ElémentPDG)
    
    // Eléments fils
    Elément2 is OrgElement
    Elément2.Title = "Production"
    ORGA_DIRECTION.AjouteFils(1, Elément2)
    
    Elément3 is OrgElement
    Elément3.Title = "Vente"
    ORGA_DIRECTION.AjouteFils(1, Elément3)

    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

<Organization Chart>.Delete is used to delete an element (as well as its children) from an Organization Chart control.
// Supprime l'élément 15 et ses fils
ORGA_MonOrganigramme.Supprime(15)
<Organization Chart>.DeleteAll is used to delete all elements found in an Organization Chart control.
Manipular un elemento en un control Organigrama
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.
For example:
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
Propiedades específicas de los controles Organigrama
The following properties are specific to programming Organization Chart control..
CountThe Count property returns the number of elements in a given set.
ElementHeightLa propiedad ElementHeight permite:
  • Averiguar o modificar la altura de los elementos de un control Organigrama.
  • Averiguar o modificar la altura de las celdas de un control Cuadro de mando.
ElementOrientationLa propiedad ElementOrientation permite obtener y cambiar la orientación de un control Organigrama.
ElementWidthLa propiedad ElementWidth permite:
  • Averiguar o modificar la anchura de los elementos de un control Organigrama.
  • Averiguar o modificar el ancho de las celdas de un control Cuadro de mando.
MaxLeafPerRowThe MaxLeafPerRow property gets and sets the maximum number of elements in a row in an Organization Chart control.
VerticalLa propiedad Vertical se utiliza para:
  • determinar si un control está orientado horizontal o verticalmente.
  • Cambia la orientación de los controles de la Mesa y del Looper (pasa de vertical a horizontal y a la inversa)..
ZoomLa propiedad Zoom obtiene o establece el valor del zoom:
  • en un control Imagen.
  • en un control Mapa.
  • en un control Organigrama.
  • en un control Tabla, Tabla TreeView, Tabla dinámica, Hoja de cálculo o List Box.
  • en un control Procesador de texto.
  • en un control Lector PDF.
  • en un control Cámara.
  • en un control Editor de diagramas;
  • en una ventana.
For a complete list of WLanguage properties that can be used with Organization Chart controls, see Organization Chart control properties.
Versión mínima requerida
  • Versión 23
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 26/09/2024

Señalar un error o enviar una sugerencia | Ayuda local