Recent

Author Topic: [solved] RichMemo and CHARFORMAT2 - highlight text  (Read 1207 times)

rick2691

  • Sr. Member
  • ****
  • Posts: 414
Re: [solved] RichMemo and CHARFORMAT2 - highlight text
« Reply #15 on: August 20, 2022, 06:57:27 pm »
Nicole,

if you hold your cursor over CHARFORMAT2 it will show a pop-up note: type CHARFORMAT2 = CHARFORMAT2A = _charformat2a =
record; C:\lazarus\fpc\3.2.0\source\packages\winunits-base\src\richedit.pp(953,6)

RichEdit.pp is the RichEdit unit.

So if you don't have RichEdit and/or RichMemoUtils in your USES clause ... they need to be there.

Rick
Windows 10, LAZ 2.0.12, FPC 3.2.0, SVN 64642, i386-win32-win32/win64, using windows unit

Nicole

  • Sr. Member
  • ****
  • Posts: 461
Re: [solved] RichMemo and CHARFORMAT2 - highlight text
« Reply #16 on: August 20, 2022, 08:38:34 pm »
Thank you so much for the clarification!
It works for me in the meanwhile and I am so happy to have this unit. I added it into my private library.

and btw:
Rick's line (thank you Rick!)
Code: Text  [Select][+][-]
  1. In the RichMemoHighlightWord procedure:
  2. replace RichMemoHighLightRange(R, Found, Length(AWord), AColor)
  3. with RichMemoHighLightRange(R, Found, utf8length(AWord), AColor)

needs
uses LazUTF8
« Last Edit: August 22, 2022, 09:54:59 am by Nicole »

 

TinyPortal © 2005-2018