Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

draw line component

Posted on 2001-06-07
3
Medium Priority
?
153 Views
Last Modified: 2010-04-06
hi,

Draw line on canvas is very easy (with Tcanvas).

but to detect when the mouse is on/over that line is not.

I try to search some component but did not find,

any one know component for that purpose.

10x
Asi

0
Comment
Question by:asi
3 Comments
 
LVL 8

Accepted Solution

by:
Cesario earned 200 total points
ID: 6166642
Hi asi,

try this component:
http://www.efg2.com/lab/Graphics/LineStretch.htm

Best regards

Cesario
0
 
LVL 3

Expert Comment

by:f15iaf
ID: 6166779
l
0
 

Expert Comment

by:BuD
ID: 6166858
Try this component i wrote. It has 2 events (OnMouseenter & OnMouseExit).


unit BNS_Shape;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls;

type
  TBNS_Shape = class(TShape)
  private
   FOnMouseEnter : TNotifyEvent;
   FOnMouseExit : TNotifyEvent;
   Leaving : Boolean;
  protected
   procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
   procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
  public
    { Public declarations }
  published
   property OnMouseEnter : TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
   property OnMouseExit : TNotifyEvent read FOnMouseExit write FOnMouseExit;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('BNS Controls', [TBNS_Shape]);
end;

{ TBNS_Shape }

procedure TBNS_Shape.CMMouseEnter(var Message: TMessage);
begin
 if not (csDesigning in ComponentState) then
  begin
   if Assigned(FOnMouseEnter) then
    FOnMouseEnter(Self);
  end;
end;

procedure TBNS_Shape.CMMouseLeave(var Message: TMessage);
begin
 if Leaving then exit;
 Leaving := True;
 try
  if not (csDesigning in ComponentState) then
   begin
    if Assigned(OnMouseExit) then
     FOnMouseExit(Self);
   end;
 finally
  Leaving := False;
 end;
end;

end.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question