Hi! I want to add some features to TMemo. Unfortunately, I am still weak on Lazarus. Is there a decent tutorial on extending the functionality of a control? In particular, I want to add some (limited) formatting colour and line numbers, so I need to override whatever method is used to actually display the text. (I can't even figure out what method that is...)
Mailing lists / lazarus / 2014-06
Adding functionality to a control
6 messages · 5 people · –
- TTimothy Groves 2
- DDmitry Boyarintsev 1
- HHans-Peter Diettrich 1
- MMattias Gaertner 1
- MMichael Schnell 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Show quoted text 6 lines
This is not supported by TMemo.
You can use TSynEdit instead.
Mattias
Mattias Gaertner wrote 11 lines
TMemo offers soft word wrapping. As far as I can tell through Google searches, this is not possible in TSynEdit.
So is there a control somewhere that has both, and doesn't require that I use Rich Text or HTML? If not, can you point me towards a decent tutorial on extending the functionality of an existing control?
Hi! I want to add some features to TMemo. Unfortunately, I am still weak on Lazarus. …
You're probably looking for http://wiki.freepascal.org/SynEdit or http://wiki.freepascal.org/RichMemo ?
thanks,
Dmitry
Timothy Groves wrote 12 lines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140606/1641f915/attachment.html>
TMemo offers soft word wrapping. As far as I can tell through Google searches, this is…
Show quoted text 6 lines
Extending a simple control may be easy, you can split the internal list of lines as required. But when syntax highlighting or other text attributes or links are supported by a control, all these functions have to be upgraded to support a dynamically changing lines list.
DoDi
TMemo offers soft word wrapping. As far as I can tell through Google searches, this is…
Timothy Groves wroteTMemo offers soft word wrapping. As far as I can tell through Google searches, this is not possible in TSynEdit.
I seem to remember that there have been multiple requests for a TMemo-like component that has "soft" word wrapping while in the background the "hard" line breaks are preserved. Of course here it would be necessary to have the user see and allow him to enter "hard" linebreaks.
AFAIK such a component currently does not exist.
I understand that this is not easy to do. Rather impossible based on TMemo and hard to do based on TSymnEdit.
-Michael
