AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones de proyectos
  • Enumerating the panes in a Tab or Ribbon control
  • Enumerating the panes of a Sidebar control
  • Limit
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
EnumSubElement (Function)
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.
Reportes y Consultas
// Enumerate the controls found in a project window
ControlName is string = EnumSubElement("MyWindow", enumFirst)
// Navigate through all controls
WHILE ControlName <> ""
	Trace(ControlName)
	// Go to the next control
	ControlName = EnumSubElement("MyWindow")
END
Reportes y Consultas
// Navigate through the tabs of a Tab control
ControlName is string = EnumSubElement("WIN_Window1.Tab1", enumFirst + enumPane)

// Navigate through the tabs of the Tab control
WHILE ControlName <> ""
	// Go to the next tab
	Trace(ControlName)
	ControlName = EnumSubElement("WIN_Window1.Tab1", enumPane)
END
Reportes y Consultas
// Navigate through the window controls and display their type and caption.
sParent is string = "WIN_EDIT_CUSTOMER"
sControlName is string = EnumSubElement(sParent, enumFirst)
WHILE sControlName <> ""

	// Full name of the control
	sFullName is string = sParent + "." + sControlName
	// Retrieve the type of the element
	nType is int = {sFullName, indGPW}..Type

	// If it is a group of controls or a Tab control
	IF nType = typTab OR nType = typTable OR nType = typToolbar OR ...
		nType = typToolbox OR nType = typSuperControl THEN
		// Enumerate the controls found inside
		Trace(sFullName)
	ELSE
		// No action if it is a menu option
		IF nType <> typMenuOption THEN
			// Add the element into the trace
			Trace(sFullName, nType, {sFullName, indGPW}..Caption, ...
				{sFullName, indGPW}..Group)
		END
	END

	// Next control
	sControlName = EnumSubElement(sParent)
END
Sintaxis
<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.
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.
enumPaneEnumerates the tabs in a Tab or Ribbon control.
enumSideBarEnumerates the panes found in a sidebar.

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.
Observaciones
Reportes y Consultas

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:
EnumSubElement("<window>.<tab>.<n>")
Note: The Count property is used to identify the number of panes in a Tab Control.
Example:
// Navigate through the tabs of a Tab control
ControlName is string = EnumSubElement("WIN_Menu.Tab_View", ...
			enumFirst + enumPane

// Navigate through the tab panes
WHILE ControlName <> ""
	// Go to the next tab
	Trace(ControlName)
	Trace(TAB_View[ControlName].Caption)
	// Navigate through the tab controls
	ControlName2 is string = 
	ControlName2 = EnumSubElement("WIN_Menu.Tab_View." + ControlName, enumFirst)
	WHILE ControlName2 <> ""
		Trace(ControlName2)
		ControlName2 = EnumSubElement("WIN_Menu.Tab_View." + ControlName)
	END
	ControlName = EnumSubElement("WIN_Menu.Tab_View", enumPane)
END
Reportes y Consultas

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:
EnumSubElement("<Window/Page>.<SideBar>.<n>")

Limit

This function cannot be used to enumerate the subelements of an element found in a component.
Clasificación Lógica de negocio / UI: Código neutro
Componente: wd300gpu.dll
Ver también
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

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