Page 1 of 1
Component for RichTextEdit + Buttons
Posted: Sun May 12, 2024 3:54 pm
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?
Re: Component for RichTextEdit + Buttons
Posted: Tue May 14, 2024 7:53 pm
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.
Re: Component for RichTextEdit + Buttons
Posted: Sat Jun 01, 2024 11:52 am
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?
Re: Component for RichTextEdit + Buttons
Posted: Sat Jun 01, 2024 2:12 pm
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.
Re: Component for RichTextEdit + Buttons
Posted: Sat Jun 01, 2024 3:13 pm
by sorega2022
hi. i did
rvActionOpen1.LoadFile(RichViewEdit1, RVFFileName, ffiRVF)
but it shows nothing
Re: Component for RichTextEdit + Buttons
Posted: Sat Jun 01, 2024 4:36 pm
by Sergey Tkachenko
Maybe something is wrong with this file?
Can you send me your project and this rvf file?
Re: Component for RichTextEdit + Buttons
Posted: Sun Jun 02, 2024 3:18 am
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.
Re: Component for RichTextEdit + Buttons
Posted: Sun Jun 02, 2024 8:03 am
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.
Re: Component for RichTextEdit + Buttons
Posted: Sun Jun 02, 2024 9:42 am
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.