Topic: RTF Component

Hi Dmitry,


It's nice to see the addition of rtf component to MVD.

I was playing with it.

I wanted to use the following script for displaying rtf data on other forms:

form1.RichEdit1.text := sqlexecute('select rrrtttfff from employees where id =' + inttostr(form1.TableGrid1.dbitemid));

I think type is not .text or it needs different script. Any suggestion please?

Adam
God... please help me become the person my dog thinks I am.

Re: RTF Component

Hello ad1408

You could define a variable with type : String which wlil contain result of your SQLExecute ('select rrrtttfff from employees where id =' + inttostr(form1.TableGrid1.dbitemid)))

Var MyText : String;

  Text := sqlexecute('select rrrtttfff from employees where id =' + inttostr(form1.TableGrid1.dbitemid));

then call it by this command

form1.RichEdit1.Lines.LoadFromFile(MyText);

Am I clear to you ?

JB

Re: RTF Component

Hi JB,

Thank you very much for your reply.

I tried the following but unfortunately I couldn't get it work:

var richText1 : String;
procedure Form1_TableGrid1_OnCellClick (Sender: TObject; ACol, ARow: Integer);
begin
form1.RichEdit1.Text := sqlexecute('select rrrtttfff from employees where id =' + inttostr(form1.TableGrid1.dbitemid));
form1.RichEdit1.Lines.LoadFromFile(richText1);
end;

I used Dmitry's treeview  sample project which is attached below:

Post's attachments

Attachment icon TreeView.zip 9.86 kb, 332 downloads since 2018-11-11 

Adam
God... please help me become the person my dog thinks I am.

Re: RTF Component

Please download latest version again:
https://www.dropbox.com/s/xhks7c4n6g8m0 … a.zip?dl=0


example:

procedure Form1_Button3_OnClick (Sender: TObject; var Cancel: boolean);
begin
    Form1.RichEdit1.TextRTF := SQLExecute('SELECT text FROM test WHERE id='+Form1.TableGrid1.sqlValue);
end;

also I have added property Text

Dmitry.

Re: RTF Component

Thanks a lot Dmitry......

Looking forward to release of v5.

Please try to include RTF component toolbar customization such as how many toolbar rows, shortcut icons distribution to defined toolbars and perhaps option to replace default toolbar icons with custom ones - all in development phase not end user customization.

Adam
God... please help me become the person my dog thinks I am.

Re: RTF Component

Hi Dmitry,

Perhaps you are working on it currently but just want to mention.

Adding images on RTF comp increases DB size drastically. I used (c/p from web browser) 12 images and got 47MB db file. Images are not large, even if they are saved as .bmp the biggest one is under 300 kb.

I don't know in which file format images are saved by RTF editor used in MVD. It may be good idea to provide image file format option during image insertion in to rtf editor.
If possible provide option to save images added in RTF editor in an external folder rather than in db file.

Adam
God... please help me become the person my dog thinks I am.

Re: RTF Component

AD1408 wrote:

Hi Dmitry,

Perhaps you are working on it currently but just want to mention.

Adding images on RTF comp increases DB size drastically. I used (c/p from web browser) 12 images and got 47MB db file. Images are not large, even if they are saved as .bmp the biggest one is under 300 kb.

I don't know in which file format images are saved by RTF editor used in MVD. It may be good idea to provide image file format option during image insertion in to rtf editor.
If possible provide option to save images added in RTF editor in an external folder rather than in db file.

Hello.


In the current version RichEdit store images in hexadecimal format, so you can use TEXT field to store RTF, later I will enable option to store images in binary format, but in this case you must use blob field, like FILE.

Dmitry.

8 (edited by einsteinf5 2018-11-18 09:32:10)

Re: RTF Component

You can insert typed "enter" into the textRTF field, and a BOLD text like ...

Diagnostic.RichEdit1.TextRTF: = 'Error Code - \ r \ n' + # 13 + Diagnostic.EditDiagnostic.text + # 13 + 'Defect -' + # 13 # 10 + diagnostic.Memo1Diagnostic.text + 'Remedy / + diagnostic.Memo2Diagnostic.text + 'Comment -' + diagnostic.Memo3Diagnostic.text + 'Observations -' + diagnostic.SavObs.text;

Eventually a correction of this script, thank you!

Re: RTF Component

How do I clear RichEdit please?
The following didn't work.

procedure Form1_TreeViewPasswMain_OnCellClick (Sender: TObject; ACol, ARow: Integer);
begin
if form1.tgPasswMain.dbItemID = -1 then
   begin
  form1.RichEdit1.Clear;
   end;
end;
Adam
God... please help me become the person my dog thinks I am.