- This topic has 6 replies, 2 voices, and was last updated 11 years, 4 months ago by
Dennis445.
-
AuthorPosts
-
February 11, 2014 at 6:33 pm #51536
mol
ParticipantFebruary 11, 2014 at 6:56 pm #51537Dennis445
ParticipantI looked at that but it's only useful on the when creating the frame, what I need is to access the shelltree's onclick mouse event outside of the framebars – frame – create event. I would rather have the code on the main form or in a unit instead of on the frames form so far I haven't had any luck.
February 11, 2014 at 7:13 pm #51538mol
ParticipantWhat are you doing in the OnClick event? If you don't have to access or manipulate the selected file for example, you could simply write a separate procedure which can be called from both the ShellTree and the main form.
Code:procedure DoSomething;
begin
{…}
end;procedure ShellTreeClick;
begin
DoSomething;
end;-Uwe
February 11, 2014 at 7:40 pm #51539Dennis445
Participant'mol' wrote:What are you doing in the OnClick event? If you don't have to access or manipulate the selected file for example, you could simply write a separate procedure which can be called from both the ShellTree and the main form.
Code:procedure DoSomething;
begin
{…}
end;procedure ShellTreeClick;
begin
DoSomething;
end;-Uwe
Thanks for all the reply's mol, Sorry I don't think I'm explaining myself correctly I don't want to add any code to the frame that contains the shelltree because it's being used as an instance on several other forms that individual manage how the shelltree works.
Thanks
Dennis
February 11, 2014 at 7:51 pm #51540mol
ParticipantDennis
Why don't you assign the procedure to the ShellTree's OnClick event dynamically then?
Code:public
TNotifyEvent = procedure(Sender: TObject) of object;procedure TForm1.TreeClick(Sender: TObject);
begin
{…}
end;TFrame1(sFrameBar1.Items[0].Frame).ShellTree.OnClick := TreeClick; // After an instance of the frame has been created
-Uwe
February 11, 2014 at 8:03 pm #51541Dennis445
Participant'mol' wrote:Dennis
Why don't you assign the procedure to the ShellTree's OnClick event dynamically then?
Code:public
TNotifyEvent = procedure(Sender: TObject) of object;procedure TForm1.TreeClick(Sender: TObject);
begin
{…}
end;TFrame1(sFrameBar1.Items[0].Frame).ShellTree.OnClick := TreeClick; // After an instance of the frame has been created
-Uwe
I will have to look in to that, I didn't even think about a notify event.
Thanks again for your help
Dennis
-
AuthorPosts
- You must be logged in to reply to this topic.