Lazarus
Programming => General => Topic started by: pixelink 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.
-
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.
-
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
-
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.
-
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
-
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??
-
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.
-
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.
-
?? 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
-
?? What do you mean they are not supported?
Not every (supported) version of Windows would work as nice as you describe.
-
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?
-
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 (https://wiki.freepascal.org/KControls#KMemo_control).
-
??? 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.
:(
-
??? 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.