Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Toolbar Update Logic
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbar Update Logic

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


Joined: 13 April 2006
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote cgaskill Quote  Post ReplyReply Direct Link To This Post Topic: Toolbar Update Logic
    Posted: 06 February 2008 at 1:25pm
I am utilizing version 9.7 of the XtremeCommandBars control.  Do to the number of controls and the complexity of the update logic we do not want to handle the CommandBars_Update event to perform our control enabling/disabling.  I have written a routine that will find a control based upon it's ID and call the Enable method.  This works fine for the Menu items; however the corresponding toolbar control (with the same ID) does not get disabled.

Is there a way to update the enable status of a control other than the Update event?
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post Posted: 06 February 2008 at 8:37pm
Yes, you need to use Actions.

1. Call CommandBars.EnableActions
2. Add controls to CommandBars as usual
3. Add Actions to Commandbars e.g.
CommandBars.Actions.Add ID_FILE_NEW,"","","",""

4. To enable control call
CommandBars.Actions(ID_FILE_NEW).Enabled=True
and all instances of that control id will be enabled.

See also ActionsSample
Back to Top
cgaskill View Drop Down
Newbie
Newbie


Joined: 13 April 2006
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote cgaskill Quote  Post ReplyReply Direct Link To This Post Posted: 06 February 2008 at 9:23pm
Unfortunately, the Actions are not available in version 9.7.
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: 06 February 2008 at 9:40pm

Hi,

You already have a routine to enable/disable menu items, why not create a routine that finds the control in the toolbar?

Back to Top
cgaskill View Drop Down
Newbie
Newbie


Joined: 13 April 2006
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote cgaskill Quote  Post ReplyReply Direct Link To This Post Posted: 07 February 2008 at 9:32am
Okay, maybe I jumped the gun here.  My routine does go thru all the command bars (menu and toolbar).  But for some reason my toolbar was not being updated.  I started a test app to attach to this thread and it is working as expected.  So, must be in my logic that goes thru all the command bars and grabs the controls.

Sorry for the false alarm.
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.141 seconds.