Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - CommandBar Buttom Speed
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CommandBar Buttom Speed

 Post Reply Post Reply
Author
Message
jiri View Drop Down
Newbie
Newbie


Joined: 31 October 2003
Location: Czech Republic
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote jiri Quote  Post ReplyReply Direct Link To This Post Topic: CommandBar Buttom Speed
    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

 

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.


Edited by SuperMario
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post 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.

9Z4_TestApp.zip

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post 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.

D8C_TestApp.zip

 

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2004 at 1:11pm

Originally posted by SuperMario 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.

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post 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.

 

 

 

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post 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?

 

 

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.


Edited by SuperMario
Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post 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.

 

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post 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!

 

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
mark View Drop Down
Newbie
Newbie


Joined: 23 October 2003
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mark Quote  Post ReplyReply Direct Link To This Post 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

Mouse_Clicks.zip

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mark View Drop Down
Newbie
Newbie


Joined: 23 October 2003
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mark Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post 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...

 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.