Recent

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

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: Need Really Complete RichText Control
« Reply #15 on: June 30, 2017, 07:33:23 pm »
If so.... that stinks... I NEED copy/pasting of images into editor.
Well then, are you a screen drawer or a programmer?
Specialize a type, not a var.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Need Really Complete RichText Control
« Reply #16 on: June 30, 2017, 07:53:17 pm »
Well then, are you a screen drawer or a programmer?
Thaddy, I think you misunderstood the question/need.

The rich-text component must support the feature of pasting images into it.
There's a high change that technipixel would not be the end-user of the application.

So his need is quite understandable.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #17 on: June 30, 2017, 08:07:01 pm »
Thaddy... Both!!!

Correct, I will be using it, but also making it public.

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 #18 on: June 30, 2017, 08:09:33 pm »
If so.... that stinks... I NEED copy/pasting of images into editor.
Well then, are you a screen drawer or a programmer?

You can't make the control do what it isn't program to do.
If I was much better at LAZ, I would be able to make my own.
But, since I am not I am banging my head on wall trying to make something work.
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 #19 on: June 30, 2017, 08:12:17 pm »
Okay... it installed fine.
But trying to run your example yields this error....
select then menu "project\project inspector" on the required packages tree remove LazRichEdit component and add evs_lazRichEdit. Copy from the folder external\interfaces\gtk2 the files rtf2Html.pas, rtfdata.inc, rtfpars_lzrichedit.pas to the example's folder(remove them from thegtk2 directory, they are not used from the control it self only from the export to html menu).

I can't paste an image in the editor...

You should be able to paste images from clipboard, I just used the example to do just that with an image copied in to clipboard from mspaint.

So, I assume that you can only insert them using a dialog??
If so.... that stinks... I NEED copy/pasting of images into editor.
The rule of thumb here is that if you can do it in wordpad you can do it in lzRichedit too.
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.
Based on your latest thread I guess you found a solution.
Well, looks like the editor is of no use to me either.
Don't fly of the wheel so easy, keep in mind that this project has no financial patrons. It relies on what ever effort the users put in to it. So statement like this are not appreciated much. The community tends to ignore people with that kind of mentality.
« Last Edit: June 30, 2017, 08:18:30 pm 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

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: Need Really Complete RichText Control
« Reply #20 on: June 30, 2017, 08:26:51 pm »
If there is missing functionalty I usually implement it myself, unless it is highly specialized, which is not the case.
Nothing more, nothing less.
Specialize a type, not a var.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #21 on: June 30, 2017, 08:27:06 pm »
Quote
You should be able to paste images from clipboard, I just used the example to do just that.

Well... not working for me... I am using
Code: Pascal  [Select][+][-]
  1. lzRichEdit1.PasteFromClipboard;

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.
Quote
Based on your latest thread I guess you found a solution.

No, that was the ColorButton for text. I am talking about the BG color of the actual editor.

Well, looks like the editor is of no use to me either.
Quote
Don't fly of the wheel so easy, keep in mind that this project has no financial patrons. It relies on what ever effort the users put in to it. So statement like this are not appreciated much. The community tends to ignore people with that kind of mentality.

I understand... but it is very frustrating when simple things don't work the way they should. Or some claim their control can "do all that rtf can do" (and doesn't)
And there is no documentations and they expect me to just guess what the properties or methods are.
I understand people do this for free... I am grateful.
« Last Edit: June 30, 2017, 08:28:53 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

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #22 on: June 30, 2017, 08:37:02 pm »
Quote
select then menu "project\project inspector" on the required packages tree remove LazRichEdit component and add evs_lazRichEdit. Copy from the folder external\interfaces\gtk2 the files rtf2Html.pas, rtfdata.inc, rtfpars_lzrichedit.pas to the example's folder(remove them from thegtk2 directory, they are not used from the control it self only from the export to html menu).

add "evs_lazRichEdit" from where and which extention lpk or pas?
UPDATE: Figured that out

Now... there is no.. " rtf2Html.pas"
UPDATE: It was already in the example folder
« Last Edit: June 30, 2017, 08:43:14 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

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Need Really Complete RichText Control
« Reply #23 on: June 30, 2017, 08:43:08 pm »
Quote
select then menu "project\project inspector" on the required packages tree remove LazRichEdit component and add evs_lazRichEdit. Copy from the folder external\interfaces\gtk2 the files rtf2Html.pas, rtfdata.inc, rtfpars_lzrichedit.pas to the example's folder(remove them from thegtk2 directory, they are not used from the control it self only from the export to html menu).

add "evs_lazRichEdit" from where and which extention lpk or pas?
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

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #24 on: June 30, 2017, 08:45:01 pm »
taaz... I already got it working.

THANKS FOR YOUR HELP

So, how come I can paste an image into your editor but not mine??
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 #25 on: June 30, 2017, 08:49:04 pm »
These are my uses....

Code: Pascal  [Select][+][-]
  1. uses
  2.   Windows, LCLType, Classes, SysUtils, FileUtil, RTTICtrls, Forms, Controls,
  3.   Graphics, Dialogs, Variants, Menus, ExtCtrls, Buttons, StdCtrls,
  4.   Clipbrd, RichBox;

Help me understand what technology you are using to paste images.

Here are yours... which ones do I need?

Code: Pascal  [Select][+][-]
  1. uses
  2.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  3.   ComCtrls, Menus, ExtCtrls, Buttons, LCLProc,
  4.   LCLType, ColorBox, Process, ULocalizar, UParagrafo, USobre,
  5.   RichBox{$IFDEF LINUX}, GTKTextImage, UGetFontLinux{$ENDIF}
  6.   {$IFDEF WINDOWS}, RichOleBox, RichOle{$ENDIF}, RTF2HTML;  
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 #26 on: June 30, 2017, 09:03:27 pm »
Quote
You should be able to paste images from clipboard, I just used the example to do just that.

Well... not working for me... I am using
Code: Pascal  [Select][+][-]
  1. lzRichEdit1.PasteFromClipboard;
Then you have an unsupported format in the clipboard. Try to paste it on mspaint and copy it from there and see if that helps any.
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.
Quote
Based on your latest thread I guess you found a solution.

No, that was the ColorButton for text. I am talking about the BG color of the actual editor.

if lzrichedit.color is not working then the control does not support it out of the box you need to extend it.

Well, looks like the editor is of no use to me either.
Quote
Don't fly of the wheel so easy, keep in mind that this project has no financial patrons. It relies on what ever effort the users put in to it. So statement like this are not appreciated much. The community tends to ignore people with that kind of mentality.

I understand... but it is very frustrating when simple things don't work the way they should. Or some claim their control can "do all that rtf can do" (and doesn't)
And there is no documentations and they expect me to just guess what the properties or methods are.
I understand people do this for free... I am grateful.
You might be happier with a commercial control try trichview from http://www.trichview.com/ I think they support lazarus (to an extend).
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

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Need Really Complete RichText Control
« Reply #27 on: June 30, 2017, 09:14:05 pm »
These are my uses....

Code: Pascal  [Select][+][-]
  1. uses
  2.   Windows, LCLType, Classes, SysUtils, FileUtil, RTTICtrls, Forms, Controls,
  3.   Graphics, Dialogs, Variants, Menus, ExtCtrls, Buttons, StdCtrls,
  4.   Clipbrd, RichBox;

Help me understand what technology you are using to paste images.

Here are yours... which ones do I need?

Code: Pascal  [Select][+][-]
  1. uses
  2.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  3.   ComCtrls, Menus, ExtCtrls, Buttons, LCLProc,
  4.   LCLType, ColorBox, Process, ULocalizar, UParagrafo, USobre,
  5.   RichBox{$IFDEF LINUX}, GTKTextImage, UGetFontLinux{$ENDIF}
  6.   {$IFDEF WINDOWS}, RichOleBox, RichOle{$ENDIF}, RTF2HTML;  
Its not about the uses clause the code does nothing more than what is in the onclick event of the menu editar\colar and as far I can see there is nothing more than
Code: Pascal  [Select][+][-]
  1. lzRichEdit1.PasteFromClipboard;
if the same clipboard content are working as expected in one application and not the other then the most propable cause is that the wrong code is executed.
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

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Need Really Complete RichText Control
« Reply #28 on: June 30, 2017, 09:20:12 pm »
Well... pasting an image from Windows Paint didn't work

And I am using the same code in the click event as you are in your example.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.MenuItem9Click(Sender: TObject);
  2. begin
  3.   // PASTE
  4.   lzRichEdit1.PasteFromClipboard;
  5. end;  

Is there a property on the editor itself that needs to be set?


And... so... I need the BG color...  and that other control is too expensive.

THANKS FOR ALL YOUR HELP!
« Last Edit: June 30, 2017, 09:22:00 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

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Need Really Complete RichText Control
« Reply #29 on: June 30, 2017, 10:16:27 pm »
Well... pasting an image from Windows Paint didn't work

And I am using the same code in the click event as you are in your example.

Just to be clear that is not my control or example. I just corrected a couple of misconfigurations to make it work, nothing more.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.MenuItem9Click(Sender: TObject);
  2. begin
  3.   // PASTE
  4.   lzRichEdit1.PasteFromClipboard;
  5. end;  

Is there a property on the editor itself that needs to be set?
No, but there is a requirement about a callback see the CreateOLEObjectInterface and CloseOLEObjects methods of the main form. Copy them verbatim to you application and use the form's Oncreate event to call the createole... and the form's onClose to call the close... method. That should enable image handling at least.
And... so... I need the BG color...  and that other control is too expensive.
As far as I know there must be a way to change the color I just don't have any ideas at the moment how to do it. In your position I would install TRichmemo, see if that one handles it better and if it does then copy the code over.
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

 

TinyPortal © 2005-2018