I have an question about TRichViewEdit

General TRichView support forum. Please post your questions here
mariana
Posts: 16
Joined: Fri Oct 05, 2007 12:17 pm
Location: Sibiu,Romania

panel in richviewedit

Post by mariana »

I have an panel into an richviewedit and in it i have some images and paintboxes. I whant to save the file as rvf, but saves the panel and components from it don't.
Have you an ideea what can i do to keep the inserted controls into the panel after save-ing?

Thank you very much for all your responses.. and I hope to help me on this time,like you helped me until now..

Best regards Mariana. :D :D
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I believe, if components on the panel have panel as an owner, they will be saved.
Here is the example: http://www.trichview.com/forums/viewtopic.php?t=251
mariana
Posts: 16
Joined: Fri Oct 05, 2007 12:17 pm
Location: Sibiu,Romania

Post by mariana »

I want to save them in format RVF. It is possible to make an function to save in this format with some properties and with the inserted components in the panel?
I need to save and later to load it.. I tried to save like in the demo you gave me, but when I load it I have an error and doesn't work to load the file..
I have set components inserted in Panel as subcomponents with function SetSubComponent(1).

If you have an ideea please let me know.
Best regards Mariana.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

What version of Delphi do you use?
As far as I remember, I created that Demo in Delphi 6.
Probably, something is different in other versions of Delphi.
mariana
Posts: 16
Joined: Fri Oct 05, 2007 12:17 pm
Location: Sibiu,Romania

Post by mariana »

I am using C++ Builder 6.
I think that I have written earlier in another post :D .
10x
Merry Cristhmas!!!!!!!!!
Mariana
mariana
Posts: 16
Joined: Fri Oct 05, 2007 12:17 pm
Location: Sibiu,Romania

Post by mariana »

Happy New Year!!!! to everyone.
Sergey Tkachenko wrote:If some components are not printed, you can help TRichView to print them.
Process TRVPrint.OnPrintComponent event. In this event, if the component is TPaintBox, create a bitmap (having the same size as the paint box) and draw the paint box on it.
If you need further help, let me know.
I tried to create a bitmap how you said, but when I am runnig the aplication I have an error: "[C++ Error] creaza.cpp(1430): E2015 Ambiguity between 'TBitmap' and 'Windows::TBitmap' ".
This is the declaration of function: "void __fastcall RVPrint1PrintComponent(TCustomRVPrint *Sender,
TControl *PrintMe, TBitmap *&ComponentImage)"
I am confused and I don't know what to do..
If you can give me an example, even if it is in delphi I think I would understand and maibe resolve the problem(error).

Thank you very much.
Mariana
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

In this declaration (both in hpp and cpp files) change TBitmap to Graphics:TBitmap.
mariana
Posts: 16
Joined: Fri Oct 05, 2007 12:17 pm
Location: Sibiu,Romania

Post by mariana »

Function GetItemCoords return the coordinates of items inserted at designed time? or could I use it to know the coordinates of items inserted at runtime?
For example if I have an picture introduced at runtime can I use GetItemCoords to find coordinates of picture?
And please if it is possible can you give me an example how to use it?

And another problem:
I have an Panel inserted in RichViewEdit, and after moveing it I can't select it(I am using OnControlClick function to select the Panel).
For an Edit it works, but for the panel not. Do you know where I go wrong?

Thank you.
Mariana.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

1) I do not completely understand the question. There is no designtime document editor, so items cannot be inserted at design time.
GetItemCoords returns coordinates of item at the moment of its call. Of course, document must be formatted, otherwise coordinates are undefined.

2) When you do a drag&drop, the selected fragment is copied to RVF, then it is deleted (moved to the undo buffer), and then its copy is inserted in the new place (it is read from that RVF).
So, technically, the panel is not moved, it is recreated by saving to RVF and loading from it. Events are not saved in RVF. They need to be reassigned, usually it is done in OnControlAction event.
I guess you copied OnControlAction code from some demo that reassigns events for TEdit.
mariana
Posts: 16
Joined: Fri Oct 05, 2007 12:17 pm
Location: Sibiu,Romania

Post by mariana »

On my form I have 2 panels:
1 with bottons for each type of control i want to insert in richviewedit and another with the richviewedit where controls will be inserted.
If I click on an botton and next on the richviewedit it will apear an control.
That is the control I am talking about.(of course after introduceing an control I call function Format for RichViewEdit.)
Have you understand what I am talking about?
mariana
Posts: 16
Joined: Fri Oct 05, 2007 12:17 pm
Location: Sibiu,Romania

Post by mariana »

Hy everyone!
I have another question.
In an RichViewEdit I have one button and one image inserted, and when I want to move them they are deleted from where they are but don't apear where I want.
What can I do to apear on my RichViewEdit?
I have implemented events OnControlMouseDown and OnControlMouseMove how is in help. For an edit it works, but for another control don't.
Do you know where am I wrong, or what can I do to work?
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Can you reproduce these problems in simple project and send it to me?
Post Reply