how to detect that Stack dimension is changed

Are you developing tools to extend the LiveCode environment? This is the place to talk about the nuts and bolts of extending our nuts and bolts. If you want to use a LiveCode or third party Environment extension, visit the Using Evironment Extensions forum.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
operoutka
Posts: 12
Joined: Tue Apr 04, 2006 6:50 am

how to detect that Stack dimension is changed

Post by operoutka » Thu Jan 17, 2019 9:44 pm

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

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: how to detect that Stack dimension is changed

Post by bogs » Thu Jan 17, 2019 10:13 pm

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
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: how to detect that Stack dimension is changed

Post by richmond62 » Mon Jan 21, 2019 8:19 pm

If you are going to want this in mouseStillDown routines
you will have to put bogs' code into a global and not a local.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: how to detect that Stack dimension is changed

Post by bogs » Mon Jan 21, 2019 8:37 pm

...or even a custom property, which is where I probably should have located it to begin with :?
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: how to detect that Stack dimension is changed

Post by richmond62 » Mon Jan 21, 2019 9:17 pm

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.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: how to detect that Stack dimension is changed

Post by bogs » Mon Jan 21, 2019 9:57 pm

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:
Image

Post Reply

Return to “Making IDE Plugins”