FrameBar and shelltree onclick event

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #51536
    mol
    Participant
      #51537
      Dennis445
      Participant

        I 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.

        #51538
        mol
        Participant

          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

          #51539
          Dennis445
          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

            #51540
            mol
            Participant

              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

              #51541
              Dennis445
              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

              Viewing 6 posts - 1 through 6 (of 6 total)
              • You must be logged in to reply to this topic.