Recent

Author Topic: Anyone using the lazarus RichMemo? It does not seem to work on QT linux  (Read 12110 times)

snorkel

  • Hero Member
  • *****
  • Posts: 817
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.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #1 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 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

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)
« Last Edit: August 12, 2014, 05:38:11 pm by skalogryz »

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #2 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.



***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #3 on: August 12, 2014, 06:15:51 pm »
Is there a way to append formatted text from one richmemo control to another?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #4 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.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #5 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.
« Last Edit: August 12, 2014, 06:38:38 pm by skalogryz »

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #6 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.   
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #7 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?

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #8 on: August 13, 2014, 11:19:11 pm »
So there is no official way to append RTF data to a richmemo?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #9 on: August 13, 2014, 11:40:09 pm »
Windows RichEdit has no way too.

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #10 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.

***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #11 on: August 13, 2014, 11:51:01 pm »
You can also edit RTF tags.

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #12 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.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Anyone using the lazarus RichMemo? It does not seem to work on QT linux
« Reply #13 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.
« Last Edit: August 19, 2014, 11:01:36 pm by snorkel »
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

 

TinyPortal © 2005-2018