Yes you can use this property to find out things or you can remember
your own variabel.
the key here is that only 1 control will recieve then key down. So if
you want to move a notebook with controls you need to write a routine to
handel there mouse down to.
 
I think theres lots of solutions to this problem but on would be to
itereating owners to find the tabcontrol.
 
You can also look at the lazarus implementation for form (Drag buttons
etc) designer i think its in the unit lazarus\desiger\designer.pp
This routine looks like the main routine for mousedown.
 
procedure TDesigner.MouseDownOnControl(Sender: TControl;
  var TheMessage: TLMMouse);          
 
 
 
 
 

Met vriendelijke groet, 

Pieter Valentijn

 

Delphidreams

http://www.delphidreams.nl <http://www.delphidreams.nl/> 

 

-----Oorspronkelijk bericht-----
Van: Charl van Jaarsveldt [mailto:[EMAIL PROTECTED] 
Verzonden: maandag 19 maart 2007 14:23
Aan: lazarus@miraclec.com
Onderwerp: Re: [lazarus] Custom components Mouse events


I guess I was secretly hoping that things like the right lick menu on
the notebook control can just be "enabled" on the notebook in my control
since it is already implemented. So, can the right click event on the
notebook in the wizard be propagated from the wizard to the notebook? I
wonder if that made any sense at all? :-) 

I see there are ControlState property that I can set for each control in
my Wizard component, and this control state property has a few values
relating to mouse events. What are these for?

Thanks
Charl


On 3/14/07, Pieter Valentijn <[EMAIL PROTECTED]> wrote: 

Theres 3 main events when working with a mouse.
 
1 onMouseDown (like when someone clicks your control the rect here is a
client rect you need to store this to execute the next event and you
need to set some boolean to indicate the mouse is down.
 
2 OnMouseMove  When the mouse is down you can shif the object below. The
point you get here is the point of the mouse in the other control. The
diverence between this pos and the pos at mouse down needs to be used to
correct the top and left of the drag control.
 
3 OnMouseUp Here you release the mouse by setting the boolean from
onMouseDown to false again so mousemove does not do annything.
 
 
 
 

Met vriendelijke groet, 

Pieter Valentijn

 

Delphidreams

http://www.delphidreams.nl <http://www.delphidreams.nl/> 

 

-----Oorspronkelijk bericht-----
Van: Charl van Jaarsveldt [mailto:[EMAIL PROTECTED] 
Verzonden: woensdag 14 maart 2007 13:42
Aan: lazarus@miraclec.com
Onderwerp: [lazarus] Custom components Mouse events


Hello,

I am trying to make a wizard component and I am using the TButtonPanel
as my example. So, I have the main component that inherits from
TCustomPanel and then all the sub controls in there - buttons, caption
label and a TNotebook for the main control to handle the wizard pages. 

Now while trying to test it I found a problem: Mouse events is not what
I expect them to be and I would like to know what to do to make them
work. 
Specific problems:
* When I try to move the component I have to carefully place my mouse on
the little part of the panel that sticks out in the area between
components (result of BorderSpacing) to move the whole thing. If I try
to click and drag anywhere else (say with my mouse on the notebook)
nothing happens. How can I make the normal movement possible? 
* When I try to right-click on the Notebook component, nothing happens.
I need that normal pop-up menu to add/remove pages and to select the
current page. 

Thanks
Charl

-- 
"I love deadlines. I especially love the whooshing sound they make as
they fly by." - Douglas Adams 




-- 
"I love deadlines. I especially love the whooshing sound they make as
they fly by." - Douglas Adams 

Reply via email to