PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Enumerating the panes found in the tabs (or in the ribbons)
  • Enumerating the panes found in a sidebar
  • Limit
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
EnumSubElement (Function)
In French: EnumèreSousElément
Allows you to enumerate the sub-elements 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 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)
// Browse all the controls
WHILE ControlName <> ""
Trace(ControlName)
// Go to the next control
ControlName = EnumSubElement("MyWindow")
END
WINDEVReports and QueriesUser code (UMC)
// Browse the panes in a tab control
ControlName is string = EnumSubElement("WIN_Window1.Tab1", enumFirst + enumPane)

// Browse all the panes
WHILE ControlName <> ""
// Go to the next pane
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)
// Browse all the controls
WHILE ControlName <> ""
Trace(ControlName)
// Go to the next control
ControlName = EnumSubElement("MyPage")
END
WINDEVReports and QueriesUser code (UMC)
// Browse 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
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 element found (<Window/Page Name>.<Control Name> for example),
  • Empty string ("") if no element was found.
<Element>: Character string (with quotes)
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.
enumSideBarEnumerates the panes found in a sidebar.
WEBDEV - Server code This constant is not available.
enumGroupEnumerates the groups found in a window or in a page
enumContextualMenuEnumerates the popup menus found in a window.
WEBDEV - Server code This constant is not available.
enumMainMenuEnumerates the drop-down menus found in a window. You also have the ability to use EnumMenu.
WEBDEV - Server code This constant is not available.
enumFirstInitializes the enumeration
enumPaneEnumerates the panes found in the tabs or ribbons.
WEBDEV - Server code This constant is not available.
Caution: the following combinations must be used to initialize the browse:
  • enumFirst to enumerate the controls found in a window or in a page
  • enumFirst + enumGroup to enumerate the groups found in a window or in a page
  • enumFirst + enumPane to enumerate the panes found in a tab or in a ribbon
  • enumFirst + enumContextualMenu to enumerate the popup menus
  • enumFirst + enumSideBar to enumerate the panes found in a sidebar
  • enumFirst + enumMainMenu to enumerate the main menus of a window or page
Remarks
WINDEVReports and QueriesUser code (UMC)

Enumerating the panes found in the tabs (or in the ribbons)

By default, EnumSubElement used on a tab enumerates all the controls found in all the panes without displaying the pane.
When the enumPane constant is specified, EnumSubElement used on a tab enumerates all the tabs (but not the controls found in the tabs). The result has the following format: "<n>" where <n> is the tab number. To find out the tab caption, use ..Caption.
To enumerate the controls found in each pane, an enumeration must be performed on the pane from its number:
EnumSubElement("<window>.<tab>.<n>")
Note: ..Occurrence is used to find out the number of tab panes.
WINDEVReports and QueriesUser code (UMC)

Enumerating the panes found in a sidebar

By default, EnumSubElement used on a sidebar enumerates all the controls found in all the panes without displaying the pane.
If the enumSideBar constant is specified, EnumSubElement used on a sidebar enumerates all the panes (but not the controls found in the panes). The result has the following format: "<n>.<caption>" where <n> is the number of the pane and <caption> its caption.
To enumerate the controls found in each pane, an enumeration must be performed on the pane from 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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230gpu.dll
Linux wd230gpu.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment