View Issue Details

IDProjectCategoryView StatusLast Update
0002558JEDI VCL00 JVCL Componentspublic2005-02-14 12:38
ReporterDominikAssigned Touser72 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 BETA 2 
Target VersionFixed in Version3.00 
Summary0002558: JvNavPaneToolPanel-Buttons being clicked do not trigger Action.OnExecute-Event
DescriptionI drop a JvNavPaneToolPanel,
create a Button in the JvNavPaneToolPanel,
create a normal TButton in my form,
drop an ActionList,
Create an Action,
connect the action to both buttons,
create an Action.OnExecute-Handler with does that:
ShowMessage('Executing Action1...');

Now run the Program. Clicking the TButton produces the Message. Clicking the Button in JvNavPaneToolPanel does nothing.

Very strange is, that nevertheless the Hint-Text is shown. Therefore it has nothing to do with the "Assign"-problem which were discussed a few weeks ago.
Additional InformationI'm using D5Ent, Update Pack 1
TagsNo tags attached.

Activities

obones

2005-02-03 00:31

administrator   ~0006344

Please provide an example project (Zip file) and indicate which version of the JVCL and JCL you are using.

2005-02-11 05:43

 

NavPane-Test.zip (707 bytes)

anonymous

2005-02-11 05:50

viewer   ~0006457

I just uploaded an example-Project. I'm using the daily-Zip-Version of JVCL of the 28.01.2005 and JCL1.93.
Still I didn't figure out, what's not working.

Dominik

2005-02-11 08:23

reporter   ~0006458

Last edited: 2005-02-12 09:50

[UPDATE 05-02-12] Please ignore this Posting - that's not working.

Finally I found the problem:

While loading the buttons the method "TJvCustomNavPaneToolPanel.ButtonsChanged" checks whether an action for the button is set and sets the InternalButtonClick-Method for the OnClick-Event. It must be checked if the ComponentState is csLoading.

Correctly working does it like that:

procedure TJvCustomNavPaneToolPanel.ButtonsChanged;
var
  I: Integer;
  B: TJvNavPanelToolButton;
begin
  if HeaderVisible then
    for I := 0 to Buttons.Count - 1 do
    begin
      B := Buttons[I].Button;
      B.Visible := False;
      B.SetBounds(0, 0, ButtonWidth - 3, ButtonHeight - 2);
      B.Images := Images;
      if not (csLoading in Self.ComponentState) then
        if B.Action = nil then
          B.OnClick := InternalButtonClick;
      B.Tag := I;
      B.Parent := Self;
    end;
  Invalidate;
end;

I would ask you to change this in further versions.

Thank you very much!

Dominik

2005-02-12 09:50

reporter   ~0006473

What I posted yesterday isn't working. I'm sorry.

Now I helped myself modifying the SetAction-Method like that:

procedure TJvNavPaneToolButton.SetAction(const Value: TBasicAction);
begin
  FRealButton.Action := Value;
  FRealButton.ActionChange(Value, false);
end;

That looks quite clean to me, because TJvNavPaneToolButton doesn't have a onClick-Event and like that it's working fine to me.

user72

2005-02-14 12:38

  ~0006494

Updated in CVS. Thanks

Issue History

Date Modified Username Field Change
2005-01-26 11:54 Dominik New Issue
2005-02-03 00:31 obones Note Added: 0006344
2005-02-03 00:31 obones Status new => feedback
2005-02-11 05:43 anonymous File Added: NavPane-Test.zip
2005-02-11 05:50 anonymous Note Added: 0006457
2005-02-11 08:23 Dominik Note Added: 0006458
2005-02-12 09:50 Dominik Note Added: 0006473
2005-02-12 09:50 Dominik Note Edited: 0006458
2005-02-14 12:38 user72 Status feedback => resolved
2005-02-14 12:38 user72 Resolution open => fixed
2005-02-14 12:38 user72 Assigned To => user72
2005-02-14 12:38 user72 Note Added: 0006494