Help needed (update event Commandbars) |
Post Reply |
Author | |
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
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
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.
|
|
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 |