DCPushButtonXP is slow if I use the Hide option

This forum is for eXpress++ general support.
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCPushButtonXP is slow if I use the Hide option

#21 Post by rdonnay »

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.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1188
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: DCPushButtonXP is slow if I use the Hide option

#22 Post by skiman »

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.
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1188
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: DCPushButtonXP is slow if I use the Hide option

#23 Post by skiman »

Hi All,

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
...
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCPushButtonXP is slow if I use the Hide option

#24 Post by rdonnay »

Chris -

I think you have the best solution.
Thank you.
The eXpress train is coming - and it has more cars.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: DCPushButtonXP is slow if I use the Hide option

#25 Post by hz_scotty »

Code: Select all

...oXbp:parent:Minimized ))  <------
should be

Code: Select all

...oXbp:parent:Minimized )
correct ?
best regards
Hans

User avatar
Tom
Posts: 1176
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DCPushButtonXP is slow if I use the Hide option

#26 Post by Tom »

Hi, Chris.

"PARENT" is not a method, but an iVar. So it should be:

Code: Select all

IsMemberVar(oXpb,"Parent")
Right?
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."

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCPushButtonXP is slow if I use the Hide option

#27 Post by rdonnay »

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().
The eXpress train is coming - and it has more cars.

Post Reply