CommandBar Buttom Speed |
Post Reply |
Author | |
jiri
Newbie Joined: 31 October 2003 Location: Czech Republic Status: Offline Points: 38 |
Post Options
Thanks(0)
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
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
No, there is no deley setting for the execute event. I think this may be a bug. Anyone else have this problem?
|
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
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.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Sorry, I don't understand what delay do you mean. In the SDISample I changed Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl) ...
And see "Save" each time I click button without any delay...? |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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.
Edited by SuperMario |
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
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. |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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.
|
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
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.
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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.
|
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
Individual systems will certainly perform differently. I just wanted to illustrate that there is a noticeable difference. |
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
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.
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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.
|
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
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?
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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.
Edited by SuperMario |
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
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) ... Static iClick As Integer 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.
|
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
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 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!
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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. |
|
mark
Newbie Joined: 23 October 2003 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
mark
Newbie Joined: 23 October 2003 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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 |
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
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. |
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
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...
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |