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

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: 14513
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Tue Jul 03, 2007 4:41 pm

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

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: 14513
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Wed Jul 04, 2007 4:11 pm

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

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: 10
Joined: Sat Aug 27, 2005 4:51 pm
Location: Greece

Re: Troubles with Delphi controls

Post by dkounal » Fri Nov 23, 2018 11:48 am

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