Welcome! Log In Create A New Profile

Advanced

Enumerating Controls on a Tab?

Posted by Tom 
Tom
Enumerating Controls on a Tab?
January 01, 2009 02:48PM
Hi folks,

Anyone point me in the right direction for the syntax of looping thru controls on a Tab, I did it on a window using enumcontrol() but found out that this is no use if the controls are on a Tab.

Thanks

Tom
Jimbo
Re: Enumerating Controls on a Tab?
January 01, 2009 04:57PM
Hi Tom, the controls on a Tab sit on

WindowName.Tab[1].ControlName

otherwise a recursive enumeration will help:

Here's an enumeration for all elements of a window

// Fill the table with all window controls
// Entry:	sParent		Name of parent element - in this case it is the Window's name!
PROCEDURE FillAll(sParent)

// First window control
sControlName is string=EnumSubElement(sParent,enumFirst)
WHILE sControlName<>""

	// Full control name
	sFullName is string=sParent+"."+sControlName
	// Retrieve the element type
	nType is int={sFullName,indGPW}..Type
	
	// If this is a control group or a tab
	IF nType=typTab OR nType=typTable OR nType=typToolbar THEN
		// List the controls placed inside
		FillAll(sFullName)
	ELSE
		// No action if this is a MENU item
		IF nType<>typMenuOption THEN
			// Add the element to the table
			AddElement(sFullName,nType,{sFullName,indGPW}..Caption,{sFullName,indGPW}..Group)
		END
	END

	// Next control
	sControlName=EnumSubElement(sParent)
END

Regards,
Guenter
Tom
Re: Enumerating Controls on a Tab?
January 02, 2009 02:18AM
Guenter,

Thank you very much works a treat!

Tom
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: