Lazarus

Programming => Packages and Libraries => RichMemo => Topic started by: snorkel on August 12, 2014, 05:29:25 pm

Title: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: snorkel on August 12, 2014, 05:29:25 pm
I have a delphi chat client that uses trichview and  I want to create a lazarus version and it seems the best way to go would be to use:
http://wiki.lazarus.freepascal.org/RichMemo#Installation

I would lose some of the trichview functionality but I don't care as long as I can get this project out of Delphi.

Anyway I installed on the latest stable release on Linux Mint 17 KDE and none of the demos work, they just show plain old text.

is this the best option to do a chat client or is there some other component I have missed?

Thanks Snorkel.
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: skalogryz on August 12, 2014, 05:35:02 pm
As an author of RichMemo, let me clarify - there was never Qt implementation (patches are welcomed. and it seems (http://qt-project.org/doc/qt-4.8/richtext.html) it should not be complicated for developers with good Qt-Pascal knowledge). But having RichMemo compiled for Qt makes me a bit surprised.

If you're looking for chat functionality (thus no editing abilities)
There's TRichView implementation for Lazarus: http://wiki.freepascal.org/RichView

Another options is lzRichEdit (http://lazarus-br.googlecode.com/svn/trunk/package/lzRichEdit/)

I'm not sure if either is working for Qt.



You could try using SynEdit for the chat as well (though it's not really suitable, since it's fixed-width oriented)
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: snorkel on August 12, 2014, 06:03:11 pm
Thanks for the info.

Yes it compiled in QT on 64bit linux no problem :-)  Just does not show formatted text.

I use Trichview/Trichviewedit in the current delphi version and it works great.  The Trichview author said he has plans to port it but it might take a long while.



Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: snorkel on August 12, 2014, 06:15:51 pm
Is there a way to append formatted text from one richmemo control to another?
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: skalogryz on August 12, 2014, 06:33:43 pm
Is there a way to append formatted text from one richmemo control to another?
Depends on what kind of controls. There're 2 ways to do that, if controls do not provide special methods for the action.
1. Copy / paste the desired portion of the text as richtext (RTF) format (or any other intermediate format, supported by either controls).
2. Using the components API "parse" the formatting and add and reformat manually at the destination control.
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: skalogryz on August 12, 2014, 06:35:43 pm
I use Trichview/Trichviewedit in the current delphi version and it works great.  The Trichview author said he has plans to port it but it might take a long while.
RichMemo doesn't have any API to insert images.

It's possible though, by using widgetset native APIs via RichMemo.Handle. (I've done that for Gtk and Windows ... a couple of years ago). Thus RichMemo cannot fully replace TRichView.
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: snorkel on August 12, 2014, 06:42:30 pm
Is there a way to append formatted text from one richmemo control to another?
Depends on what kind of controls. There're 2 ways to do that, if controls do not provide special methods for the action.
1. Copy / paste the desired portion of the text as richtext (RTF) format (or any other intermediate format, supported by either controls).
2. Using the components API "parse" the formatting and add and reformat manually at the destination control.

Is there a way to take a stream from one richmemo control and then append that to another richmemo?   I looked through the code but only saw a load and save stream which completely replaces the contents of the target richmemo.   
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: skalogryz on August 12, 2014, 07:51:15 pm
Is there a way to take a stream from one richmemo control and then append that to another richmemo?   I looked through the code but only saw a load and save stream which completely replaces the contents of the target richmemo.
There's no way to do that.
You can try two options here.
1) "merge" two streams manually
Code: [Select]
  src.SaveToStream(srcStream);
  dst.SaveToStream(dstStream);
  srcStream.Position:=0;
  dstStream.CopyFrom(srcStream, srcStream.Size);
  dstStream.Position:=0;
  dst.LoadFromStream(dstStream);

2) clipboard copy/paste?
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: snorkel on August 13, 2014, 11:19:11 pm
So there is no official way to append RTF data to a richmemo?
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: typo on August 13, 2014, 11:40:09 pm
Windows RichEdit has no way too.
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: snorkel on August 13, 2014, 11:43:03 pm
you can do it in the delphi windows trichedit by using a callback function API trick.

I tried the manual stream merge but that does not work.

Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: typo on August 13, 2014, 11:51:01 pm
You can also edit RTF tags.
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: snorkel on August 18, 2014, 08:25:04 pm
You can also edit RTF tags.

sure but  there is no way to load them into the richedit.  when you do the load from stream it just replaces everything.
Title: Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
Post by: snorkel on August 19, 2014, 10:51:49 pm
Not sure if I am doing something wrong but when I copy formated text to the clipboard on win32 and then paste into another trichmemo
it loses the formating and you can't see the text.  If you select the text you can then see it in the selection.

UPDATE:

nevermind I was not on the most current version from SVN.
TinyPortal © 2005-2018