Component for RichTextEdit + Buttons

General TRichView support forum. Please post your questions here
Post Reply
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Component for RichTextEdit + Buttons

Post by sorega2022 »

Hi. I have a question. Is there a component for RichTextEdit plus all buttons you need to work with. Something like you have in the samples as edit2, but all in one component include without copy all code for each button.
It would be very comfortable. I had this in my former component TVPEngine.
Or i did not find it till now?
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Component for RichTextEdit + Buttons

Post by Sergey Tkachenko »

We do not have a component, but we have a set of actions.
Create TActionList component, and add actions in using "Add Standard Action" button in its component editor. The list of actions is here: https://www.trichview.com/help-actions/actions.htm
Or you can copy ActionList1 from our ActionTest demos.

You can assign an action to Action property of a menu item or a button control. After that, this item/button will update its state and execute the proper command on click.
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Component for RichTextEdit + Buttons

Post by sorega2022 »

Hi. i took the sample ActionTestUni and i could open a RTF File and save it to a RVF File. Now i took the form Form3 of the sample and included the imagelists in my program as new form. If i open a file in the new program it does not show me the content of the file. I can take RTF or RVF, but the program shows nothing. It makes no error. There is anything missing, but i dont find what. Do you know what that can be?
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Component for RichTextEdit + Buttons

Post by Sergey Tkachenko »

How do you open RVF or RTF file?

If you call RichViewEdit.LoadRTF/LoadRVF method, call RichViewEdit.Format after.
Also, check the return value of LoadRTF/LoadRTF, it returns True on success.

But if you use RichViewActions, the best way for loading is:
rvActionOpen1.LoadFile(RichViewEdit1, RVFFileName, ffiRVF)
(and simiarly for other formats).
rvActionOpen1.LoadFile not only loads a file and reformats the editor, but also associates the editor with this file, allowing "Save" action to work.
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Component for RichTextEdit + Buttons

Post by sorega2022 »

hi. i did
rvActionOpen1.LoadFile(RichViewEdit1, RVFFileName, ffiRVF)
but it shows nothing
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Component for RichTextEdit + Buttons

Post by Sergey Tkachenko »

Maybe something is wrong with this file?
Can you send me your project and this rvf file?
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Component for RichTextEdit + Buttons

Post by sorega2022 »

i dont think that the rvf file is wrong. it works with you sample. I think there is something wrong with the copy of your sample form. I will tell you what i did.
First i inserted you sample form in my project and changed the name. then i copied the imagelists in the form and changed all links with "Images".
In RVAControlPanel i changed the language to german and the UnitsDisplay to centimeter. That was all. the program could be compiled without errors.
But it does not work. Have i forgot something to change?
Do you have a sample where i can see how to change the Action of a rvAction? How to work with ActionNew and ActionSave? I need a switch when somebody has changed and saved the text to handle it in the project.
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Component for RichTextEdit + Buttons

Post by sorega2022 »

ok i fixed the problem. i didnot read that i must do the .format always behind load. Sorry but i an new with RichView.
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Component for RichTextEdit + Buttons

Post by Sergey Tkachenko »

Yes, if you call RichViewEdit.LoadRVF or LoadRTF method, you need to call RichViewEdit.Format after (and RichViewEdit.Clear before). Also, you may need to check the return value of LoadRVF/LoadRTF to make sure that the file is successfully loaded.

However, if you call rvActionOpen.LoadFile, it does all the necessary work, including formatting and showing an error message on failure.
Post Reply