Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003244 [JEDI VCL] 00 JVCL Components minor always 2005-09-28 10:32 2006-06-08 03:33
Reporter nuclearspike View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0003244: TJvXPBar's items ignore overridden captions and always use TAction's caption
Description Typically, 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).
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0008030)
nuclearspike (reporter)
2005-10-14 12:49
edited on: 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);
to
  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.

(0008145)
obones (administrator)
2005-11-22 09:27

Could you then please try to find a more acceptable way to make it work ?
(0008152)
nuclearspike (reporter)
2005-11-23 11:26

I'd imagine just basing it off of TMenuItem or TButton's method of doing it
(0008872)
obones (administrator)
2006-04-04 05:16

Could you be so kind as to investigate your proposal?
(0009442)
obones (administrator)
2006-06-08 03:33

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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker