Page 1 of 1

Troubles with Delphi controls

Posted: Mon Jul 02, 2007 9:54 pm
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

Posted: Tue Jul 03, 2007 4:41 pm
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.

Troubles with Delphi controls

Posted: Wed Jul 04, 2007 2:42 pm
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.

Posted: Wed Jul 04, 2007 4:11 pm
by Sergey Tkachenko
I received it. Sorry for delay, I'll answer tomorrow.

Posted: Fri Jul 06, 2007 8:08 pm
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

Re: Troubles with Delphi controls

Posted: Fri Nov 23, 2018 11:48 am
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?