Page 1 of 1

how to detect that Stack dimension is changed

Posted: Thu Jan 17, 2019 9:44 pm
by operoutka
Hi,
I don't know how can I detect that Stack dimension are changed? For change of Stack dimension didn't work statement "mouseStillDown". Statement "resizeStack" didn't work also. Statement "resizeStack" works but if I use "geometry manager" for any items in stack, so "geometry manager" didn't work.
I don't know how to detect that stack's dimension was changed. There is any statement for change stack's dimensions, that can I use as "mouseStillDown" for fields, buttons and others items in stack?
I thank for help.

with regards
Oldrich

Re: how to detect that Stack dimension is changed

Posted: Thu Jan 17, 2019 10:13 pm
by bogs
Sure, put this in the stacks script -

Code: Select all

local tmpStartSize

on openStack
   put the rect of this stack into tmpStartSize
end openStack

on resizeStack
   put the rect of this stack into tmpNewSize
   if the rect of me <> tmpStartSize then answer "Your stack size has changed..." & return & "The new size is " & tmpNewSize
end resizeStack

Re: how to detect that Stack dimension is changed

Posted: Mon Jan 21, 2019 8:19 pm
by richmond62
If you are going to want this in mouseStillDown routines
you will have to put bogs' code into a global and not a local.

Re: how to detect that Stack dimension is changed

Posted: Mon Jan 21, 2019 8:37 pm
by bogs
...or even a custom property, which is where I probably should have located it to begin with :?

Re: how to detect that Stack dimension is changed

Posted: Mon Jan 21, 2019 9:17 pm
by richmond62
At the risk of seeming stupid (err, surely not?), I wonder what the utility of
detecting stack resizes within mouseStillDown routines actually is.

I am trying to think of a situation where

(with the obvious exception of a mouseDown on a resize handle of a stack window)

a stack might resize while an end-user has a mouse pointer depressed over a button or a field.

Re: how to detect that Stack dimension is changed

Posted: Mon Jan 21, 2019 9:57 pm
by bogs
richmond62 wrote:
Mon Jan 21, 2019 9:17 pm
I wonder what the utility of
detecting stack resizes within mouseStillDown routines actually is.
For the sake of argument, let us say you set the resize option of the stack to 'false', but, you want to provide a way for someone to be able to resize it as part of using the program (and I am pretty sure that is exactly the situation in this pane of the P.I.).
Selection_004.png
Supersize me!
It is a feature I use a *lot* in my dev process to prevent me from "accidently" resizing the stack when I have everything perfect on it (it has happened a few times too often) :mrgreen: