Recent

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

rick2691

  • Sr. Member
  • ****
  • Posts: 444
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 11, LAZ 2.0.10, FPC 3.2.0, SVN 63526, i386-win32-win32/win64, using windows unit

Nicole

  • Hero Member
  • *****
  • Posts: 970
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