Recent

Author Topic: [DONE] All Things RichMemo  (Read 2618 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1260
[DONE] All Things RichMemo
« on: July 18, 2019, 02:12:21 am »
I am trying rich memo.

Three things


1) I can't seem to find documentation.
2) I do I do bullets
3) How can I insert an image with all the image list just they have for an example.
« Last Edit: July 19, 2019, 06:58:07 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

dsiders

  • Hero Member
  • *****
  • Posts: 1045
Re: All Things RichMemo
« Reply #1 on: July 18, 2019, 02:29:48 am »
I am trying rich memo.

Three things


1) I can't seem to find documentation.
2) I do I do bullets
3) How can I insert an image with all the image list just they have for an example.

The only docs I can find are at: https://wiki.freepascal.org/RichMemo

There is a section about loaing an image from a file.

No specific mention of creating bulleted text.

Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things RichMemo
« Reply #2 on: July 18, 2019, 04:05:04 am »
I am trying rich memo.

Three things


1) I can't seem to find documentation.
2) I do I do bullets
3) How can I insert an image with all the image list just they have for an example.

The only docs I can find are at: https://wiki.freepascal.org/RichMemo

There is a section about loaing an image from a file.

No specific mention of creating bulleted text.


Yeah... figured all that, that was why I was asking.
Maybe somebody has flushed out some solutions for these things
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: All Things RichMemo
« Reply #3 on: July 18, 2019, 04:45:33 am »
I am trying rich memo.
1) I can't seem to find documentation.
https://wiki.freepascal.org/RichMemo

2) I do I do bullets
I've just added this section
https://wiki.freepascal.org/RichMemo#SetParaNumbering


3) How can I insert an image with all the image list just they have for an example.
There's no good/reliable way of doing that (especially on Windows, and especially, when there's a need to save/load the image).
You can try to use richmemoutils.pas and the function named InsertImageFromFileNoResize
Yet, I'd totally discourage you using it for production code.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things RichMemo
« Reply #4 on: July 18, 2019, 06:57:13 pm »
I am trying rich memo.
1) I can't seem to find documentation.
https://wiki.freepascal.org/RichMemo

2) I do I do bullets
I've just added this section
https://wiki.freepascal.org/RichMemo#SetParaNumbering

3) How can I insert an image with all the image list just they have for an example.
There's no good/reliable way of doing that (especially on Windows, and especially, when there's a need to save/load the image).
You can try to use richmemoutils.pas and the function named InsertImageFromFileNoResize
Yet, I'd totally discourage you using it for production code.

Thanks
1) I knew that.

2) Bullets... Okay.
But that doesn't tell me how to write the code?
No good to me.


3) Insert image.
I actually found a different way to do this.

Load image into TImage
Copy the Picture to clipboard
Paste into Richmeno

It's clean and quick.

I guess I could also just load it into a MemoryStream, copy and then paste
But requires more code.

Thanks for your response.
It's good to see that at Least RichMemo is still in active development
« Last Edit: July 18, 2019, 06:58:54 pm by pixelink »
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: All Things RichMemo
« Reply #5 on: July 19, 2019, 02:51:35 am »
Here is weird issue.

Using RichMemo

I have images in my RTF document

When the richmemo control IS NOT read only... the images display fine

I use a checkbox to turn on/off read only,

When read only is set to ON and I open the RTF into the Rich Memo.

The images are gone... but if I open the RTF in MSWord they are there.

Anyone know anything about this??
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: All Things RichMemo
« Reply #6 on: July 19, 2019, 03:20:45 am »
Also, I did a test on the inline RichMemo demo in the downloaded package and it does the same thing.

So, I am guessing that is is bug in RichMemo.... when read only is turned on.
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: All Things RichMemo
« Reply #7 on: July 19, 2019, 03:50:17 am »
So, I am guessing that is is bug in RichMemo.... when read only is turned on.
quite an interesting effect.
but that's the reason why images are not officially supported by RichMemo.


try a work around. Before loading RTF unset readonly flag.
Once loaded, put it back on.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things RichMemo
« Reply #8 on: July 19, 2019, 01:06:00 pm »
?? What do you mean they are not supported?
They save fine and can be inserted fine.

When read only is off they work fine.

I need the read only to work properly.

UPDATE: I was able to get the work around to work. Let me know if you ever get it fixed.

Thanks

« Last Edit: July 19, 2019, 01:18:32 pm by pixelink »
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: All Things RichMemo
« Reply #9 on: July 19, 2019, 04:25:04 pm »
?? What do you mean they are not supported?
Not every (supported) version of Windows would work as nice as you describe.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things RichMemo
« Reply #10 on: July 19, 2019, 05:45:26 pm »
did you test it on Linux and mac.
Your inline demo doesn't work either

Did you test the read only on Win10

Are you going to fix it in the future?
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: All Things RichMemo
« Reply #11 on: July 19, 2019, 05:54:06 pm »
did you test it on Linux and mac.
Your inline demo doesn't work either
It shouldn't work on either Linux or mac.
There's a possibility that images would load on mac (using RTF) (as long as they're not some sort of OLE object)

Are you going to fix it in the future?
It's more of implementation, rather than a fix.
Note, that officially RichMemo doesn't support image insertion.

inserting images (or inline objects) might be quite a complicated task for a particular system.
It ALL depends on the underlying system API.

For consistent functionality, a custom written (rather than system-based) controls should be used. Such as KMemo.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things RichMemo
« Reply #12 on: July 19, 2019, 06:53:28 pm »
??? You do you mean they are not supported, but yet they work.
They insert and they save in the RTF file perfectly fine
What do you mean they are not supporter?

All that is wrong is the read only function.
When on... it hides images... When off the images display.

IT SAVES FINE in the RTF

KMemo... has more issues than your does.
Plus, the author has said he is pretty much done developing it unless he has time.
He has already taken his site down


Never mind, I guess I will have to find another control.

 :(
« Last Edit: July 19, 2019, 06:56:34 pm by pixelink »
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: All Things RichMemo
« Reply #13 on: July 19, 2019, 07:00:43 pm »
??? You do you mean they are not supported, but yet they work.
They insert and they save in the RTF file perfectly fine
What do you mean they are not supporter?
RichMemo is based on the system rich-text control. (unlike KMemo, which was written from scratch)

Each system rich-text control has its particular features. (i.e. Linux control doesn't have "undo" out of the box. So doesn't mac, but adding one on mac is easier)

Now, if you try the same code as you've right now, on Windows XP, 7 or Vista, it might NOT produce the result you're getting now on Windows 10. (images might be missing, formatting might be different. etc)

Because system-rich-edit control on prior versions of Windows is acting differently, than the one on Windows 10.

If you don't want to fix it, fine, just say so.
Maybe read-only issue will be fixed, with Windows 11 or the next Windows 10 update. Who knows.
Oh, you can try to work-around that by suppressing all key events.
(add OnKeyDown handler, and assign KeyCode to 0). In that case you'll get somewhat read-only control.

Never minds, I guess I will have to find another control.
If you find it. Let us know.
There's a great demand for rich-text editing control overall.
But there's no perfect one. Yet creating a perfect one requires A LOT of resources.

 

TinyPortal © 2005-2018