CommandBar Buttom Speed
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=459
Printed Date: 27 November 2024 at 2:12am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: CommandBar Buttom Speed
Posted By: jiri
Subject: CommandBar Buttom Speed
Date Posted: 20 February 2004 at 4:13pm
Hi,
I use CommandBar for navigation in table (database). There is long delay between two CommandBars1_Execute events. Standard vb Toolbar (windows common control) has no delay.
Is there any property for delay in CommandBar?
Thanks
Jiri
|
Replies:
Posted By: SuperMario
Date Posted: 20 February 2004 at 8:45pm
No, there is no deley setting for the execute event. I think this may be a bug. Anyone else have this problem?
|
Posted By: Boyd
Date Posted: 21 February 2004 at 7:52am
Yes... I've seen the same problem. I was worried that it had to do with my implementation, but I have a delay as well. I hope this is something that can be resolved.
|
Posted By: Oleg
Date Posted: 23 February 2004 at 11:34am
Sorry, I don't understand what delay do you mean. In the SDISample I changed
Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl) Select Case Control.Id
... Case ID_FILE_SAVE: Debug.Print Control.Caption
And see "Save" each time I click button without any delay...?
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: SuperMario
Date Posted: 23 February 2004 at 11:44am
I think the problem only occurs when pulling data from a
database. I don't think there is a delay when writing to a
database. So when the problem occurs is when navigating records
in a database, one record is displayed, the "next record" button is
clicked, then a long delay before the data is displayed.
|
Posted By: Boyd
Date Posted: 23 February 2004 at 11:57am
The problem occurs no matter what you're doing with the button. I've created a very basic sample application which illustrates the problem. The form includes a single CommandBar control and a list box. Click the control and the listbox gets a new item. No matter how quickly you click the control, the items are not added to the listbox at a comparable rate. The ZIP file includes full source to the project in VB6 as well as an 'DelayTest.exe' file which can be executed as long as you have CommandBars ActiveX registered. I hope this helps isolate and debug the issue with the delay.
http://forum.codejock.com/uploads/Boyd/9Z4_TestApp.zip - 9Z4_TestApp.zip
|
Posted By: SuperMario
Date Posted: 23 February 2004 at 12:09pm
Boyd, I tried your sample and do not see anything I would call a
delay. There is a delay, but it is so small it is hard to
notice. Is this a long delay for you? I was assuming that the
problem accured when pulling data from a database. I am using
WinXp if that makes any difference. Maybe someone who know Flash
can create a small movie of this delay in action.
|
Posted By: Boyd
Date Posted: 23 February 2004 at 12:30pm
No, it's not a long delay (about half a second). But it's enough to be noticed when you're trying to execute the same command very quickly. This delay issue is evident in the Xtreme Command Bars Designer tool. The 'Controls' pane has a list of all your controls, and the toolbar has an 'up' and 'down' arrow for you to move a control up and down the list. Now let's say you have 50 controls in the control list and you want to move the one from the bottom of the list to the top. After I select the control to move, I'll have to click the 'up' button about 50 times. I can easily click the 'up' button about twice as fast as the command bar recognizes it. If it had processed all of my clicks, I could have accomplished my task twice as fast.
I've updated the sample app I provided to include a standard command button. Click this button rapidly and see how much faster it processes the click event. Seeing the two controls perform side-by-side will better illustrate the delay.
http://forum.codejock.com/uploads/Boyd/D8C_TestApp.zip - D8C_TestApp.zip
|
Posted By: SuperMario
Date Posted: 23 February 2004 at 12:44pm
Yes, there is a noticable difference, but nowhere near half a
second. The fact that there is any difference at all proves there
is a problem shomwhere. On both buttons the text is displayed
before I hear the second click from my mouse (The mouse clicks once
when presses, and again when released). This is nowhere near half
a second. I would say the faster button is about 1.25 times as
fast on my system.
|
Posted By: Boyd
Date Posted: 23 February 2004 at 1:11pm
SuperMario wrote:
Yes, there is a noticable difference, but nowhere near half a second |
Individual systems will certainly perform differently. I just wanted to illustrate that there is a noticeable difference.
|
Posted By: robs
Date Posted: 23 February 2004 at 2:01pm
Just my 2 cents...
I've noticed this as well, but wouldn't categorize it as a delay, but rather:
The Execute event doesn't allways fire when pressing a commandBar button. On my system (P4 2.7 GHZ 1 GIG RAM) I have to wait a second between my button presses or the Execute event won't fire.
This is how the posted sample and CodeJock samples work on my system.
|
Posted By: SuperMario
Date Posted: 23 February 2004 at 2:15pm
Sounds like this acts different on everyones system. My system is
a P4 2.6 GHZ with 1 GIG RAM running WinXP and I do not have to wait
when a second between button presses. This may be why this goes
unoticed. There must be a problem because we all agree that this
does not happen with the toolbar created with windows common controls.
|
Posted By: robs
Date Posted: 23 February 2004 at 2:27pm
I've had other 3rd party controls that act similar to this. In other cases, it has been when they are triggering an even (such as Execute) on mouseUp rather than mouseDown of the control. Not to say that's the case here...
It would be nice to get feedback from some of the other users on the forum about this.
SuperMario: Do you have to wait at all between button clicks?
|
Posted By: SuperMario
Date Posted: 23 February 2004 at 2:44pm
I finally figured out what you are talking about. Yes, depending
on what the button does it can take longer than a second to finish,
none of the standard control do this. I think the problem may be
how the Execute event is being called. I think that when the
command bars control calls the Execute event it waits until the
event is done before releasing control to the application. This
is not noticable when clicking buttons such as the New File, Save,
Copy, Paste, etc because they all execute really fast. But if the
button does something that cannot be executed fast you notice it waits
until the process is done before releasing control back to the app. Maybe this is the way it is supposed to act.
|
Posted By: robs
Date Posted: 23 February 2004 at 6:45pm
SuperMario: Thanks for double checking. I don't think it's a matter of 'the process finishing', but that's a good theory. I think if that was the case then the 'Execute' events that are missing would be on the call stack and would eventualy be fired.
Oleg: Mixing your sample above and Boyd's..
Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl) Select Case Control.Id
... Case ID_FILE_SAVE:
Static iClick As Integer iClick = iClick + 1 Me.Caption = iClick
The caption only updates (roughly) every other click for me. Not alot of code to execute. I'd be curious to know if others are experiencing the same problem.
|
Posted By: robs
Date Posted: 23 February 2004 at 6:57pm
Sorry for stretching this out for so long. Just to make another observation about this. I modified Boyd's Form_Load to this:
CommandBars.Item(1).Visible = False With CommandBars.Add("Standard", xtpBarTop) .Controls.Add xtpControlButton, ID_TEST, "Click Me Rapidly", -1, False .Controls.Add xtpControlButton, ID_TEST + 1, "Me Too", -1, False End With
And noticed that if you click rapidly between 2 different buttons, this problem doesn't occur (at least for me). Which leads me to believe that when this problem occurs on one single button, the commandBars is treating rapid clicks as 'double clicks' instead of rapid clicks, which it's not set up to handle?
I'll be done now!
|
Posted By: SuperMario
Date Posted: 23 February 2004 at 9:53pm
Robs, you could be on to something there. When clicking rapidly
it could be missing some clicks because it interprets them as a
double-click. But that still doesn't account for buttons taking
up to a second to be used again. Who knows, maybe the buttons
status is not getting updated and is still thinking the mouse is
pressed down.
I think I'm finished with this one too. Hopefully Oleg can reproduce the problem and fix it if there is a problem.
|
Posted By: mark
Date Posted: 24 February 2004 at 9:59am
For me it always seems to call Execute half as many times as it should if I do button clicks as fast as I can. For example if I do 10 very fast clicks I get 5 items in the listbox, if I do 20 clicks I get 10 items. This implies to me that it is the double-click message not being handled properly. CommandBars seems to be interpreting the second click in each pair of clicks as a double click and doing nothing. This also seems to be the case when looking at the messages received by the button when clicked 10 times rapidly. See attached Winspector images - the left image is the CommandBars button and the right the standard button.
Doesn't quite make sense since the CommandBars button seems to call Execute on a mouse button up rather than a down and there are 10 ups in each case.
Mark
http://forum.codejock.com/uploads/mark/Mouse_Clicks.zip - Mouse_Clicks.zip
|
Posted By: Oleg
Date Posted: 24 February 2004 at 2:21pm
Thank you all. Really CommandBars was ignored DblClick event. In Next version DblClick event will be used as Click.
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: mark
Date Posted: 25 February 2004 at 4:48am
Having said that, it would be quite useful for CommandBars to recognise a double-click and generate an event. This could be then used, as in Microsoft Word, for two-state buttons to permanently set a mode in the application. For example in Word on the drawing toolbar, if you click the Rectangle button it allows you to draw one rectangle before it switches back into normal text editing mode. However, if you double-click the Rectangle button, Word stays in 'rectangle mode' and allows you to keep adding rectangles until you switch manually to another mode.
This feature would be quite useful in CommandBars. Maybe it should be optional, set by a Property.
Mark
|
Posted By: Boyd
Date Posted: 25 February 2004 at 7:53am
Mark makes a great point. Instead of treating all double-click events as a click event, they could be handled differently. If the developer didn't want to treat double-click events differently, just set an option telling Command Bars to report a double-click as a click.
Oleg, I hope this is an alternative implementation you might consider.
|
Posted By: robs
Date Posted: 25 February 2004 at 7:58am
I agree. I wouldn't have a use for the doulbe-click, but I'm sure there are other developers that would. I hope were not pushing Oleg's buttons now...
|
|