🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages Started by Robert G. Hoover Tue, 06 Jun 2006 17:31
TImage::OnMouseUp Event
#3501
Author: Robert G. Hoover
Date: Tue, 06 Jun 2006 17:31
31 lines
1994 bytes
Hi,

In BCB6, I used TImages to draw my own buttons and used OnMouseDown and 
OnMouseUp to draw the down and up states for my buttons.

When the user pushed my button, it did not matter where (X,Y) he 
released the mouse button. My OnMouseUp routine fired and I had to check 
the bounds of my object.

// check bounds
if ((X >= 0) && (X < MyButton->Width)
  && (Y >= 0) && (Y < MyButton->Height))
{
   // do something...
}

Is this still necessary in BCB2006? My problem is that if something has 
been altered in BCB so that I do not have to check for the bounds 
anymore, then I need to snatch the mouse event to make sure my OnMouseUp 
event fires. The current behavior is that if I press the mouse button 
down over MyButton1 and drag over to MyButton2 and release the mouse 
button over MyButton2, then the MyButton1::OnMouseDown fires followed by 
the MyButton2::OnMouseUp. It's killing me! ;)

Can anyone help? Can I somehow override so that the user's mouse button 
release always fires the OnMouseUp event for the object that fired the 
OnMouseDown event?

Thanks!

Rob
Re: TImage::OnMouseUp Event
#3502
Author: Robert G. Hoover
Date: Tue, 06 Jun 2006 17:56
18 lines
1656 bytes
I've been looking through the documentation and I see ControlStyle, but 
I can't alter it. According to the documentation, my objects should not 
be behaving like this. :(


"ControlStyle describes all controls instantiated from a given class. 
ControlStyle should not be modified at run time, except in the 
constructor. The ControlState property records transient conditions.

The TControl constructor initializes ControlStyle to the set of 
csCaptureMouse, csClickEvents, csSetCaption, and csDoubleClicks."


Am I missing something? It sounds like the csCaptureMouse is what I need...

Thanks!

Rob
Re: TImage::OnMouseUp Event (right mouse button)
#3503
Author: Robert G. Hoover
Date: Tue, 06 Jun 2006 18:05
5 lines
1266 bytes
Would the button make a difference? I used to use the left mouse button 
but recently I switched to the right mouse button, assuming the behavior 
would be the same.

Rob
Re: TImage::OnMouseUp Event
#3505
Author: Bob Gonder
Date: Tue, 06 Jun 2006 21:54
7 lines
1146 bytes
Robert G. Hoover wrote:

>Can anyone help? Can I somehow override so that the user's mouse button 
>release always fires the OnMouseUp event for the object that fired the 
>OnMouseDown event?

See Win32 API GetCapture() and SetCapture()
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads