datagrid problem resolved
Yves COPPE
yvescoppe at skynet.be
Mon Aug 17 10:51:49 EDT 2009
Le 17 août 09 à 15:46, Trevor DeVore a écrit :
>
> To sum up, Yves had a field in his data grid template whose height
> was adjusted to fit the text contents. His original code was setting
> the rect of the field in one pass. The problem with setting the rect
> in one pass when the field is being resized to fit the text height
> is that the width of the field before setting the rect might not be
> the width of the field after setting the rect. This means the
> formattedHeight value might not be incorrect.
>
> The proper way to have a field that adjusts height according to
> content is:
>
> on LayoutControl pControlRect
> ## ...
>
> ## First adjust width
> put the rect of field "MyAdjustableHeightField" of me into theRect
> put item 3 of pControlRect into item 3 of theRect ## adjust field
> to new width
> set the rect of field "MyAdjustableHeightField" of me to theRect
>
> ## Now adjust height
> put item 2 of theRect + the formattedHeight of field
> "MyAdjustableHeightField" of me \
> into item 4 of theRect
> set the rect of field "MyAdjustableHeightField" of me to theRect
>
> ## ...
> end LayoutControl
>
Hi Trevor,
thanks for helping me in english language
meanwhile, I did this week end another grid and had the same problem
solved on the same way
Greetings.
Yves COPPE
yvescoppe at skynet.be
More information about the use-livecode
mailing list