Lazarus

Programming => General => Topic started by: pixelink on July 03, 2020, 11:45:44 pm

Title: [DONE] RichMemo Bullets
Post by: pixelink on July 03, 2020, 11:45:44 pm
Hi,

Reading this page on Bullets/Numbering.
https://wiki.freepascal.org/RichMemo
I can't ssem to figure out how exactly the code needs to be done.

This is what I have, but get error on pn:= line

Code: Pascal  [Select][+][-]
  1. var
  2.   pn : TParaNumbering;  
  3. begin
  4.   pn.Style = pnNumber;    //<------ ERROR
  5.   txtNote1.SetParaNumbering( txtNote1.SelStart, txtNote1.SelLength,pn);
  6.   txtNote1.SetFocus();    

Any help would be appreciated
Title: Re: RichMemo Bullets
Post by: speter on July 04, 2020, 02:41:04 am
I've never used richmemo, so I might be wrong... ;)

Try putting square brackets around the "pnNUmber"; like

Code: Pascal  [Select][+][-]
  1.   pn.Style := [pnNumber];

Also note that I added a colon before the equal (to make it an assign operator).

Finally, I don't think you don't need the empty brackets on line 6.

cheers
S
Title: Re: RichMemo Bullets
Post by: paweld on July 04, 2020, 07:11:07 am
You must initialize TParaNumber structure:
Code: Pascal  [Select][+][-]
  1. var
  2.   pn : TParaNumbering;  
  3. begin
  4.   IntParaNumbering(pn);
  5.   pn.Style = pnNumber;  
  6.   txtNote1.SetParaNumbering( txtNote1.SelStart, txtNote1.SelLength,pn);
  7.   txtNote1.SetFocus();  
  8. end;  
Title: Re: RichMemo Bullets
Post by: pixelink on July 04, 2020, 10:45:20 am
I found a discussion dedicated to this control after I wrote this thread.


I made a new thread in there...
https://forum.lazarus.freepascal.org/index.php/topic,50428.0.html

Thanks
TinyPortal © 2005-2018