BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OnMouseWheel over TImage

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
Lapo Guidi
Guest





PostPosted: Mon May 17, 2004 7:09 pm    Post subject: OnMouseWheel over TImage Reply with quote



Hi all,
anybody already experienced on add an OnMouseWheel event handler on a
TImage?
Or, what I should do to add it?
Thanks in advance.

Lapo


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu May 20, 2004 8:04 pm    Post subject: Re: OnMouseWheel over TImage Reply with quote



"Lapo Guidi" <lapoguidi (AT) inwind (DOT) it> wrote


Quote:
anybody already experienced on add an
OnMouseWheel event handler on a TImage?
Or, what I should do to add it?

The OnMouseWheel... events depend on the CM_MOUSEWHEEL message, which in
turn depends on the WM_MOUSEWHEEL message being sent by the OS to a
control's window. TImage derives from TGraphicControl and as such does not
have a window of its own with which to receive OS messages directly. The
VCL has to dispatch the messages manually from the graphic control's Parent.

Why do you need mouse wheel events on a TImage? What exactly are you trying
to accomplish?


Gambit



Back to top
Lapo Guidi
Guest





PostPosted: Fri May 21, 2004 12:10 am    Post subject: Re: OnMouseWheel over TImage Reply with quote



Hi Gambit,

Quote:
The OnMouseWheel... events depend on the CM_MOUSEWHEEL message, which in
turn depends on the WM_MOUSEWHEEL message being sent by the OS to a
control's window. TImage derives from TGraphicControl and as such does
not
have a window of its own with which to receive OS messages directly. The
VCL has to dispatch the messages manually from the graphic control's
Parent.

Thanks for the explanation.

Quote:
Why do you need mouse wheel events on a TImage? What exactly are you
trying
to accomplish?
I have a network camera that is sending images to a TImage descendant.

This camera can move over the three axis X, Y and ZOOM.
Now I used OnMouseDown to centre the image.
The last goal would be Zoom-In if the Mouse Wheel is rolled up, otherwise
Zoom-Out.
I know how to Zoom in or out but I need user input.

Thanks for your answer.

Lapo



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri May 21, 2004 12:19 am    Post subject: Re: OnMouseWheel over TImage Reply with quote


"Lapo Guidi" <lapoguidi (AT) inwind (DOT) it> wrote


Quote:
I have a network camera that is sending images to a
TImage descendant. This camera can move over the
three axis X, Y and ZOOM. Now I used OnMouseDown
to centre the image. The last goal would be Zoom-In if
the Mouse Wheel is rolled up, otherwise Zoom-Out.

TImage itself can't receive mouse wheel notifications directly. However,
the parent TForm will receive any notifications while the mouse is over the
TImage. So you could just use the form's OnMouseWheelUpDown events, then
check if the mouse is currently positioned over the TImage, and if so then
update your camera as needed.

Quote:
I know how to Zoom in or out but I need user input.

If the above doesn't work, you could always just provide a separate
TTrackBar for doing that. Or a pair of TButton that start a timer when held
down and stop the timer when released.


Gambit



Back to top
Lapo Guidi
Guest





PostPosted: Fri May 21, 2004 4:40 pm    Post subject: Re: OnMouseWheel over TImage Reply with quote

Thanks very much for your help, I have it working now.

Lapo


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.