VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 123456789[10] ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 20:57:15 03/23/00 Thu
Author: Michel
Subject: Re: Mouse handler
In reply to: Mahan 's message, "Mouse handler" on 15:48:54 03/23/00 Thu


Hi Mahan,

Bill is correct, you need to create a mouse handler class to capture mouse events on a TImageScrollBox. By default the TImageScrollBox needs to capture the mouse events primarily for the "drag" display mode.

Creating a mouse handler is a bit of work but it allows change the mouse behavior on the TImageScrollBox without changing the source code of the TImageScrollBox itself.

Here's a code skeleton that will show you how to get the mouse coordinates.

Create a class derived from TMouseHandler and override the MouseMove event.


uses
EnImgScr; { for TMouseHandler }


TYourMouseHandler = class(TMouseHandler)
public
procedure MouseMove( const Shift : TShiftState;
const X, Y : Integer ); override;
end;

implementation

procedure TYourMouseHandler.MouseMove(
const Shift : TShiftState;
const X, Y : Integer );
begin
{
You have the X,Y coordinates of the mouse here.
The ImageScrollBox property of the TMouseHandler gives
you access to the image scroll box.
}
end;

Now when you want to use you mouse handler:

ImageScrollBox.MouseMode := mmUser;
ImageScrollBox.MouseHandler := TYourMouseHandler.Create(ImageScrollBox);

Best regards,

Michel





> Hi
> Maybe this is a repost but i need to know the position
> of the mouse cursor on ImageScrollBox in order to
> stamp on the image at a certain point and i couldnt
> find variables that return X,Y for this purpose on the
> events of this control. I couldnt find OnMouseMove
> event (like the native ImageBox of delphi that returns
> the pos) although it has such property for
> MouseHandler.
> Anyway, i dont know how to get the position, can you
> please show me how can i have the coordinates (X,Y)
> when i move the mouse over the ImageScrollBox control
> by an example code.
> thanks in advance
> mahan

[ Next Thread | Previous Thread | Next Message | Previous Message ]

[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.