Tom and Chris -
I had fears that this change could fail under some situations, in particular, the "parent".
I suggest, to prevent an error, that :parent be changed to :setParent().
I tested this with a very large application, but that may have been insufficient.
DCPushButtonXP is slow if I use the Hide option
Re: DCPushButtonXP is slow if I use the Hide option
The eXpress train is coming - and it has more cars.
Re: DCPushButtonXP is slow if I use the Hide option
Hi Tom,
I checked the :WhenHideEval method of some objects, and saw the difference for the dcstatusbar and the dcstatic. The dcstatic:WhenHideEval is using his own code, and is not changed by the modification of the _WhenHideEval function.
When I add the modifications to the DC_XbpStatic:WhenHideEval method, I have the same strange results as you noticed. A dcbrowse with a HIDE clause on a static doesn't show up anymore.
I checked the :WhenHideEval method of some objects, and saw the difference for the dcstatusbar and the dcstatic. The dcstatic:WhenHideEval is using his own code, and is not changed by the modification of the _WhenHideEval function.
When I add the modifications to the DC_XbpStatic:WhenHideEval method, I have the same strange results as you noticed. A dcbrowse with a HIDE clause on a static doesn't show up anymore.
Re: DCPushButtonXP is slow if I use the Hide option
Hi All,
The previous code I posted was wrong!
With my tests the code below seems to work for my application.
The previous code I posted was wrong!
With my tests the code below seems to work for my application.
Code: Select all
STATIC FUNCTION _WhenHideEval( lEnable, lShow, lProtect, oXbp )
if IsMethod(oXbp,'PARENT') .AND. (!oXbp:parent:isVisible().or. oXbp:parent:isDerivedFrom('XbpTabPage').and.oXbp:parent:Minimized ))
return oXbp
endif
...
Re: DCPushButtonXP is slow if I use the Hide option
Chris -
I think you have the best solution.
Thank you.
I think you have the best solution.
Thank you.
The eXpress train is coming - and it has more cars.
Re: DCPushButtonXP is slow if I use the Hide option
Code: Select all
...oXbp:parent:Minimized )) <------
Code: Select all
...oXbp:parent:Minimized )
best regards
Hans
Hans
Re: DCPushButtonXP is slow if I use the Hide option
Hi, Chris.
"PARENT" is not a method, but an iVar. So it should be:
Right?
Anyway, Roger mentioned using SetParent() would be better here. I'm waiting for his opinion.
"PARENT" is not a method, but an iVar. So it should be:
Code: Select all
IsMemberVar(oXpb,"Parent")
Anyway, Roger mentioned using SetParent() would be better here. I'm waiting for his opinion.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: DCPushButtonXP is slow if I use the Hide option
Tom -
I never noticed that Chris didn't use IsMemberVar().
That should have been sufficient.
:parent is an iVar of each Xbase parts class and it was not implemented until 1.9.
There is a possibility that it may not be implemented in some classes.
Whereas :setParent() is a method of XbPartHandler the documentation states that it always returns an object.
XbpPartHandler:setParent()
Sets or returns the parent of the Xbase Part.
:setParent( [<oXbp>] ) --> oldParent
Parameters
<oXbp>
<oXbp> optionally specifies an Xbase Part as the parent of the object executing the method.
Return
This method returns the previous parent (Xbase Part) that was current before the method was called.
Description
The :setParent() method returns the parent of an Xbase Part or specifies a new parent. The parent is also an Xbase Part. In most cases it is the same as the return value of the function SetAppWindow() or a dialog. A parent defines a physical relationship between two Xbase Parts (the parent-child relationship). The object executing the :setParent() method is the child. Therefore, the following expression is always greater than 0:
AScan( self:setParent():childList(), self )
This expression illustrates that an Xbase Part always has a parent and that it is always contained in the child list of its parent. This relationship is significant when programming dialogs because the dialog and all of its elements are available, regardless of which one is referenced by a memory variable. When a reference to a dialog (XbpDialog) is contained in a memory variable oXbp, all of the Xbase Parts it contains as children are returned using oXbp:childList(). If the memory variable oXbp contains only the reference to a dialog element such as a pushbutton (XbpPushbutton), the dialog can be determined using oXbp:setParent() and the other dialog elements contained in the dialog (siblings) can be found using oXbp:setParent():childList().
I never noticed that Chris didn't use IsMemberVar().
That should have been sufficient.
:parent is an iVar of each Xbase parts class and it was not implemented until 1.9.
There is a possibility that it may not be implemented in some classes.
Whereas :setParent() is a method of XbPartHandler the documentation states that it always returns an object.
XbpPartHandler:setParent()
Sets or returns the parent of the Xbase Part.
:setParent( [<oXbp>] ) --> oldParent
Parameters
<oXbp>
<oXbp> optionally specifies an Xbase Part as the parent of the object executing the method.
Return
This method returns the previous parent (Xbase Part) that was current before the method was called.
Description
The :setParent() method returns the parent of an Xbase Part or specifies a new parent. The parent is also an Xbase Part. In most cases it is the same as the return value of the function SetAppWindow() or a dialog. A parent defines a physical relationship between two Xbase Parts (the parent-child relationship). The object executing the :setParent() method is the child. Therefore, the following expression is always greater than 0:
AScan( self:setParent():childList(), self )
This expression illustrates that an Xbase Part always has a parent and that it is always contained in the child list of its parent. This relationship is significant when programming dialogs because the dialog and all of its elements are available, regardless of which one is referenced by a memory variable. When a reference to a dialog (XbpDialog) is contained in a memory variable oXbp, all of the Xbase Parts it contains as children are returned using oXbp:childList(). If the memory variable oXbp contains only the reference to a dialog element such as a pushbutton (XbpPushbutton), the dialog can be determined using oXbp:setParent() and the other dialog elements contained in the dialog (siblings) can be found using oXbp:setParent():childList().
The eXpress train is coming - and it has more cars.