ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Options and actions
  • What is an element?
  • Handling an element
  • Handling a second-level element
  • Special cases: Data file or query fields
  • Handling a third-level element
  • Special Cases: Menu Options
  • Retrieving the name of an element in the code
  • Overview
  • Retrieving the name of an element by Drag and Drop
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Referring to an element in a WLanguage event / process
What is an element?
The table below presents the different elements found in an application:
ElementSecond-level elementThird-level element
Window
  • Window controls
  • Window menus
  • Cells of a status bar
  • Controls belonging to a supercontrol or to a toolbar
  • Menu options
  • Table columns
Page
Frameset
  • Page controls
  • Page menus
Table columns
Report
  • Report controls
  • Report blocks
Table columns
QueryQuery items
Data fileItems of a data file
The menu options and the items found in a data file are handled differently. For more details, see Special case: Headings and Special case: Menu options.
Remark: To simplify the writing of WLanguage processes, WINDEV, WINDEV Mobile and WEBDEV can easily retrieve the name of an element in a code window.. For more details, see Retrieving the name of an element in the code.
Handling an element
To handle a page, window, report, query or data file in a WLanguage event or process, simply use the name of this element. This name can be used:
  • in a WLanguage function.
  • with a WLanguage property.
  • in direct assignment.
For example:
// Initialisation et exécution de la requête REQ_ListeClient
HExecuteQuery(REQ_ListeClient)

// Modification du nombre d'exemplaires de l'état ETAT_Client
ETAT_Client.NbCopie =10

// Récupération du titre de la fenêtre FEN_FenRecherche
ResTitre is string = FEN_FenRecherche

// Récupération du titre de la page PAGE_PageRecherche
ResTitre is string = PAGE_PageRecherche
Handling a second-level element
To handle a second-level element (control or menu of a window/page, control or block of a report, etc.) in a WLanguage event or process, simply:
  • use the name of this second-level element directly. This syntax is valid only if this second-level element is handled from the window (or from the report) to which it belongs.
  • or use the following notation: "<NomElément>.<NomElément2°Niveau>".
A second-level element can be handled:
  • in a WLanguage function.
  • with a WLanguage property.
  • in direct assignment.
For example:
// Déroule la liste du champ Combo COMBO_VilleFrance 
// de la fenêtre FEN_Client
ComboOpen(COMBO_VilleFrance)
// équivalent à: ComboOuvre(FEN_Client.COMBO_VilleFrance)

// Modification de la couleur de fond du champ ChTotalHT
// dans l'état ETAT_Commande
ChTotalHT.CouleurFond = LightBlue
// équivalent à ETAT_Commande.ChTotalHT.CouleurFond = BleuClair

// Initialisation du champ de saisie SAI_Ville de la 
// fenêtre FEN_Client depuis une autre fenêtre
FEN_Client.SAI_Ville = "Montpellier"

// Rafraîchissement de la zone répétée ZR_ZoneProduit
// à partir du début de la zone répétée
LooperDisplay(ZR_ZoneProduit, taStart)
// équivalent à: ZoneRépétéeAffiche(PAGE_PageClient.ZR_ZoneProduit, taDébut)

Special cases: Data file or query fields

To handle an item in a data file or query through programming, simply:
  • use the name of the item directly. This syntax is valid only if the item is handled by a function or by a property into which the name of the data file or the name of the query to which the item belongs is specified.
  • or use the following syntax: "<NomFichier/NomRequête>.<NomRubrique>".
For example:
// Affectation dans la rubrique CP du fichier de données Client
// de la valeur saisie dans le champ SAI_CodePostal
CLIENT.CP = SAI_CodePostal

// Avance jusqu'au 2000ième enregistrement
// du fichier CLIENT selon la rubrique NOMCLI
HReadFirst(CLIENT, NOMCLI)
HForward(CLIENT, NOMCLI, 1999)
Handling a third-level element
To handle a third-level element (control within a supercontrol, toolbar, table column, etc.) in a WLanguage event or process, simply:
  • use the name of this third-level element directly. This syntax is valid only if the following conditions are fulfilled:
    • this third-level element is handled from the second-level element to which it belongs (supercontrol, toolbar or table).
    • no other third-level element uses the same name.
  • use the following notation if the 3rd level element is manipulated from the window (or state) to which it belongs: "<NomElément2°Niveau>.<NomElément3°Niveau>".
  • or use the following notation if the 3rd level element is manipulated from another window (or another state): "<NomElément>.<NomElément2°Niveau>.<NomElément3°Niveau>".
A third-level element can be handled:
  • in a WLanguage function.
  • with a WLanguage property.
  • in direct assignment.
For example:
// Modification de la largeur de la colonne COL_NomClient
// Aucune autre colonne COL_NomClient n'est présente dans la fenêtre
COL_NomClient.Largeur += 10

// Modification du nombre de caractères maximum du champ SAI_Police
// appartenant au superchamp SC_SchStyle depuis la fenêtre du superchamp
SC_SchStyle.SAI_Police.Taille += 10

// Modification de la hauteur du champ SAI_Police appartenant à la
// barre d'outils BAR_Style depuis une autre fenêtre
FEN_Client.BAR_Style.SAI_Police.Hauteur += 10
WINDEVWindowsUser code (UMC)

Special Cases: Menu Options

To handle a menu option through programming, you must:
  • use the name of the option directly. This syntax is valid only if the menu option is handled from the menu or from the window associated with the menu.
  • or use one of the following syntaxes: "<NomFenêtre>.<NomOption>" or "<NomFenêtre>.<NomMenu>.<NomOption>".
For example:
// Changement de la couleur de la police de l'option OPT_FicheClient
// du menu MENU_Client depuis la fenêtre de ce menu
OPT_FicheClient.Couleur = DarkBlue

// Changement de la couleur de la police de l'option OPT_FicheClient
// du menu MENU_Client depuis une autre fenêtre
FEN_Client.MENU_Client.OPT_FicheClient.Couleur = DarkBlue
// équivalent à: FEN_Client.OPT_FicheClient.Couleur = BleuFoncé
Retrieving the name of an element in the code

Overview

To retrieve the name of an element (regardless of its level) in the code:

Retrieving the name of an element by Drag and Drop

To retrieve the name of an element by Drag and Drop:
  1. Select the element whose name must be retrieved:
  2. Keep the left mouse button down while moving the element:
  3. Release the mouse button at the location where the name of the element should be used. The name of the dropped element is displayed.
See also
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/19/2024

Send a report | Local help