ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Project functions
  • Enumerating the panes in a Tab or Ribbon control
  • Enumerating the panes of a Sidebar control
  • Limit
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
EnumSubElement (Function)
In french: EnumèreSousElément
Enumerates the subelements of a project element. This function can be run even if the element is not opened.
In a loop, this function can be used to enumerate the controls found in a window (or in a page) of a project.
Note: This function cannot be used on reports or queries.
WINDEVReports and QueriesUser code (UMC)
// Énumération des champs d'une fenêtre d'un projet
NomChamp is string = EnumèreSousElément("MaFenêtre", enumFirst)
// Parcours tous les champs
WHILE NomChamp <> ""
	Trace(NomChamp)
	// Passage au champ suivant
	NomChamp = EnumSubElement("MaFenêtre")
END
WINDEVReports and QueriesUser code (UMC)
// Parcours des volets d'un champ Onglet
NomChamp is string = EnumèreSousElément("FEN_Fenêtre1.Onglet1", enumFirst + enumPane)

// Parcours de tous les volets du champ Onglet
WHILE NomChamp <> ""
	// Passage au volet suivant
	Trace(NomChamp)
	NomChamp = EnumSubElement("FEN_Fenêtre1.Onglet1", enumPane)
END
WEBDEV - Server codeAjax
// Énumération des champs d'une page d'un projet
NomChamp is string = EnumèreSousElément("MaPage", enumFirst)
// Parcours tous les champs
WHILE NomChamp <> ""
	Trace(NomChamp)
	// Passage au champ suivant
	NomChamp = EnumSubElement("MaPage")
END
WINDEVReports and QueriesUser code (UMC)
// Parcours des champs d'une fenêtre et affichage de leur type et libellé.
sParent is string = "FEN_SAISIE_CLIENT"
sNomChamp is string = EnumèreSousElément(sParent, enumFirst)
WHILE sNomChamp <> ""

	// Nom complet du champ
	sNomComplet is string = sParent + "." + sNomChamp
	// Récupération du type de l'élément
	nType is int = {sNomComplet, indGPW}..Type

	// Si c'est un groupe de champs ou un champ Onglet
	IF nType = typTab OR nType = typTable OR nType = typToolbar OR ...
		nType = typToolbox OR nType = typSuperControl THEN
		// Enumération des champs qui sont à l'intérieur
		Trace(sNomComplet)
	ELSE
		// Ne fait rien si c'est une option de menu
		IF nType <> typMenuOption THEN
			// Ajout de l'élément dans la trace
			Trace(sNomComplet, nType, {sNomComplet, indGPW}..Caption, ...
				{sNomComplet, indGPW}..Group)
		END
	END

	// Champ suivant
	sNomChamp = EnumSubElement(sParent)
END
Syntax
<Result> = EnumSubElement(<Element> [, <Option>])
<Result>: Character string
  • Full name of the element found (<Window/Page name>.<Control name> for example),
  • Empty string ("") if no element was found.
<Element>: Character string
Full name of element to enumerate. For a control, this parameter has the following format: <Window/Page name>.<Control name> ("MyWindow.MyTable" for example).
<Option>: Optional constant
Parameter that must be specified during the first call to the function (to start the enumeration). This parameter is not required to continue the enumeration.
enumContextMenuEnumerates the context menus found in a window.
WEBDEV - Server code This constant is not available.
enumFirstStarts the enumeration
enumGroupEnumerates the groups found in a window or in a page
enumMainMenuEnumerates the drop-down menus found in a window. You can also use EnumMenu.
WEBDEV - Server code This constant is not available.
enumPaneEnumerates the tabs in a Tab or Ribbon control.
WEBDEV - Server code This constant is not available.
enumSideBarEnumerates the panes found in a sidebar.
WEBDEV - Server code This constant is not available.

Please note: the following combinations must be used to initialize the route:
  • enumFirst to enumerate the controls found in a window or in a page.
  • enumFirst + enumGroup to enumerate the groups in a window or page.
  • enumFirst + enumPane to enumerate the panes in a Tab or Ribbon control.
  • enumFirst + enumContextMenu to enumerate context menus.
  • enumFirst + enumSideBar to enumerate the tabs in a Sidebar control.
  • enumFirst + enumMainMenu to enumerate the main menus of a window or page.
Remarks
WINDEVReports and QueriesUser code (UMC)

Enumerating the panes in a Tab or Ribbon control

By default, when EnumSubElement is used on a Tab control, all the controls of all the panes are enumerated without displaying each pane.
If the enumPane constant is used, EnumSubElement enumerates the tab panes (but not the controls contained in those panes). The result is of type "<n>", where <n> is the number of the tab pane. To get the text of the tab, use the Caption property.
To enumerate the controls of each tab pane, run an enumeration on the pane, specifying its number:
EnumèreSousElement("<fenêtre>.<onglet>.<n>")
Note: The Count property is used to identify the number of panes in a Tab Control.
Example:
// Parcours des volets d'un champ Onglet
NomChamp is string = EnumèreSousElément("FEN_Menu.Ong_Visualisation", ...
			enumFirst + enumPane)

// Parcours de tous les volets d'onglet
WHILE NomChamp <> ""
	// Passage au volet suivant
	Trace(NomChamp)
	Trace(ONG_Visualisation[NomChamp].Libellé)
	// Parcours des champs du volet
	NomChamp2 is string = 
	NomChamp2 = EnumSubElement("FEN_Menu.Ong_Visualisation." + NomChamp, enumFirst)
	WHILE NomChamp2 <> ""
		Trace(NomChamp2)
		NomChamp2 = EnumSubElement("FEN_Menu.Ong_Visualisation." + NomChamp)
	END
	NomChamp = EnumSubElement("FEN_Menu.Ong_Visualisation", enumPane)
END
WINDEVReports and QueriesUser code (UMC)

Enumerating the panes of a Sidebar control

By default, when EnumSubElement is used on a Sidebar control, all the controls of all the panes are enumerated without displaying each pane.
When the enumSideBar constant is used, EnumSubElement enumerates all the tabs of the Sidebar control (but not the controls in the tabs). The result is of type "<n>.<caption>", where <n> is the number of the pane and <caption> is its caption.
To enumerate the controls of each tab in the Sidebar control, run an enumeration on the tab, specifying its number:
EnumèreSousElement("<Fenêtre/Page>.<Boîte à outils>.<n>")

Limit

This function cannot be used to enumerate the subelements of an element found in a component.
Business / UI classification: Neutral code
Component: wd300gpu.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help