Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Help needed (update event Commandbars)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help needed (update event Commandbars)

 Post Reply Post Reply
Author
Message
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Topic: Help needed (update event Commandbars)
    Posted: 29 January 2008 at 11:37am

I have several toolbars in different forms, but in some forms the CommandBars_Update event keeps firing (well about 20 times a second) for no reason. I know I can set the update rate to a value but I don't want that. I wonder why this is happening. Normally this event is fired when something is clicked (this seems to be the case in the other forms and this is what I want, 1 click > 1 update ). Can someone explain to me why this happens or what to do about it. Please don't tell me its'a bug, in that case I will burst in

Thanx in advance
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: 29 January 2008 at 12:00pm
Hi,
Its designed. If you don't need Update handler just create some Sub and call it from Execute event.
or update controls state using Actions - CommandBars.Actions(ID_FILE_COPY).Enabled = False
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 29 January 2008 at 12:51pm

I know its designed. But why does it work with 1 toolbar and NOT with the other one. Several toolbars in my project fire only 1 event for every button in it and one toolbar keeps firing events for every button all the time even when nothing is being pressed.

 
I don't want to handle the updating, it would be easier to use the Commandbars_Update handler since some buttons needs to be updated from various functions in my app. Not just the click event
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: 29 January 2008 at 1:13pm
Hello,
Maybe other toolbars in disabled window or you change it in code or don't have controls with Id > 0.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 29 January 2008 at 3:06pm
Oleg,
 
It looks like the event is generated by another CommandBar. I monitored the events and the id - 9148 and 9149 comes every time (this in a regular FORM). The id - 9148 came with events generated by an commandbar in a USERCONTROL (these update events are generated as they should be, one time for every button).
 
Are 9148 and 9149 id's generated by CommandBars? 
 
Let me explain what I want:
I have a form with a toolbar for positioning areas (left,top,width.height) , this is the mainview. Then I have a USERCONTROL with also a toolbar for positioning items like the one in the form, these will be the subviews.
 
On the form and every USERCONTROL a commandbar control is placed
The buttons for the toolbars will be added in the formLoad event. Like this for the USERCONTROL:
 
''Add commandbar
Set toolBarSubViews = CommandBarSubviews.Add("Tools subview", xtpBarTop)
        
AddButton CommandBarSubviews(1).Controls, xtpControlComboBox, ID_TOOLBAR_COMBOCONTROLITEMS, "", True, "Select item for positioning"
and for every button needed....   
 
 
for the FORM:
 
Dim generalTools As CommandBar
    Set generalTools = CommandBarViews.Add("General", xtpBarTop)
        generalTools.SetIconSize 32, 32
        generalTools.EnableDocking xtpFlagFloating
    AddButton generalTools.Controls,  xtpControlEdit, ID_TOOLBAR_EDITUNITS, "Units", False, "Settings editing views", xtpButtonCaption
 
and for every button needed....   
 
The AddButton function I copied from a sample in CommandBars

So all of the buttons are defined in a resource. The only ID's which I cannot trace are 9148 and 9149.

Thanx in advance
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: 30 January 2008 at 1:23am
Hello,
9148 and 9149 are CommandBars buildin controls -
 
9148 is Expand button (XTP_ID_TOOLBAR_EXPAND)
9149 is Close button (XTP_ID_TOOLBAR_HIDE)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 30 January 2008 at 4:50am

Oleg,

Now I know why one toolbar is working correctly and the other ones keeps firing the events. I set CommandBarViews.Options.UpdatePeriod = 0 and now only 1 event for each control will be fired. This will do for now. The only thing I have to do is update the toolbar when external functions do some changes for the selected view.
 
Thank you for your time. Can you do another thing for me? Please look in Xtreme DockingPanes, I have posted a problem regarding resize events with DockingPaneManager. This is a serious problem and I don't think other members can solve this for me. Thank you very much. 
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.156 seconds.