trichview.com

trichview.support




Re: How does ResizeControl work?


Return to index


Author

Message

Sergey Tkachenko

Posted: 12/06/2002 18:14:15


FindControlItemNo does not work for controls in table cells (I forget - it

either returns -1 or an index of the table containing cell containing the

control).

This is because items of cells are not items of the main document, cells are

subdocuments.


You need to:

1) write procedure that finds the given control; it must search both in the

main editor and in cells (if you have problems writing this procedure, I can

help)

2) if this is a cell, initialize its editing (call cell.Edit)

3) call ResizeControl of TopLevelEditor.


>

> Hallo Sergey,

>

> thanks for the help. Now it works for TImages which are in the "main"

editor.

> The thing is: I would like to enable the user to resize the image controls

> without having to set the caret to the image control's position. Thus I

wouldn't

> have to use ResizeCurrentControl, but ResizeControl, giving the correct

item

> number. As I wrote before, the FindControlItemNo works. If the image

control

> is in a table cell, I get the item no of the cell's inside editor. Thus I

> assume that I have to call the cell's inside editor ResizeControl

procedure.

> But how do I do that? The cell's getRVData returns TCustomRVData, which

doesn't

> have a ResizeControl procedure.

>

> Thanks for your help,

>

> Christian Kirchhoff

>

> "Sergey Tkachenko" <[email protected]> wrote:

> >How do you call it?

> >For example, the editor demo (Demos\Delphi\Editors\Editor 1\) uses

> >ResizeCurrentControl function (which calls ResizeControl inside), and it

> >works (move the caret to the control, right click and choose "item

> >properties" in the menu).

> >

> >> Hallo,

> >>

> >> I'm using a TRichViewEdit component to implement a HTML-editor. The

user

> >> can drag TImages on the RichViewEdit, which are then inserted as

Controls.

> >> Afterwards the user should be able to modify the imges size.

> >> I've implemented the "Modify Image" dialog. After closing it I compute

> the

> >> new size, search the item numer of the TImage control with

> >FindControlItemNo

> >> and try to set the new size with ResizeControl, which doesn't seem to

> >work.

> >> The procedure doesn't raise an error, but the image size stays

original.

> >> What could I have done wrong?

> >>

> >> Regards,

> >>

> >> Christian Kirchhoff

> >>

> >>

> >

> >

>





Powered by ABC Amber Outlook Express Converter