Re: Hiding and Showing Pallettes

2013-10-14 Thread dunbarx
Hi.


There seem to be NO messages sent when clicking on the titlebar. None at all. I 
even tried placing a button under the titlebar, to see if messages might pass 
through, but no dice. It seems that the titlebar belongs more to the finder 
than to the stack window, if that makes sense, since double clicking on it will 
minimize it to the dock. (on a Mac)


Craig Newman



-Original Message-
From: Andrew Kluthe and...@ctech.me
To: How to use LiveCode use-livecode@lists.runrev.com
Sent: Mon, Oct 14, 2013 3:00 pm
Subject: Hiding and Showing Pallettes


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

-- 
Regards,

Andrew Kluthe
and...@ctech.me
___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Hiding and Showing Pallettes

2013-10-14 Thread J. Landman Gay
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 | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Hiding and Showing Pallettes

2013-10-14 Thread J. Landman Gay

On 10/14/13 6:03 PM, dunb...@aol.com wrote:

Hi.


There seem to be NO messages sent when clicking on the titlebar. None
at all. I even tried placing a button under the titlebar, to see if
messages might pass through, but no dice. It seems that the titlebar
belongs more to the finder than to the stack window, if that makes
sense, since double clicking on it will minimize it to the dock. (on
a Mac)



I see a resumestack in the message watcher.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Hiding and Showing Pallettes

2013-10-14 Thread Andrew Kluthe
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 jac...@hyperactivesw.comwrote:

 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 | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com


 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode




-- 
Regards,

Andrew Kluthe
and...@ctech.me
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Hiding and Showing Pallettes

2013-10-14 Thread J. Landman Gay

On 10/14/13 7:13 PM, Andrew Kluthe wrote:


  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.


I adjusted the ignored messages in the message watcher and I see now 
that I do get both suspend and resume messages when I click the titlebar 
on a Mac. It may be different on Windows, I haven't got that running 
right now.


How about focusIn and focusOut instead? Do you get those messages? I get 
those as well as resumestack/suspendstack.


Open the Message Watcher and adjust the display to show unhandled 
messages (that was the mistake I made initially, I had it checked. 
Uncheck it.) See what you get when you click the titlebars. That may 
give you a clue.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Hiding and Showing Pallettes

2013-10-14 Thread J. Landman Gay

On 10/14/13 7:13 PM, Andrew Kluthe wrote:

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.


One more thing...topstacks seem to get all messages. Palettes don't. I 
only see resumestack when I click the titlebar of a palette. The main 
stack doesn't get a suspend message -- probably because the palette is 
floating and the main stack isn't quite suspended yet.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode