How to implement "code-folding" in my SynEditMemo? lazarus / 31-LCL ---------------------------------------------------------------------- dkjMusic · 2011-09-15 21:28 I have a TSynMemo with text as shown below. How do I implement folding of, e.g., the text between "Melting Point" and the last separator "-----------------..." in that block, and of  the text between "Boiling Point" and the last separator "-----------------..." in its block. Do I somehow add my own TSynHighlighter? If so, how do I construct such an animal? Melting Point Melting Point [°C] ---------------------------------------------------------------------- ---------- -94.3 Patent; Kennedy, Michael T.; US2008/75777; (2008); (A1) English. Timmermans; Chem.Zentralbl.; vol. 82; nb. II; (1911); p. 1015. ---------------------------------------------------------------------- ---------- -173 Lesikar; Journal of Physical Chemistry; vol. 80; (1976); p. 1005. ---------------------------------------------------------------------- ---------- -95.35 Rosso et al.; Comptes Rendus des Seances de l'Academie des Sciences, Serie C: Sciences Chimiques;vol. 281; (1975); p. 699. ---------------------------------------------------------------------- ---------- Boiling Point Boiling Point [°C] Pressure [Torr]                  ---------------------------------------------------------------------- ---------- 56 Patent; Dabdoub, Atif M.; US2006/9654; (2006); (A1) English. Geller etal.; J. Appl. Chem. USSR (Engl. Transl.); vol. 49; (1976); p. 614,630,631. Rozenberg; Gorin; J. Appl. Chem. USSR (Engl. Transl.); vol. 44; (1971); p. 389,382. Nandibewoor; Raju; Journal of the Indian Chemical Society; vol. 55;(1978); p. 1284. ---------------------------------------------------------------------- ---------- 56.2 Patent; Kennedy, Michael T.; US2008/75777; (2008); (A1) English. Moroto; Watanabe; Nippon Kagaku Kaishi; (1972); p. 2317,2318. Lemonds;McClellan; Analytical Chemistry; vol. 45; (1973); p. 1455,1457. Bougard;Jadot; Journal of Chemical Thermodynamics; vol. 9; (1977); p. 491,492,493. ---------------------------------------------------------------------- ---------- ---------------------------------------------------------------------- Martin_fr · 2011-09-15 21:49 Yes, folding is provided by the highlighter (except the latest trunk, can fold the current selection, but I have only tested that with pascal highlighter, yet it should work anyway) pascal, html, xml, diff, and lfm hghlighter currently provide folding. The diff and lfm are the 2 simpler ones, so they can serve as example. An introduction, including create your own: http://wiki.lazarus.freepascal.org/SynEdit_Highlighter ---------------------------------------------------------------------- dkjMusic · 2011-09-15 22:02 Quote from: Martin_fr on September 15, 2011, 11:49:44 pmYes, folding is provided by the highlighter (except the latest trunk, can fold the current selection, but I have only tested that with pascal highlighter, yet it should work anyway) pascal, html, xml, diff, and lfm hghlighter currently provide folding. The diff and lfm are the 2 simpler ones, so they can serve as example. An introduction, including create your own: http://wiki.lazarus.freepascal.org/SynEdit_Highlighter Martin, as always, I appreciate your swift and helpful replies. I'll study the link you gave. While I (hopefully) have you on the line, if I want a context popup menu for a TSynEditMemo which has the basic edit functions (Undo, Cut,...Select All), do I write it myself or is there code somewhere I can borrow, or a SynEdit option? The keyboard shortcuts work fine for this, but I'm a mouse addict. I found an About.com article on implementing for Delphi's TRichEdit, so I'll use that if there isn't a better alternative. ---------------------------------------------------------------------- Martin_fr · 2011-09-15 23:06 Just drop a popupmenu on the form, and assign it to synedit.popupmenu? Then edit the popup. If synmemo doesn't have it, use synedit