Recent

Author Topic: LCL component to implement a ruler  (Read 1139 times)

ermeneuta

  • New member
  • *
  • Posts: 27
LCL component to implement a ruler
« 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

wp

  • Hero Member
  • *****
  • Posts: 5353
Re: LCL component to implement a ruler
« Reply #1 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.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Alextp

  • Hero Member
  • *****
  • Posts: 774
    • UVviewsoft
Re: LCL component to implement a ruler
« Reply #2 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.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 859
    • Burdjia
Re: LCL component to implement a ruler
« Reply #3 on: June 23, 2018, 01:44:14 pm »
You may start from How To Write Lazarus Component article.  May be adding a section with a brief description with a link to main article or something.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal