Geometry Problem
MisterX
b.xavier at internet.lu
Mon Sep 12 13:16:08 EDT 2005
Dave,
i'll try very hard to be objective...
Once your controls go haywire in Rev with the GM, you can try the following:
- type RevUpdateGeometry in the message box - this should trigger the right
redraw that was missed by the engine for whatever reason.
- If that fails, put an empty "on resizestack" handler in your stack
to prevent rev redrawing the geometry. Resize your controls and when you are
done, save. Then try to revCacheGeometry - but it may screw things up
later...
Problems arise if you changed the owner a control or group after setting the
revGM properties. You can detect them via a stack i made
http://monsieurx.com/modules.php?name=Downloads&d_op=getit&lid=72
To prevent madness, use these two functions to "test" the gm:
-- Save all positions in case of GM screw up
on saveGeometry
local clist, cid, crect
put the rect of this stack & CR into clist
repeat with x = 1 to the number of controls
put the short id of control x into cid
put the rect of control x into crect
put cid & tab & crect & cr after clist
end repeat
delete last char of clist
set the OriginalGeometry of this stack to clist
end saveGeometry
on restoreGeometry
local clist, cid, crect
lock messages
put the OriginalGeometry of this stack into clist
set the rect of this stack to line 1 of clist
delete line 1 of clist
set the itemdelimiter to tab
repeat for each line L in clist
put item 1 of L into cid
put item 2 of L into crect
set the rect of control id CID to crect
end repeat
--if not isMetaCard() then
revcachegeometry
--end if
end restoreGeometry
I have a bonus script that STRIPS the GM from stacks too which was used
quite often since their button "clear GM" in the RPP wasn't usefull... but
it's too long to post here... ;)
Remember that if you have a RevErrorDisplay action due to a bug, it may
block any GM from working (yet another bummer to watch for)...
Example: open the revErrorDisplay stack and see it naked! ;)
Try to type revUpdateGeometry right after in the message box to set your GM
to normal - but it may not work...
Last but not least, please vote for bugzillas:
1223, 2079, 2341, 2355, 2335, 2363 in the hopes that they fix it one day.
After months of crying, complaining and going bananas with the GM, i wrote
my own "object oriented GM". I haven't had ONE problem or mis-resize
since...
hope that helps
Xavier
http://MonsieurX.com
More information about the use-livecode
mailing list