Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-06

Adding functionality to a control

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Timothy Groves

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...)

Reply by email

Mattias Gaertner
to Timothy Groves
Show quoted text 6 lines
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...)

This is not supported by TMemo.
You can use TSynEdit instead.

Mattias

Reply by email

Timothy Groves
to Mattias Gaertner
Mattias Gaertner wrote 11 lines
On Thu, 05 Jun 2014 12:45:54 -0400 Timothy Groves wrote: > 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...) This is not supported by TMemo. You can use TSynEdit instead.

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?

Reply by email

Dmitry Boyarintsev
to Timothy Groves: 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
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...) -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140606/1641f915/attachment.html>

Reply by email

Hans-Peter Diettrich
to Timothy Groves: TMemo offers soft word wrapping. As far as I can tell through Google searches, this is…
Show quoted text 6 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?

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

Reply by email

Michael Schnell
to Timothy Groves: TMemo offers soft word wrapping. As far as I can tell through Google searches, this is…
Timothy Groves wrote
TMemo 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

Reply by email