Board index » cppbuilder » [Important] To handle an hidden object

[Important] To handle an hidden object


2003-07-16 09:00:44 AM
cppbuilder73
I have a ScrollBox, over this another object with the same height and width
of the ScrollBox. i want handle onMouseMove of ScrollBox, but i can't
becouse it is hidden from the other object.
So how can handle an object hidden by another one?
 
 

Re:[Important] To handle an hidden object

"b" <borland.public.cppbuilder.vcl.components.using>wrote in message
Quote
I have a ScrollBox, over this another object with the same
height and width of the ScrollBox. i want handle onMouseMove
of ScrollBox, but i can't becouse it is hidden from the other
object. So how can handle an object hidden by another one?
You don't because there is no OnMouseMove event triggered for the ScrollBox
in the first place as the ScrollBox is hidden. The mouse events are only
sent to the top-most visual component that the mouse is actually moving
over. The mouse is not moving over the ScrollBox, it is moving over the
component on top of the ScrollBox. That is normal behavior.
Gambit
 

Re:[Important] To handle an hidden object

ok so can i get the numbers of pixel i move when i scroll the scrollbox?
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >ha scritto nel messaggio
Quote

"b" <borland.public.cppbuilder.vcl.components.using>wrote in message
news: XXXX@XXXXX.COM ...
>I have a ScrollBox, over this another object with the same
>height and width of the ScrollBox. i want handle onMouseMove
>of ScrollBox, but i can't becouse it is hidden from the other
>object. So how can handle an object hidden by another one?

You don't because there is no OnMouseMove event triggered for the
ScrollBox
in the first place as the ScrollBox is hidden. The mouse events are only
sent to the top-most visual component that the mouse is actually moving
over. The mouse is not moving over the ScrollBox, it is moving over the
component on top of the ScrollBox. That is normal behavior.


Gambit


 

{smallsort}

Re:[Important] To handle an hidden object

Remy Lebeau (TeamB) wrote:
Quote
The mouse events are only
sent to the top-most visual component that the mouse is actually moving
over. The mouse is not moving over the ScrollBox, it is moving over the
component on top of the ScrollBox. That is normal behavior.
Yes, indeed. But you can forward them to the ScrollBox.
Assign an OnMove event handler to the ScrollBox and the same
to the Panel.
void __fastcall TForm1::ScrollBox1MouseMove(TObject *Sender,
TShiftState Shift, int X, int Y)
{
//Take 4 TLabel's.
Label1->Caption = "X: " + IntToStr ( X );
Label2->Caption = "Y: " + IntToStr ( Y );
Label3->Caption = "";
Label4->Caption = "";
TPanel *Panel = dynamic_cast<TPanel*>(Sender);
if ( Panel )
{
Label3->Caption = "New X: " + IntToStr ( X + Panel->Left );
Label4->Caption = "New Y: " + IntToStr ( Y + Panel->Top );
}
}
Hans.
 

Re:[Important] To handle an hidden object

Anyway can i get the numbers of pixel that i move when scroll the scrollbox?
 

Re:[Important] To handle an hidden object

b wrote:
Quote
Anyway can i get the numbers of pixel that i move when scroll the scrollbox?
No, not anyway.
I gave you a solution for your MouseMove problem and you do not even comment.
You post a new question, and I should answer that ? And then again anyway ?
That's not the way I expect things to happen in a newsgroup.
Hans.
 

Re:[Important] To handle an hidden object

"Hans Galema" < XXXX@XXXXX.COM >wrote in message
Quote
Assign an OnMove event handler to the ScrollBox
and the same to the Panel.
That does NOT forward the mouse events to the ScrollBox. That just makes
the ScrollBox and Panel do the same thing when the mouse is moving over them
separately.
Gambit
 

Re:[Important] To handle an hidden object

"b" <borland.public.cppbuilder.vcl.components.using>wrote in message
Quote
Anyway can i get the numbers of pixel that i
move when scroll the scrollbox?
You would probably have to subclass the ScrollBox and intercept the
scrolling events directly. Otherwise, you might try using the
OnMouseUp/Down/Move events to manually kepp track of changes to the
HorzScrollBar->Position and VertScrollBar->Position properties.
Gambit
 

Re:[Important] To handle an hidden object

So, cant i handle the scrolling event? Can i get some information when i
scroll just the scrollbox?
For example the numbers of the pixel i moved or just if i clicked on the
scroll buttons or moved the bar...
 

Re:[Important] To handle an hidden object

Remy Lebeau (TeamB) wrote:
Quote
That does NOT forward the mouse events to the ScrollBox. That just makes
the ScrollBox and Panel do the same thing when the mouse is moving over them
separately.
Yes, I realised that later.
What I had in mind were a MouseMove eventhandler for the Panel an another
for the ScrollBox. The Panel eventhandler could than call
the scollbox eventhandler with X,Y converted.
Hans.
 

Re:[Important] To handle an hidden object

Sorry i don't want open new threads for this:
So, can i handle the scrolling event? Can i get some information when i
scroll just the scrollbox?
For example the numbers of the pixel i moved or just if i clicked on the
scroll buttons or moved the bar...
 

Re:[Important] To handle an hidden object

"b" <borland.public.cppbuilder.vcl.components.using>wrote in message
Quote
Sorry i don't want open new threads for this:
This new question does not pertain to the original question so you should be
starting a new thread for it.
Gambit
 

Re:[Important] To handle an hidden object

"b" <borland.public.cppbuilder.vcl.components.using>wrote in message
Quote
Sorry Remy, but i want to use this way just to hundle an hidden object ;)
You're not making any sense. Your descriptions are confusing, and you keep
changing the discussion. You can't handle events for hidden objects -
there's nothing to handle in the first place, they are hidden. Please start
over, and explain, IN DETAIL, exactly what you are looking to do.
Gambit