Hiding and Showing Pallettes

Andrew Kluthe andrew at ctech.me
Tue Oct 15 02:13:38 CEST 2013


J,

That is exactly where I have the handlers placed. The palette stack is a
mainstack that gets cloned off a template stack and the same for the
"parent" stack that generates the palette.

The "parent" stack is a scale ticket, a scale ticket has weights which are
input on the palette stacks that are cloned from a template stack. There is
a desire when you have many tickets open to have the palettes move,
minimize with the ticket stack. When I click on another open ticket, the
previous ticket's palette stacks are hidden so they don't show up in the
taksbar, etc and are shown again when moving back.

 I get pretty much the exact functionality I want 80 percent of the time,
but there are certain things I can click on to get them to stay stuck up. I
use a similar script on moveStack and mouseDown in the card to keep the
palette visible and floating above the "parent" stack. But the one thing I
can't get to fire a suspend message is when clicking the title bar on
windows 7. I have to click back on the ticket and then to a meatier part of
the stack to make the palettes disappear properly.


On Mon, Oct 14, 2013 at 6:16 PM, J. Landman Gay <jacque at hyperactivesw.com>wrote:

> It's hard to say without seeing your setup, but it sounds like the
> handlers are responding to all stacks rather than just the one you want.
> That would imply that the stack script is in use, or that your other
> "parent" stacks are actually substacks of the main one.
>
> If the parent stack that should respond has only one card, the easiest way
> to handle that is to put the suspend/resume handlers into the first card.
> That way they will only trigger for that stack. If it has several cards
> then the handlers do need to go into the stack script, and you should add a
> check to be sure the clicked stack is the correct parent before taking any
> action.
>
>
> On 10/14/13 1:59 PM, Andrew Kluthe wrote:
>
>> Hey Ya'll,
>>
>> I have a window that has "child windows" that are to be hidden when the
>> parent window is not the current focus, but need to float above the parent
>> window when the parent window is in focus.
>>
>> I have tried leveraging suspend and resume to handle hiding and showing
>> these child palette windows and this works fine when minimizing and
>> restoring windows.
>>
>> However, this fails when you click the title bar of another parent window.
>> the child palette windows just stay in view. There are other things I can
>> click get it to act like this as well.
>>
>> Can anyone recommend a better way to do this? Below are my suspend and
>> resume handlers.
>>
>> the childStacks property referred to below is simply a list of the stacks
>> the parent window has launched. It loops through them to see if they still
>> exist and hides or shows them if they do exist.
>>
>> on suspendStack
>>     put "suspend"
>>     put the childStacks of me into sChildStacks
>>     put the mouseStack into sClickedStack
>>     if sClickedStack contains "load" or sClickedStack contains "scale"
>> then
>>        exit suspendStack
>>     end if
>>     repeat for each line ChildStack in sChildStacks
>>        if ChildStack is among the lines of the OpenStacks then
>>           lock messages
>>           set the bottom of stack ChildStack to the bottom of this stack
>>           set the right of stack ChildStack to the right of this stack
>>           if the visible of stack ChildStack is true then
>>              hide stack ChildStack
>>           end if
>>           unlock messages
>>        end if
>>     end repeat
>>     pass suspendStack
>> end suspendStack
>>
>>
>> on resumeStack
>>     put "resume"
>>     put the childStacks of me into sChildStacks
>>     repeat for each line ChildStack in sChildStacks
>>        if ChildStack is among the lines of the OpenStacks then
>>           lock messages
>>           set the bottom of stack ChildStack to the bottom of this stack
>>           set the right of stack ChildStack to the right of this stack
>>           if the visible of stack ChildStack is false then
>>              show stack ChildStack
>>           end if
>>           unlock messages
>>        end if
>>     end repeat
>>     pass resumeStack
>> end resumeStack
>>
>>
>
> --
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
>
>
> ______________________________**_________________
> 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<http://lists.runrev.com/mailman/listinfo/use-livecode>
>



-- 
Regards,

Andrew Kluthe
andrew at ctech.me


More information about the use-livecode mailing list