Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Component in Included file wont repsond.


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Jul 18, 2016 8:18 PM Last Post By: Bob Spencer
Bob Spencer

Posts: 26
Registered: 7/4/02
Component in Included file wont repsond.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 17, 2016 10:34 PM
Hi all

I have written code in my main unit for a new control type which works perfectly.
To make things easier to manage I moved the code into a new file that I include into the top of my project.
Since the move, the mouse events don't fire anymore.

What am I doing wrong?

CODE FROMTHE UNIT

unit Unit7;

interface

uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Imaging.jpeg,
Vcl.StdCtrls, SelectAndMove;

type
TForm7 = class(TForm)
Image1: TImage;
Image2: TImage;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form7: TForm7;
TD: TDragPanel;

implementation

{$R *.dfm}
{$REGION 'General Form'}

procedure TForm7.FormCreate(Sender: TObject);
begin
TD := TDragPanel.create(Self);
with TD do
begin
Parent := Form7;
top := 0;
left := 0;
width := 100;
height := 100;
end;
end;
{$ENDREGION 'General Form'}

end.

CODE FROM THE CONTROL

type
TCracker = Class(TControl);

TDragPanel = Class(TGraphicControl)
Private
procedure MouseEnter(Sender: TObject);
Protected
constructor create(AOwner: tComponent); override;
Public
End;

implementation

procedure TDragPanel.MouseEnter(Sender: TObject);
begin
Showmessage('Entered');
end;

Edited by: Bob Spencer on Jul 17, 2016 10:34 PM

Edited by: Bob Spencer on Jul 17, 2016 10:35 PM

Eli M

Posts: 1,346
Registered: 11/9/13
Re: Component in Included file wont repsond.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 18, 2016 7:50 AM   in response to: Bob Spencer in response to: Bob Spencer
Make sure HitTest on TDragPanel is true.
Bob Spencer

Posts: 26
Registered: 7/4/02
Re: Component in Included file wont repsond.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 18, 2016 3:40 PM   in response to: Eli M in response to: Eli M
Eli M wrote:
Make sure HitTest on TDragPanel is true.

Hi Eli M
I am using the VCL environment so there is no HitTest to set.

Thanks anyway :-)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Component in Included file wont repsond.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 18, 2016 4:19 PM   in response to: Bob Spencer in response to: Bob Spencer
Bob wrote:

I am using the VCL environment

Then why are you posting this in a FireMonkey forum? You should ask in a
VCL forum instead.

--
Remy Lebeau (TeamB)
Bob Spencer

Posts: 26
Registered: 7/4/02
Re: Component in Included file wont repsond.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 18, 2016 8:13 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Bob wrote:

I am using the VCL environment

Then why are you posting this in a FireMonkey forum? You should ask in a
VCL forum instead.

--
Remy Lebeau (TeamB)

Appologise.
Ill try to remove it.
Bob Spencer

Posts: 26
Registered: 7/4/02
Re: Component in Included file wont repsond.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 18, 2016 8:18 PM   in response to: Bob Spencer in response to: Bob Spencer
Bob Spencer wrote:
Remy Lebeau (TeamB) wrote:
Bob wrote:

I am using the VCL environment

Then why are you posting this in a FireMonkey forum? You should ask in a
VCL forum instead.

--
Remy Lebeau (TeamB)

Appologise.
Ill try to remove it.

I cant remove the post.
Sorry for the waste of time here people but I didn't realise that I was in the Firemonkey section.
Ill double check everything next time i'm posting anything.

I resolved the initial problem anyway.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02