location of open drawer

Scott Morrow scott at elementarysoftware.com
Sat Nov 25 18:16:48 EST 2006


Eric,
Thank you. Your script works beautifully.  I think my poor  
understanding of drawers would have kept me from even thinking about  
this solution.
-Scott

On Nov 25, 2006, at 3:14 AM, Eric Chatonet wrote:

> Scott,
>
> Your problem comes from the fact that decorations are set to empty.
> When decorations are set to empty some features like resizing are  
> disabled.
> Obviously this one too :-(
> So you have to script it.
>
> Something like:
>
> local lAllowDrag, lDif
> ---------------------------------
> on mouseDown
>   put the mouseH & comma & the mouseV into lAllowDrag
>   put item 1 of the loc of this stack  - item 1 of the loc of stack  
> "Drawer" & comma & item 2 of the loc of this stack  - item 2 of the  
> loc of stack "Drawer"  into lDif
> end mouseDown
> ---------------------------------
> on mouseMove x,y
>   if lAllowDrag is empty then exit mouseMove
>   set topLeft of this stack to globalLoc(x - item 1 of lAllowDrag &  
> comma & y - item 2 of lAllowDrag)
>   set the loc of stack "Drawer" to item 1 of the loc of this stack  
> + item 1 of lDif, item 2 of the loc of this stack + item 2 of lDif
> end mouseMove
> ---------------------------------
> on mouseUp
>   put empty into lAllowDrag
>   unlock cursor
> end mouseUp
> ---------------------------------
> on mouseRelease
>   mouseUp --
> end mouseRelease
>
> Best Regards from Paris,
> Eric Chatonet
>
> Le 25 nov. 06 à 11:51, Scott Morrow a écrit :
>
>> Eric,
>> Making it simple is always good advice.  Thank you.  I did as you  
>> suggested and discovered that when the parent stack is moved using  
>> the standard drag handle that the drawer will report its rectangle  
>> accurately.  But if the window is dragged about using some other  
>> method (my original parent stack had the decorations set to empty  
>> and used a custom drag script) the drawer continues to report the  
>> same rect, no matter its location.
>>
>> My purpose is to move palette windows out of the way of a "Save"  
>> dialog sheet.  I have a palette with a large drawer which is often  
>> open so I need to determine whether it is blocking the sheet.  It  
>> appears I will need to construct the rect from other, known  
>> information.  This seems like a bug so I will BugZilla it.
>>
>> -Scott Morrow
>>
>>
>> On Nov 25, 2006, at 1:45 AM, Eric Chatonet wrote:
>>
>>> Hi Scott,
>>>
>>> It should not be the case: a drawer moves with it parent stack  
>>> (Mac OS X only of course)
>>> If I may: when you encounter such an issue, take two minutes to  
>>> make a new stack x, a substack y and a button in the main stack x  
>>> saying "drawer stack y":
>>> If it works this means that something in your project prevents  
>>> normal behavior.
>>> Isolating a feature is always good thinking and saves a lot of  
>>> time to narrow any problem.
>>> Now, where can lies the problem?
>>> Difficult to say ;-)
>>> Sorry.
>>>
>>> Le 25 nov. 06 à 02:44, Scott Morrow a écrit :
>>>
>>>> The rect of a drawered stack doesn't seem to be updated when the  
>>>> parent stack is moved.  I can amend my own code in order to  
>>>> calculate the rect of an open drawer but I was wondering if  
>>>> anyone knew of a cheap method for doing this.
>>>
>>>
>>> Best Regards from Paris,
>>> Eric Chatonet
>
> ---------------------------------------------------------------------- 
> ------------------------
> http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list