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
0002558 [JEDI VCL] 00 JVCL Components major always 2005-01-26 11:54 2005-02-14 12:38
Reporter Dominik View Status public  
Assigned To user72
Priority normal Resolution fixed  
Status resolved   Product Version 3.00 BETA 2
Summary 0002558: JvNavPaneToolPanel-Buttons being clicked do not trigger Action.OnExecute-Event
Description I 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 Information I'm using D5Ent, Update Pack 1
Tags No tags attached.
Attached Files zip file icon NavPane-Test.zip [^] (707 bytes) 2005-02-11 05:43

- Relationships

-  Notes
(0006344)
obones (administrator)
2005-02-03 00:31

Please provide an example project (Zip file) and indicate which version of the JVCL and JCL you are using.
(0006457)
anonymous (viewer)
2005-02-11 05:50

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.
(0006458)
Dominik (reporter)
2005-02-11 08:23
edited on: 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!

(0006473)
Dominik (reporter)
2005-02-12 09:50

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.
(0006494)
user72
2005-02-14 12:38

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


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