How to detect zoombox click
Ken Ray
kray at sonsothunder.com
Sun Jul 17 01:57:37 EDT 2011
Bill,
I have this in my Scripter's Scrapbook, but admittedly it's from 2006 so it may not work... but give it a shot, it detects a maximized and restored window:
on resizeStack newW,newH,oldW,oldH
if the platform is "MacOS" then put 20 into tAdjust
else put 0 into tAdjust
if newW = (item 3 of the windowBoundingRect)-tAdjust then
put "Maximized"
else
if oldW = (item 3 of the windowBoundingRect)-tAdjust then
put "Restored"
else
put oldW,oldH,newW,newH
end if
end if
end resizeStack
Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
On Jul 16, 2011, at 10:41 PM, Bill Vlahos wrote:
> Craig,
>
> That is interesting.
>
> Dragging the stack window also generates a movestack message just like resizing a window generates a resizestack message.
>
> Is there a way to test for a simultaneous movestack and resizestack messages? Unless I find a unique message for that control detecting simultaneous movestack and resizestack messages should do the trick.
>
> On my Mac the resizeStack message is sent first then the moveStack message. The following script works but seems like a huge kludge. Is that order consistent between different versions or Rev/LC and on different platforms?
>
> To test put this script in the stack and create a field called "one" and then manipulate the stack window.
>
> global vZoom
>
> on resizeStack
> put the seconds into vZoom
> end resizeStack
>
> on moveStack
> if vZoom - the seconds = 0 then put "ZoomBox click" into field "one"
> else put "Move or resize" into field "one"
> end moveStack
>
> Is there a more elegant way to detect simultaneous messages?
>
>
> Bill Vlahos
> _________________
> InfoWallet (http://www.infowallet.com) is about keeping your important life information with you, accessible, and secure.
>
> On Jul 16, 2011, at 8:01 PM, DunbarX at aol.com wrote:
>
>> A movestack message is also sent. Not sure why, though.
>>
>>
>> Might this help, since resizing the window manually does not send this message?
>>
>>
>> Craig Newman
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Bill Vlahos <bvlahos at mac.com>
>> To: How to use LiveCode <use-livecode at lists.runrev.com>
>> Sent: Fri, Jul 15, 2011 6:57 pm
>> Subject: How to detect zoombox click
>>
>>
>> I want to detect when a user clicks the zoombox (green light on a Mac) and do
>> something similar to iTunes where if you click the zoombox the program doesn't
>> just resize itself but goes into a different mode.
>>
>> The only message I see is a resizeStack message but that happens if the user
>> resizes the window manually.
>>
>> Bill Vlahos
>> _________________
>> InfoWallet (http://www.infowallet.com) is about keeping your important life
>> information with you, accessible, and secure.
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list