DCPushButtonXP is slow if I use the Hide option

This forum is for eXpress++ general support.
Message
Author
User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

DCPushButtonXP is slow if I use the Hide option

#1 Post by PedroAlex »

Hi Roger!
I hope you're well.

I have noticed that if I use the HIDE Option in the DcPushBuutonXP command, the button's reaction is very slow.
This takes performance and speed away from touch keyboards and gives an aspect of slowness.
If you have 10 buttons without the HIDE option, you can click on all of them, as the reaction speed is normal.
but if the buttons have the HIDE option, the reaction is very slow.
Can you please check this situation.

many Thanks..

eXpress 267 and xB 2.0.1176
Pedro Alexandre

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

#2 Post by Tom »

Did you try any HIDE clause (like just {||.T.} or {||.F.}, without any other conditions)? Maybe the evaluation of the codeblock takes so much time - (cascading iterations and dependencies). I can't confirm DCPUSHBUTTONXPs are slow with HIDE clause. They must be a little slower when getting painted since ownerdrawing is used, but not that much. Can you track on a button how often the HIDE clause is evaluated?
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

#3 Post by rdonnay »

I agree with Tom.
You need to test your hide code block.

The below code is very simple and contains nothing that should affect the performance.

Code: Select all

METHOD DC_XbpPushButtonXP:WhenHideEval( lEnable, lShow, lProtect, nMode )

IF Valtype(::whenBlock) = 'B' .AND. ::parent:isEnabled()
   lEnable := Eval(::whenBlock,self)
   IF lEnable
     IF !::isEnabled()
       ::enable()
     ENDIF
   ELSE
     IF ::isEnabled()
       ::disable()
     ENDIF
   ENDIF
ENDIF

IF Valtype(::hideBlock) = 'B'
   lShow := !Eval(::hideBlock,self)
   IF lShow
      ::show()
   ELSE
      ::hide()
   ENDIF
ENDIF

IF Valtype(::protectBlock) = 'B'
  lProtect := Eval(::protectBlock,self)
ENDIF

RETURN self
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: DCPushButtonXP is slow if I use the Hide option

#4 Post by PedroAlex »

I thank you in advance for your availability.

But it turns out that I register a performance deficit when I use the Hide option in DCPushButtonXP.
My scenario is as follows, I have an application for bars and restaurants that has more than 500 buttons divided into tabs.
When I use the option "Hide" in the command "DcpushButtonXP" the application is very slow.
The application installed on an Intel J1900 processor, which is the most common in POS, is very slow and impossible to use.
Attached is an example that reproduces the problem.
If you disable the Hide option, everything is OK.

Not long ago there was also an evident slowness in creating the buttons, but Roger did an optimization and the problem was solved.

Try use this sample and try to be fast to click the buttons ..
Attachments
ButSlow.rar
(81.5 KiB) Downloaded 446 times
Pedro Alexandre

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

#5 Post by rdonnay »

Your problem is not the HIDE clause.
It is a problem in the ACTION that is causing the slowness.
This was reported by another customer earlier this year because it only showed on some slow computers.
That problem was fixed in the attached file.

Copy _DCXBUTT.PRG to your \exp20\source\dclipx folder.
Rebuild DCLIPX.DLL by running BUILD20.BAT
Attachments
_dcxbutt.zip
(22.92 KiB) Downloaded 475 times
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: DCPushButtonXP is slow if I use the Hide option

#6 Post by PedroAlex »

Roger,

Did you execute the sample I sent as an attachment?
The buttons have no "action" option!
Try clicking on several buttons in a row and quickly!
you will see that there is a very slow delay.
Then remove the HIDE options and test again.
The button's behavior is totally different, fast, normal ..
Can anyone else test run this sample and confirm if it identifies the situation?

Many Thanks!
Pedro Alexandre

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

#7 Post by rdonnay »

Did you rebuild your dclipx.dll with the file I sent?

What version of Xbase++ are you using?
Do you need me to send you a dclipx.dll ?
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: DCPushButtonXP is slow if I use the Hide option

#8 Post by PedroAlex »

Roger,
Of course I compiled dclipx.
Doesn't this behavior happen to you?
My Xbase version is 2.0.1185

Do me a favor and watch the attached video and test it with the attached program sample.
Attachments
Video.rar
(4.72 MiB) Downloaded 415 times
TecTouch.rar
(13 KiB) Downloaded 511 times
Pedro Alexandre

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

#9 Post by rdonnay »

Your program has 1040 owner-drawn pushbuttons and each one has a hide code block.

It means that every time you click a button, 1040 code blocks need to be run and each button needs to be redrawn.
This is a lot of owner-drawn objects to manage.

I made the below change to _DCXBUTT.PRG and it appears to fix the problem:

Code: Select all

METHOD DC_XbpPushButtonXP:WhenHideEval( lEnable, lShow, lProtect, nMode )

IF Valtype(::whenBlock) = 'B' .AND. ::parent:isEnabled()
   lEnable := Eval(::whenBlock,self)
   IF lEnable
     IF !::isEnabled()
       ::enable()
     ENDIF
   ELSE
     IF ::isEnabled()
       ::disable()
     ENDIF
   ENDIF
ENDIF

IF Valtype(::hideBlock) = 'B' .AND. ::parent:isVisible() ;
      .AND. IIF(::parent:isDerivedFrom('XbpTabPage'),IIF(::parent:Minimized,.f.,.t. ),.t. )
   lShow := !Eval(::hideBlock,self)
   IF lShow
      ::show()
   ELSE
      ::hide()
   ENDIF
ENDIF

IF Valtype(::protectBlock) = 'B'
  lProtect := Eval(::protectBlock,self)
ENDIF

RETURN self

The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: DCPushButtonXP is slow if I use the Hide option

#10 Post by PedroAlex »

It's much better now.
Thank you so much.
Pedro Alexandre

Post Reply