Lazarus

Programming => LCL => Topic started by: ermeneuta on June 22, 2018, 07:12:19 pm

Title: LCL component to implement a ruler
Post by: ermeneuta on June 22, 2018, 07:12:19 pm
Good afternoon,

  I am in search of a LCL component to implement a mouse-draggable ruler, like that shown in the attached picture. Alternatively, as I have already such a component for the Delphi VCL, how can I recode that VCL component into an LCL component (under Linux).

Thanks
Title: Re: LCL component to implement a ruler
Post by: wp on June 22, 2018, 07:23:22 pm
Most Win components can be made cross-platform if you remove the units Windows, Messages and replace them by LCLIntf, LCLType, LMessages (sometimes also LCLProc). If there are messages replace the type TWMSomething by TLMSomething (e.g. TWMSize --> TLMSize), and TMessage by TLMessage. The same with the message constants: WM_SOMETHING --> LM_SOMETHING, e.g. WM_SIZE --> LM_SIZE.

A riuler is contained in the JVCL library (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/run/JvCtrls/), not draggable though. But there is also a moveable panel (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/run/JvCtrls/JvMovableBevel.pas)- Maybe you get some ideas about dragging from there.
Title: Re: LCL component to implement a ruler
Post by: AlexTP on June 23, 2018, 11:55:21 am
wp,
do you know in which Wiki page can I post your comment? about porting LCL comp.
Title: Re: LCL component to implement a ruler
Post by: Ñuño_Martínez on June 23, 2018, 01:44:14 pm
You may start from How To Write Lazarus Component (http://wiki.freepascal.org/How_To_Write_Lazarus_Component) article.  May be adding a section with a brief description with a link to main article or something.
TinyPortal © 2005-2018