Page 2 of 2
Re: Changing the size properties of a stack, moves its location
Posted: Mon Mar 19, 2018 6:32 pm
by trevix
See message above:
Sorry Klaus, I may not have explained my self:.......
..
What I got instead, is that after reducing the width of the stack, the two rect controls are not in the middle anymore. Don't tell me that i can move them to center, because I know.
Re: Changing the size properties of a stack, moves its location
Posted: Mon Mar 19, 2018 6:52 pm
by Klaus
trevix wrote: ↑Mon Mar 19, 2018 6:32 pm
...
What I got instead, is that after reducing the width of the stack, the two rect controls are not in the middle anymore.
This is correct behavior!
trevix wrote: ↑Mon Mar 19, 2018 6:32 pm
...
Don't tell me that i can move them to center, because I know.
I already gave you an answer:
http://forums.livecode.com/viewtopic.ph ... 65#p165159
This
CANNOT be done without any scripting.
Re: Changing the size properties of a stack, moves its location
Posted: Mon Mar 19, 2018 7:06 pm
by Klaus
Looks like this is appropriate here:
Don't shoot the messenger!
Re: Changing the size properties of a stack, moves its location
Posted: Mon Mar 19, 2018 7:11 pm
by bogs
Dang, I MISSED!
Oh, you said "DON'T shoot!"
Re: Changing the size properties of a stack, moves its location
Posted: Tue Mar 20, 2018 7:58 am
by [-hh]
@all
Probably trevix has changed the scalefactor of the stack?
If that is not 1.0 then changing the size needs its own computations for setting the loc of the stack window.
That's the only possibility I can imagine that Klaus' script doesn't work as expected.
@trevix
You confuse the window of a stack with the controls of the stack. These are different objects.
Re: Changing the size properties of a stack, moves its location
Posted: Tue Mar 20, 2018 4:07 pm
by Lagi Pittas
Hi
If I read this right I think the OP wants it animated like "visual Effect Zoom Out" when going to a new card - I could be wrong but here is what I came up with - straight from fingers to code so if there are better ways to do this please pipe in.
Code: Select all
-- In Place Animated stack resize/expand
on mouseUp
local lnLoc, lnW, lnH
constant kMaxWidth = 500
constant kMaxHeight = 500
put the width of this stack into lnW
put the height of this stack into lnH
put the loc of this stack into lnLoc
repeat forever
add 2 to lnW -- Change the number for different speeds
add 2 to lnH
-- We don't want increase the height or Width greater asked for if they are different start and end sizes
put Min(lnW,kMaxWidth) into lnW
put Min(lnH,kMaxHeight) into lnH
set the width of this stack to lnW
set the height of this stack to lnH
set the loc of this stack to lnLoc
if (lnW >= kMaxWidth) AND (lnH >= kMaxHeight) then
exit repeat
end if
unlock screen
-- This has different effects on expand and squish routine in the stack - play with the number of milliseconds
wait 0 with messages
end repeat
end mouseUp
The stack include a "squish" routine that makes it shrink to the centre.
The only problem I had was when I had the wait with messages (to get out of a loop or adjust the speed) it would not animate but delay and show the maximum size so I had to put the
instruction there
I presume that is an internal LC design to speed the script up, but I'd like to know when that kicks in and when does it decide to update the screen? - over to you Hermann
Regards Lagi
Re: Changing the size properties of a stack, moves its location
Posted: Tue Mar 20, 2018 4:58 pm
by bogs
That is pretty creative Lagi. I think -hh might be right though, either that or all of us are not understanding and trevix will just have to come up with a clearer explanation possibly. From all the posts he put down, I figured Klaus was dead on.
Re: Changing the size properties of a stack, moves its location
Posted: Tue Mar 20, 2018 6:09 pm
by Klaus
I'm not dead, I just smell funny!
Re: Changing the size properties of a stack, moves its location
Posted: Tue Mar 20, 2018 7:19 pm
by bogs
Ah HAH! I thought that was the Limburger!
Re: Changing the size properties of a stack, moves its location
Posted: Tue Mar 20, 2018 7:27 pm
by Klaus
Yep, that one, too!
Re: Changing the size properties of a stack, moves its location
Posted: Tue Mar 20, 2018 8:35 pm
by bogs
We're terrible
You cannot make another post so soon after your last.
<sigh> Since my last one was in a completely different topic, and I am obviously not moving as fast as a 'bot' might, I would suspect the timer needs some adjusting eh.