AlienHeadDiscs
Programmer
- Aug 25, 2007
- 1
I am using an Action Manager and Action lists and have associated Actions to a ActionMainMenuBar and to some Category buttons. The problem I am having is that when I try and disable an Action it will show as disabled on the Menu but the Category buttons are still active.
Another issue is when I set the Checked property to true it will add a highlight square around the menu item but will not do the same to the Category buttons. So to work around that I tried changing the glyph to be a check mark to show that it is checked, but what happens is the new glyph is updated on the Category buttons but the Glyph is not updated on the menu items. So no matter what I have tried I can't get them both to be synchronized and that is the main reason for using Actions!
I must not be doing something that needs to be done so if there is anyone with suggestions I would like to hear them. Thanks.
Below is how I am changing the glyph and setting the enabled property.
In an updateControls proc that is called after most UI use cases I have the below code.
actOrderMainHtm is a TAction
...
if not fileExists(AddBackSlash(gBldFolder) + gBldStr + '.htm') then
begin
actOrderMainHtm.Enabled := false;
end; // bldStr.htm file exists
After the button is pressed that executes the Action the below code is ran at the end of the proc
...
actOrderMainHtm.Checked := False;
actOrderMainHtm.ImageIndex := 1; // Default is 0
...
Another issue is when I set the Checked property to true it will add a highlight square around the menu item but will not do the same to the Category buttons. So to work around that I tried changing the glyph to be a check mark to show that it is checked, but what happens is the new glyph is updated on the Category buttons but the Glyph is not updated on the menu items. So no matter what I have tried I can't get them both to be synchronized and that is the main reason for using Actions!
I must not be doing something that needs to be done so if there is anyone with suggestions I would like to hear them. Thanks.
Below is how I am changing the glyph and setting the enabled property.
In an updateControls proc that is called after most UI use cases I have the below code.
actOrderMainHtm is a TAction
...
if not fileExists(AddBackSlash(gBldFolder) + gBldStr + '.htm') then
begin
actOrderMainHtm.Enabled := false;
end; // bldStr.htm file exists
After the button is pressed that executes the Action the below code is ran at the end of the proc
...
actOrderMainHtm.Checked := False;
actOrderMainHtm.ImageIndex := 1; // Default is 0
...