View Issue Details

IDProjectCategoryView StatusLast Update
0003244JEDI VCL00 JVCL Componentspublic2006-06-08 03:33
ReporternuclearspikeAssigned Toobones 
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.30 
Summary0003244: TJvXPBar's items ignore overridden captions and always use TAction's caption
DescriptionTypically, with other buttons and menus, you can assign the TAction and it will change the Caption (of the Menu/Button) to match the TAction. You can then override that Caption to use something else. When you run the program, it will show your overridden caption. With the XPBar, when the program first loads, it will use the overridden caption but nearly instantly it will be changed to the TAction's caption -- which I do not want it to display (some are too long and contain accelerators which screw up the keyboard shortcuts for users).
TagsNo tags attached.



2005-10-14 12:49

reporter   ~0008030

Last edited: 2005-10-14 12:57

The problem is in:

TJvXPBarItem.ActionChange(Sender: TObject; CheckDefaults: Boolean);
if not CheckDefaults or (Self.Caption = '') or (Self.Caption = Self.Name) then
        Self.Caption := Caption;

When this function is called in TJvXPCustomWinXPBar.InitiateAction it passes "csLoading in ComponentState" for the "CheckDefaults" param. This means that when it loads initially, it will go through the proper checks, but every time after that (and it gets called more after that) it will change the Caption/Enabled/OnExecute/etc to the TAction's, ignoring the overrides since "not CheckDefaults" will ALWAYS eval as true when not loading, and thus stomp over my Caption with the TAction's.

To fix the problem, in the InitiateAction procedure, I changed:
  Items[I].ActionChange(Items[I].Action, csLoading in ComponentState);
  Items[I].ActionChange(Items[I].Action, True);

I also then changed the DoActionChange() procedure to pass True rather than False into ActionChange();

That corrected the problem for my needs. This would not be how the release would be, since the changes negate the purpose of even having the CheckDefaults param.


2005-11-22 09:27

administrator   ~0008145

Could you then please try to find a more acceptable way to make it work ?


2005-11-23 11:26

reporter   ~0008152

I'd imagine just basing it off of TMenuItem or TButton's method of doing it


2006-04-04 05:16

administrator   ~0008872

Could you be so kind as to investigate your proposal?


2006-06-08 03:33

administrator   ~0009442

This is now fixed in SVN, the loop in InitiateAction had no reason to call ActionChange but should have been calling the ActionLink.Update method.

Issue History

Date Modified Username Field Change
2005-09-28 10:32 nuclearspike New Issue
2005-10-14 12:49 nuclearspike Note Added: 0008030
2005-10-14 12:51 nuclearspike Note Edited: 0008030
2005-10-14 12:57 nuclearspike Note Edited: 0008030
2005-11-22 09:27 obones Note Added: 0008145
2005-11-22 09:27 obones Status new => feedback
2005-11-23 11:26 nuclearspike Note Added: 0008152
2006-04-04 05:16 obones Note Added: 0008872
2006-06-08 03:33 obones Status feedback => resolved
2006-06-08 03:33 obones Resolution open => fixed
2006-06-08 03:33 obones Assigned To => obones
2006-06-08 03:33 obones Note Added: 0009442