Troubles with Delphi controls

General TRichView support forum. Please post your questions here
Post Reply
Eugene Kruglov
Posts: 9
Joined: Mon Jul 02, 2007 9:07 pm
Location: Perm, Russia

Troubles with Delphi controls

Post by Eugene Kruglov »

Dear folks and Sergey personally,

I am not an advanced coder, so I probably do something wrong...
The problem, according to the forum, is not new: why Delphi controls are not rendered correctly after being saved to and then loading back from RVF file. Or, they are not rendered at all. I use RegisterClass, but many controls contain classes that can't be registered (e.g. TJvPopupCalendar or similar classes, where it is taken from?). Sometimes the message appears like "Control <control> has no parent window".

RV Version is 1.9.24 (trial, may be that is the matter?)
In RVF options the "save controls" is checked.

This concerns not all Delphi controls but, to my observations, those having drop-down boxes. Those are components from EhLib, ELPack, Jedi VCL etc., especially DB-aware components. I could not resolve this problem with all my efforts.

Moreover, after I try to create controls on-the-fly (with OnControlNeeded event) the first problem is resolved, but the formatting of RichViewEdit is broken after loading RVF-file: the controls are misplaced according to baseline. Interesting, the formatting is restored after starting typing text somewhere in the document...
Besides, where to store published properties (e.g. DataSource etc.) with such approach?

I don't know what to think and how to struggle this problems... :cry: The application I want to make requires precise formatting of controls among the surrounding text.

Please answer, waiting impatiently. On need, can give he examples of my code.

Sincerely, Eugene
Sergey Tkachenko
Site Admin
Posts: 17531
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Some controls require additional classes to be registered with RegisterClass. It may solve some problems.
If this will not help, please send me example of RVF file that is loaded incorrectly.
Eugene Kruglov
Posts: 9
Joined: Mon Jul 02, 2007 9:07 pm
Location: Perm, Russia

Troubles with Delphi controls

Post by Eugene Kruglov »

Sergey,

I've sent you e-mail yesterday, including my sample project and RVF-files that are loaded incorrectly. Awaiting your reply,

Regards, Eugene.
Sergey Tkachenko
Site Admin
Posts: 17531
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I received it. Sorry for delay, I'll answer tomorrow.
Eugene Kruglov
Posts: 9
Joined: Mon Jul 02, 2007 9:07 pm
Location: Perm, Russia

Post by Eugene Kruglov »

Hi, all (especially Sergey)

I resolved this problem using new routines of registering the complex classes and streaming the components. These procedures radically differ from all offerred by Borland and others (e.g. StringToComponent, ObjectTextToBinary and vice versa). Now, it's really possible to insert to RichView and save complex nested multi-level Delphi controls.

If someone is interested, I can send the code fragments used. Maybe it will be useful for improving TRichView saving/reading routines :D

Regards, Eugene
dkounal
Posts: 24
Joined: Sat Aug 27, 2005 4:51 pm
Location: Greece

Re: Troubles with Delphi controls

Post by dkounal »

I having problem with ObjectTextToBinary and controls that the text representation of the object is a string of more than 4096 characters.
Can you please send me how you overcome it?
Post Reply