Extension Methods
Posted: Tue Aug 07, 2018 4:53 pm
Hi Wolfgang,
i read your answer in the italian forum - with a little help of Google - about Extensions. I´ve tested it with a Vulcan class and i´m impressed how seamless it works ! Sure, you can´t access class vars, but better that route than no way to go
regards
Karl-Heinz
i read your answer in the italian forum - with a little help of Google - about Extensions. I´ve tested it with a Vulcan class and i´m impressed how seamless it works ! Sure, you can´t access class vars, but better that route than no way to go
Code: Select all
BEGIN NAMESPACE ControlExtensions
STATIC CLASS TabcontrolExtensions
STATIC METHOD GetAllControlsFromPage( SELF o AS Tabcontrol, iIndex AS INT ) AS ARRAY
LOCAL symPage AS SYMBOL
IF ( symPage := o:__GetSymbolFromIndex( iIndex - 1 )) != NULL_SYMBOL
RETURN o:GetAllControlsFromPage( symPage )
ELSE
RETURN {}
ENDIF
STATIC METHOD GetAllControlsFromPage( SELF o AS Tabcontrol, symPage AS SYMBOL ) AS ARRAY
LOCAL oWin AS Window
IF ( oWin := (Window) o:GetTabPage( symPage ) ) != NULL_OBJECT
RETURN oWin:GetAllChildren()
ELSE
RETURN {}
ENDIF
END CLASS
END NAMESPACE
Karl-Heinz