View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001539 | JEDI VCL | 00 JVCL Components | public | 2004-03-29 01:49 | 2004-04-01 08:39 |
Reporter | Dierk | Assigned To | user72 | ||
Priority | normal | Severity | trivial | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0001539: TJvXPBarItem new bug | ||||
Description | Added changes in "ActionChange" makes no sense. Belongs to changes in issue 0001535 "if (CheckDefaults or .... )" and "if not CheckDefaults or .... " Should be: procedure TJvXPBarItem.ActionChange(Sender: TObject; CheckDefaults: Boolean); begin if Action is TCustomAction then with TCustomAction(Sender) do begin if (not CheckDefaults or Update()) then // mw added to update action begin if Self.Caption = '' then Self.Caption := Caption; if Self.Enabled then Self.Enabled := Enabled; if Self.Hint = '' then Self.Hint := Hint; if Self.ImageIndex = -1 then Self.ImageIndex := ImageIndex; if Self.Visible then Self.Visible := Visible; if not Assigned(Self.OnClick) then Self.OnClick := OnExecute; end; end; end; Regards Dierk | ||||
Tags | No tags attached. | ||||
|
Why should the "not CheckDefaults" checks be removed? |
|
Ok, maybe like this: Without "not", nothing would taken from actions in runtime! if Action is TCustomAction then with TCustomAction(Sender) do begin if((not CheckDefaults) or Update()) then // mw added to update action <<-- It must be "not checkDefaults" begin if not CheckDefaults or (Self.Caption = '') then Self.Caption := Caption; if not CheckDefaults or Self.Enabled then Self.Enabled := Enabled; if not CheckDefaults or (Self.Hint = '') then Self.Hint := Hint; if not CheckDefaults or (Self.ImageIndex = -1) then Self.ImageIndex := ImageIndex; if not CheckDefaults or Self.Visible then Self.Visible := Visible; if not CheckDefaults or not Assigned(Self.OnClick) then Self.OnClick := OnExecute; end; end; |
|
See also 0001533 |
|
The (not CheckDefaults) check doesn't work: the items aren't updated from their actions at run-time in this case. |
|
In my program this works fine. At runtime -Creating a new item -Creating a new action -assigning the new action to item.action BTW: What should this be with "not checkDefaults"? |
|
The problem is if you assign actions at design-time, they show up as "(not assigned)" at run-time. I don't fully understand the purpose of the CheckDefaults parameter but using "if not CheckDefaults or Update then" doesn't work in this scenario and assigning at design-time is far more common that doing it at run-time. So until we have a solution that works with both, the current implementation will be kept. If you can come up with a solution that works both in design and run-time, please post it here. |
|
Looking in controls.pas will maybe help. Shouldn´t it be: if Sender is TCustomAction then //<<-"Sender" instead of "Action"! with TCustomAction(Sender) do begin if(Update()) then // and in this line only check update?? |
|
Duh! Why didn't I think of that?! I'll check... |
|
Seems to work both at design as well as run-time. Neither CheckDefaults nor Update is needed AFAICS |
|
Yop! It seems to be good, now. It was a really long track to fix this. :) |
|
> It was a really long track to fix this. :) Mostly my fault: I should have checked available implementations before posting incomplete solutions :) Fixed in CVS |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-03-29 01:49 | Dierk | New Issue | |
2004-03-29 13:06 | remkobonte | Note Added: 0003501 | |
2004-03-29 22:33 | Dierk | Note Added: 0003503 | |
2004-03-30 11:51 |
|
Status | new => resolved |
2004-03-30 11:51 |
|
Resolution | open => fixed |
2004-03-30 11:51 |
|
Assigned To | => user72 |
2004-03-30 11:51 |
|
Note Added: 0003521 | |
2004-04-01 00:41 |
|
Status | resolved => feedback |
2004-04-01 00:41 |
|
Resolution | fixed => reopened |
2004-04-01 00:41 |
|
Note Added: 0003548 | |
2004-04-01 00:49 | Dierk | Note Added: 0003549 | |
2004-04-01 02:33 |
|
Note Added: 0003552 | |
2004-04-01 03:42 | Dierk | Note Added: 0003562 | |
2004-04-01 04:23 |
|
Note Added: 0003565 | |
2004-04-01 04:48 |
|
Note Added: 0003566 | |
2004-04-01 06:41 | Dierk | Note Added: 0003569 | |
2004-04-01 08:39 |
|
Status | feedback => resolved |
2004-04-01 08:39 |
|
Resolution | reopened => fixed |
2004-04-01 08:39 |
|
Note Added: 0003571 |