datagrid problem resolved

Robert Maniquant rman at free.fr
Mon Aug 17 11:46:52 EDT 2009


Hi! I had very positive exchange with Trevor too. I had some empty spaces
while xcrolling fast a datagrid form list. he pointed out that the layout
procedure I used could be source of these artefacts. it was. So let me share
the lesson I derived from that : 

Lesson 1 was : do not try and do without the GridFieldEditor (I tried to do
without and use the list fields : but this implies to get the field ID's
through the line groups... and these are not to be relied upon. Their
numbering is logical.. so far as they fit in the viewer space. Than they are
redcreated, with new numbering starting at 1... so not reliable. SO this may
seem to work for a few lines, and then go weird!).

Lesson 2 could be : layout elements of a datagrid form in a "once and for
all" layout procedure. 

To make sure layout happens smoothly :
1) set position of elements using "set rect property". Avoid setting of
height and width. Eventually set topRight or topLeft properties of fixed
width objects which heights will be trimmed at the last stage.

3) in case of elements of variable height :
-- a) position the biggest element (that will most affect the pControlRect)
as soon as possible in the layout script, once and for all.
-- b) to do so, workout the dimensions of the biggest variable element and
then set its "rect" property, once and for all.
-- c) then, set the new value of pControlRect (item 4), once and for all.
-- d) then, adapt other elements that need to be trimmed afterwards,
provided they do not affect pControlRect.
In that latter case, although these elements may have been partially laid
down with topRight or topLeft before, work out the new dimensions and set
the rect of these, once and for all.

The good pratcice word to remember is "once and for all" = set objects once
for all, never gradually.
In gradually I mean never by step, e.i. giving a first start size, than
moving things, than adding a height.. 

Following this practice, [put item 2 of theRect + the formattedHeight of
field "Body" of me   
into item 4 of theRect ] does work fine for me in my layout scripts. Food
for thoughts.

Amicalement, (from Paris)
Robert


-- 
View this message in context: http://www.nabble.com/datagrid-problem-resolved-tp24991650p25009239.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list