I found many program they use syntax ":Name :=" and ":Parent :=" to assign the name and the parent.
Some time ago, Mauricio and me have introduced a change for which the name and the parent must be defined when using the New method.
On the other hand, I think the Parent method is dangerous, because it does not take care about Qt parent. This is the current code:
Code: Select all
METHOD Parent( oValue ) CLASS CONTROL
IF PCOUNT() == 0
RETURN ::oParent
ENDIF
// If the parent is already the one, do nothing
IF VALTYPE(::oParent) == "U" .OR. oValue:cName != ::oParent:Name
// Remove from the old parent stack
IF VALTYPE(::oParent) != "U"
::oParent:ChildRemove( ::cName )
ENDIF
::oParent := oValue
// Add to the new parent stack
::oParent:ChildAdd( ::cName, Self )
ENDIF
RETURN NIL
Code: Select all
METHOD Name() CLASS BASIC
RETURN ::cName
Code: Select all
METHOD Parent() CLASS CONTROL
RETURN ::oParent
Could you please tell me if can I proceed?
Cheers