[Lazarus] Lazarus Digest, Vol 28, Issue 174

Technical tech at polypressuk.co.uk
Mon May 31 11:01:50 CEST 2010


Alexander Klenin wrote:
> Yes, I wanted to ask you the very same question ;-)
> The reason I did not implement it immediately is that I am not quite
> sure about the
> format of said property and how should it refer to the series.
> My current thinking is that it should be a simple comma-separated list
> of series indexes, but that seems somewhat un-Pascalish,
> so maybe you have a better idea?
>   
I'm too new to Pascal and Lazarus to be of much help here.  If there's a 
way to
pop up a list of TConstantLine types and store the selected indexes into 
an array,
that would work.  Maybe we can find another custom control that does 
something
similar and already solved this problem.

The other ugly-hack idea I had was to add a new property to TConstantLine.
IsDragable or ControlledByDragTool.  I'd much rather have the property 
in the
tool, though.
> BTW, please do not write much code depending on current TConstantLineDragTool
> interface just yet -- I think I might change it substantially to a
> more general one.
>   
Oops, I was just in the middle of adding some events to it.  I was going 
to send you a patch
but perhaps I'll just make a request if you're going to go in there soon 
anyway.

I think the tool should have OnStart, OnChangePosition, and OnEnd events 
(or something similarly named).
OnStart and OnEnd to be called from the MouseDown and MouseUp events, 
and OnChangePosition to be
called from the MouseMove event.

I hooked into the TChart MouseMove event to calculate the distance 
between the two lines and write it to
a text box, but I'd rather link it to an event that only occurs when the 
lines are actually moved.




More information about the Lazarus mailing list