Print Page | Close Window

EnableActions() problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=12624
Printed Date: 15 June 2025 at 2:17pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: EnableActions() problem
Posted By: MadRiver
Subject: EnableActions() problem
Date Posted: 06 November 2008 at 1:44pm
Hello,

Immediately after creating the CommandBars object I call EnableActions.

I add several Actions, and several menu items referencing the actions.

However, when I disable an action the menu item referencing that action is still enabled. Nothing happens when the user clicks on the menu item, as expected, since the Action is disabled.

Are thee other steps I have to take to update the Enabled state of all controls that refer to an Action (when the state of the Action changes)?

Thanks for advice...



Replies:
Posted By: Oleg
Date Posted: 07 November 2008 at 5:09am
Hi,
 
Have work automatically.
Check our Actions sample. All you need is to create actions before menu items.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: MadRiver
Date Posted: 07 November 2008 at 8:43am
Originally posted by oleg oleg wrote:

Hi,
All you need is to create actions before menu items.


This is very alarming. Are you saying that all actions must be created before menu items/toolbar controls?
That after actions are created and menu items reference them, no more actions can be added?
If so, this is a dreadful limitation.


Posted By: Oleg
Date Posted: 10 November 2008 at 2:15am
I don't say this.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: MadRiver
Date Posted: 10 November 2008 at 8:15am
I believe I am taking the same steps the ActionsSample program is taking:
-- Call EnableActions after creating the CommandBars control, before creating any Actions or controls.
-- Add an Action
-- Add a menu item referring to the Action

As far as I can tell, the only difference between the ActionsSample and my code is that the ActionsSample creates all the Actions before creating any menu items.
My code creates an Action, then the menu item referring to the Action; creates an Action, then a menu item; etc.

-------------
Xtreme CommandBars ActiveX v 12.1.0



Posted By: Oleg
Date Posted: 10 November 2008 at 11:29am
Hi,
Lets continue in issuetrack. It have to be something in your code.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Andrew666
Date Posted: 28 December 2008 at 11:35am
If its of any interest, I had just the same problem --- I was using a RibbonBar with the CommandBar and I could create actions without error - but unless I created them BEFORE the ribbonbar controls, none of the action properties were executed --- i.e. I could set Enabled etc. without error, but they made no difference to the state of the control.

As soon as I created the actions before the controls, I could then do everything as per the documentation.

Regards


--Andrew


Posted By: rmcmanamy
Date Posted: 04 September 2009 at 12:49am
I've ran into the same problem but only with the Enabled action.  Visible works fine but not enabled.  This is a huge dissapointment in the product seeing how we have hundered of controls and it's rediculous to have to add the actions first when each control is supposed to have an action to begin with.  I'm very dissapointed that this has not been resolved yet to say the least.


Posted By: Oleg
Date Posted: 04 September 2009 at 11:04am
Hi,
 
Are you sure you call EnableActions before you create these controls ??


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rmcmanamy
Date Posted: 04 September 2009 at 12:14pm
Yes.  I finally tracked it down to some code I had added in to Enable\Disable all controls.  In that I was looping through all the controls in the menu.  When I changed that to test if an action existed based on a range of my ID's then it works.  But it was strange before that it only was the Enable that didn't work, the Visible worked fine still.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net