Recent

Author Topic: Need Really Complete RichText Control  (Read 15292 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Need Really Complete RichText Control
« on: June 25, 2017, 02:14:18 am »
I have tried many RichText controls and I seem to only find ones that have major pieces missing.

The closet I found is KMemo.
But, it's missing some important functions.
And updates slow.

IS THERE ANY COMPLETE RTF Controls?

Or can I hook up a good DLL RichText Control if there is one.
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11351
  • FPC developer.
Re: Need Really Complete RichText Control
« Reply #1 on: June 25, 2017, 02:26:06 am »
Afaik Windows has a richedit control available as activex (?).  The lazarus richmemo emulates it partially but to my knowledge doesn't use it.

Since FPC supports activex, one could, like Delphi does, build a wrapper that embeds the richedit control in a LCL component, but to my knowledge this hasn't been done yet.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Need Really Complete RichText Control
« Reply #2 on: June 25, 2017, 02:49:05 am »
Erm really? have you seen richedit http://wiki.freepascal.org/lzRichEdit? or richmemo http://wiki.freepascal.org/RichMemo? have you tried to ask for specific features in this forum? The richmemo author is active and usually very responsive in here. The closest you found was kmemo? really? what exactly are you missing?
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Thaddy

  • Hero Member
  • *****
  • Posts: 14159
  • Probably until I exterminate Putin.
Re: Need Really Complete RichText Control
« Reply #3 on: June 25, 2017, 02:11:17 pm »
Afaik Windows has a richedit control available as activex (?).  The lazarus richmemo emulates it partially but to my knowledge doesn't use it.
Since FPC supports activex, one could, like Delphi does, build a wrapper that embeds the richedit control in a LCL component, but to my knowledge this hasn't been done yet.
Yes, it has a COM interface called TOM (Text Object Model) from Richedit2 and later. Works very comfortable.
It is already in Richedit2.dll, but I would recommend using Richedit 4.1 and that is in MSFTEDIT.DLL (Vista or later). Simply import the typelib from either of these dll's. (NOT from richedit32, that is RichEdit v1). It is not really an activex, it is a pure COM interface.

A complete guide on how to use it is on msdn.  It indeed also works in Freepascal/Lazarus. Of course: Windows Only! It is also Unicode UTF16, NOT UTF8.
« Last Edit: June 25, 2017, 02:13:39 pm by Thaddy »
Specialize a type, not a var.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #4 on: June 29, 2017, 07:06:48 pm »
I have already tried RichEdit and RichMemo

RichEdit... never installs... To many problems with all the GTk reference
RichMemo... LOL.... you can't even resize image you paste. That needs lots of work.

KMemo is the closest I have found... but doesn't support Undo/Redo
And it has a bug when one line of text (with no spaces) is wider than the editor.
The horz scrollbar doesn't appear neither does it wrap the text.

I need full RTF capabilities with text and images, full copy-paste undo-redo
Text alignment, bullets, context menu
Color fonts, highlight fonts, editor BG color
Able to highlight and change text to different colors/sizes even if it's on one line.
Able to copy-paste formatted text to/from word

Looks like I will need to find a Windows DLL
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #5 on: June 29, 2017, 07:12:26 pm »
Afaik Windows has a richedit control available as activex (?).  The lazarus richmemo emulates it partially but to my knowledge doesn't use it.
Since FPC supports activex, one could, like Delphi does, build a wrapper that embeds the richedit control in a LCL component, but to my knowledge this hasn't been done yet.
Yes, it has a COM interface called TOM (Text Object Model) from Richedit2 and later. Works very comfortable.
It is already in Richedit2.dll, but I would recommend using Richedit 4.1 and that is in MSFTEDIT.DLL (Vista or later). Simply import the typelib from either of these dll's. (NOT from richedit32, that is RichEdit v1). It is not really an activex, it is a pure COM interface.

A complete guide on how to use it is on msdn.  It indeed also works in Freepascal/Lazarus. Of course: Windows Only! It is also Unicode UTF16, NOT UTF8.

Thaddy.... Where is that article on the Richedit com? Never mind I found it
I would try the one in VSStudio 2015, but I think it is tied into the .NET Framework 4.5
« Last Edit: June 29, 2017, 07:18:49 pm by technipixel »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

Thaddy

  • Hero Member
  • *****
  • Posts: 14159
  • Probably until I exterminate Putin.
Re: Need Really Complete RichText Control
« Reply #6 on: June 29, 2017, 08:17:25 pm »
I would try the one in VSStudio 2015, but I think it is tied into the .NET Framework 4.5
No it isn't. It's a pure COM OLE interface. I wrote the KOL version in about 2 hours 14 years ago. Nothing to do with .NET.
Specialize a type, not a var.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #7 on: June 29, 2017, 08:27:34 pm »
This is what I have ... using KMemo
No undo/redo, and text doesn't wrap properly if word or line is wider than width of control.

Some may already know, I have a WPF (.NET) version, But I am trying to convert it to LAZ.

Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Need Really Complete RichText Control
« Reply #8 on: June 30, 2017, 06:35:43 am »
RichEdit... never installs... To many problems with all the GTk reference
Find attached a new package  (with the component code) for lzRichEdit. It should install on windows with out any problems.
just unpack in any folder, load the evs_lazrichedit.lpk, compile and install in your IDE. The folder external has the control's code from the google repo before it closed down. Only the evs_XXX files are mine and only added them to avoid messing with the control directly. See if that is more complete.

EDIT:
Attached an image from the controls example project running if you can't make it run post a comment and I'll upload an working version for you.
copy/paste rtf works. The Image in the screen shot was pasted from an external rtf editor as the sample does not include code to import images.
I think the only thing missing is the ability to define tables/columns but I do not know how easy/hard it is to add it.
« Last Edit: June 30, 2017, 07:00:42 am by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

CM630

  • Hero Member
  • *****
  • Posts: 1076
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Need Really Complete RichText Control
« Reply #9 on: June 30, 2017, 09:21:12 am »

using KMemo...
...and text doesn't wrap properly if word or line is wider than width of control.
Did you use latest version from trunk? I think this issue is already fixed.
Also, you could try to discuss the issue here.

Indeed, there is no undo/redo and there are some more serious problems, like unsupported hyperlinked images and highlighting.


I do not see any info about using tables in http://wiki.freepascal.org/lzRichEdit? which makes it useless for me.
« Last Edit: June 30, 2017, 09:23:11 am by CM630 »
Лазар 3,0 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Need Really Complete RichText Control
« Reply #10 on: June 30, 2017, 10:58:53 am »
I do not see any info about using tables in http://wiki.freepascal.org/lzRichEdit? which makes it useless for me.
There, a picture is worth a thousand words.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

guest60499

  • Guest
Re: Need Really Complete RichText Control
« Reply #11 on: June 30, 2017, 04:06:18 pm »
Erm really? have you seen richedit http://wiki.freepascal.org/lzRichEdit? or richmemo http://wiki.freepascal.org/RichMemo? have you tried to ask for specific features in this forum? The richmemo author is active and usually very responsive in here. The closest you found was kmemo? really? what exactly are you missing?

If you look at the subforum for RichMemo there is a decent list of bugs, the largest of which include composition and entry issues with left-to-right scripts. Unfortunately if the OP needs a component which works with every language on Earth they will either need to use Window's native RichEdit or GTK's equivalent.

Not to stray too far from the topic but it looks like, barring Windows and maybe one or two large windowing toolkit projects, that most open source software has absolutely horrible multilanguage support, mostly in the case of non-Latin scripts.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #12 on: June 30, 2017, 04:49:17 pm »
RichEdit... never installs... To many problems with all the GTk reference
Find attached a new package  (with the component code) for lzRichEdit. It should install on windows with out any problems.
just unpack in any folder, load the evs_lazrichedit.lpk, compile and install in your IDE. The folder external has the control's code from the google repo before it closed down. Only the evs_XXX files are mine and only added them to avoid messing with the control directly. See if that is more complete.

EDIT:
Attached an image from the controls example project running if you can't make it run post a comment and I'll upload an working version for you.
copy/paste rtf works. The Image in the screen shot was pasted from an external rtf editor as the sample does not include code to import images.
I think the only thing missing is the ability to define tables/columns but I do not know how easy/hard it is to add it.

Okay... it installed fine.
But trying to run your example yields this error....

THANK YOU.... I am going to give it a shot because Kemo documentation is not very good.
I am working on this right now.

Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Need Really Complete RichText Control
« Reply #13 on: June 30, 2017, 05:22:59 pm »
If you look at the subforum for RichMemo there is a decent list of bugs, the largest of which include composition and entry issues with left-to-right scripts. Unfortunately if the OP needs a component which works with every language on Earth they will either need to use Window's native RichEdit or GTK's equivalent.
The biggest issue here, is that RichMemo is using Window's native RichEdit...

However, the problems with left-to-right scripts you're referring to are caused by the fact the entries of left-to-right characters are done, via non-standard Windows means.
(Typically Windows requires a user to install a keyboard layout for an appropriate language and use it for entry).

imho, there's certainty an issue when people are trying to compare lzRichEdit vs RichMemo.
BOTH are based on Windows native RICHEDIT component ;)
Thus, in the end would have exactly the same set of issues anyway. (imposed by Windows native RICHEDIT component).

Another problem, is that somehow the fact of "rich-text" being a complex task fades.
If, K-Memo is not enough (and so far, it's the most advanced open-source and free component to use for rich-text editing), I'd certainly recommend to turn to a commercial options... such as Rich Text Component.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #14 on: June 30, 2017, 07:14:06 pm »
As I work with the lazRichEdit... I noticed....
I can't paste an image in the editor...

So, I assume that you can only insert them using a dialog??
If so.... that stinks... I NEED copy/pasting of images into editor.

Also, I can't see where I can change the background color of the editor.
I need this too because this is an app for graphic designers.

Well, looks like the editor is of no use to me either.
« Last Edit: June 30, 2017, 07:26:59 pm by technipixel »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

 

TinyPortal © 2005-2018