Window decorations and the effective rect issue

Paul Dupuis paul at researchware.com
Wed Sep 9 14:11:56 EDT 2015


I have an application (main stack + many substacks + several external
stacks) that is ancient (originally built in HyperCard, ported to
Supercard, ported to Metacard, and on up to LiveCode 6.7.6.

I was working on redoing some of the legacy screen layout code today -
taking advantage of 'the working screenrect' (working didn't exist way
back when) and 'the effective rect' of a stack (effective wasn't
available either)
A multi-window layout should now be as easy as get the working
screenrect and divide it up and set the effective rect of the stacks
(windows) to the divided up values. No more fudge factors for varying OS
window borders and title bars and such. Yea!

However, I have run into a puzzler. Under Windows 8 (and Win 7) when I
set the effective rect of a stack to 0,0,x,y or set the effective
topLeft of a stack to 0,0, that stack is NOT taking into account the
wider window borders of Windows 7 and 8 and is positioning the stack
with part of its borders off screen - it is like the stack thinks it's
window borders were the thinner ones back under Windows 2000 or XP!

This only occur with old stacks in the application - i.e. stacks
originally migrated from HyperCard > SuperCard > Metacard >Revolution.
If I create a new "Untitled 1" substack in the old legacy mainstack and
set it's effective topLeft to 0,0, it renders exactly as expected.

I tried cloning (as in "clone stack <name>" one of the legacy stacks and
it also thinks it has thinner window borders that it really does.

All these stacks have been saved from LC676 in the latest stack format
(the were previously in LC464). I created a new test mainstak and
substack in LC676 and the effective keyword works exactly as expected
with stacks. I also created an identical test stack under LC464 (the
oldest version I have) and the tried that under LC676 and it works
exactly as expected.

I just appears to be really ancient stacks that have been
imported/migrated rather than any new stacks. Has anyone seen anything
like this?

I'd rather not have to recreate each of these legacy stack by creating a
new "Untitled" stack and populating all the objects, scripts,
properties, etc, to fix this issue.

Paul Dupuis
Researchware




More information about the use-livecode mailing list