ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

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
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
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.
Remark: This function cannot be used on the reports or on the queries.
WINDEVReports and QueriesUser code (UMC)
// 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
WINDEVReports and QueriesUser code (UMC)
// 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
WEBDEV - Server codeAjax
// Enumerate the controls found in a project page
ControlName is string = EnumSubElement("MyPage", enumFirst)
// Navigate through all controls
WHILE ControlName <> ""
Trace(ControlName)
// Go to the next control
ControlName = EnumSubElement("MyPage")
END
WINDEVReports and QueriesUser code (UMC)
// 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
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 popup 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 panes 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.

Caution: to start the navigation, use the following combinations:
  • 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 panes 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:
EnumSubElement("<window>.<tab>.<n>")
Remark: The Count property can be used to get the number of panes of 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
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:
EnumSubElement("<Window/Page>.<SideBar>.<n>")

Limit

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

Last update: 05/26/2022

Send a report | Local help