Re: AW: How to hilite a checkbox with send mouseup?

2011-02-15 Thread Nonsanity
This works with a checkbox button...

Checkbox button named "Check":

   on mouseUp
  put the hilite of me into msg
   end mouseUp

   on MouseUpWithHilite
  set hilite of me to not hilite of me
  mouseup
   end MouseUpWithHilite

Some other button:

   on mouseUp
  send MouseUpWithHilite to btn "Check"
   end mouseUp

However it does not work so well with a regular button. The effects of
hilite on a regular button don't match the effect of clicking it. The effect
could probably be duplicated, but hilite isn't enough in itself. And it
would also need to be changed from a toggle effect to a delayed effect like
so:

   on MouseUpWithHilite
  set hilite of me to true
  send StopHilite to me in 1 sec
  mouseup
   end MouseUpWithHilite

   on StopHilite
  set the hilite of me to false
   end StopHilite

But as I said, the hilite by itself isn't enough. Probably need to add some
color change, etc.

This method has one advantage over "click at" however, in that it works even
if the checkbox is hidden, in another stack, behind another object, off the
edge of the card, or blocked by another window. The "click at" command would
fail to handle those situations properly.

 ~ Chris Innanen
 ~ Nonsanity


On Tue, Feb 15, 2011 at 12:30 PM, Robert Brenstein  wrote:

> On 15.02.11 at 12:14 -0500 Nonsanity apparently wrote:
>
>> It would be better to do something like add another handler to the button:
>>
>> on MouseUpWithHilite
>>set hilite of me to not hilite of me
>>mouseup
>> end MouseUpWithHilite
>>
>> And send THAT message to the button from afar. This way, the existing
>> MouseUp handler in the button works as expected, and this message has the
>> same result as clicking the button (toggling the hilite in the process)
>> and
>> enacting the MouseUp handler.
>>
>>  ~ Chris Innanen
>>  ~ Nonsanity
>>
>
> Chris,
>
> The above won't work  as intended, it will turn the hilite on for good.
> You would need to add a delay and reverse the hilite before continuing with
> mouseUp.
>
> The click command simulates user physically clicking the button, which
> I believe was the effect that original poster wanted.
>
>
> Robert
>
> ___
> 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: How to hilite a checkbox with send mouseup?

2011-02-15 Thread David C.
On Tue, Feb 15, 2011 at 11:39 AM, Tiemo Hollmann TB  wrote:
> :) it's always great to see how helpful and responsive you guys are, even 
> with such trivial issues!
> Tiemo
>

These folks are great, huh Tiemo? :)
...none of it is ever really trivial, especially when your head hurts
from banging it on the desk trying to figure something out. Even when
you don't need it, it serves as a reminder for the next time.

I'm always completely amazed at what I learn from reading the trivial
things on this list. :)

Best regards,
David C.

___
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: AW: How to hilite a checkbox with send mouseup?

2011-02-15 Thread Robert Brenstein

On 15.02.11 at 12:14 -0500 Nonsanity apparently wrote:

It would be better to do something like add another handler to the button:

on MouseUpWithHilite
set hilite of me to not hilite of me
mouseup
end MouseUpWithHilite

And send THAT message to the button from afar. This way, the existing
MouseUp handler in the button works as expected, and this message has the
same result as clicking the button (toggling the hilite in the process) and
enacting the MouseUp handler.

 ~ Chris Innanen
 ~ Nonsanity


Chris,

The above won't work  as intended, it will turn the hilite on for good.
You would need to add a delay and reverse the hilite before 
continuing with mouseUp.


The click command simulates user physically clicking the button, which
I believe was the effect that original poster wanted.

Robert

___
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


AW: How to hilite a checkbox with send mouseup?

2011-02-15 Thread Tiemo Hollmann TB
:) it's always great to see how helpful and responsive you guys are, even with 
such trivial issues!
Tiemo

> -Ursprüngliche Nachricht-
> Von: use-livecode-boun...@lists.runrev.com [mailto:use-livecode-
> boun...@lists.runrev.com] Im Auftrag von dunb...@aol.com
> Gesendet: Dienstag, 15. Februar 2011 18:15
> An: use-livecode@lists.runrev.com
> Betreff: Re: How to hilite a checkbox with send mouseup?
> 
> This is actually a good thing. Because the actions are separate, you get more
> control.  It is therefore proper that if you want to combine them, you write
> it that way.
> 
> 
> 
> You just have to get used to the details.
> 
> 
> Craig Newman
> 
> 
> -Original Message-
> From: Tiemo Hollmann TB 
> To: 'How to use LiveCode' 
> Sent: Tue, Feb 15, 2011 11:24 am
> Subject: AW: How to hilite a checkbox with send mouseup?
> 
> 
> Hi Jim,
> thanks for your coaching. I wasn' t aware that sending the mousup message
> wouldn't trigger the needed event.
> So I was correct that I have to script both the message and the event.
> Thank you
> Tiemo
> 
> > -Ursprüngliche Nachricht-
> > Von: use-livecode-boun...@lists.runrev.com [mailto:use-livecode-
> > boun...@lists.runrev.com] Im Auftrag von Jim Ault
> > Gesendet: Dienstag, 15. Februar 2011 17:02
> > An: How to use LiveCode
> > Betreff: Re: How to hilite a checkbox with send mouseup?
> >
> >
> >
> > On Feb 15, 2011, at 7:07 AM, Tiemo Hollmann TB wrote:
> >
> > > Hello,
> > >
> > > when sending:  send "mouseup" to btn "test" the button gets the
> > > mouseUp
> > > command, but doesn't hilite, though it's property Autohilite is true.
> > >
> > > Do I really have to set additionally the hilite of that button by
> > > script?
> > >
> > > I also have "pass mouseUp" in the buttons mouseUp handler and I am
> > > getting
> > > "exit" as the result in the message box
> > >
> > > What am I missing? Why do I get "exit" in the message box?
> > >
> > mouseUp is a LCode message, not an event.
> >
> > just as 'mouseUpIwantToTrap' is a message you could send to an object,
> > or a stack script, or a back script, etc.
> >
> > Clicking on a checkbox will both send the message and perform the event.
> > set the hilite of btn "chkboxStatus" to true
> >
> > Sending the 'mouseUp' message will work just fine even if the check
> > box is hidden, on a different card, or on a card in a different
> > stack.  The same goes for setting the hilite.
> >
> > send "mouseUp" to btn id 1022 of card id 1446 of stack "Survey
> > Questions"
> >
> > set the hilite of btn "chkboxStatus" of card id 1446 of stack "Survey
> > Questions" to true
> >
> >
> > Hope this helps
> > -
> > Why not step through your code and see what happens in the flow of the
> > script?
> > It sounds like 'pass mouseUp' is triggering the 'exit' string.
> >
> > Hope this helps
> >
> > Jim Ault
> > Las Vegas
> >
> >
> >
> > ___
> > 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
> 
> 
> ___
> 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: How to hilite a checkbox with send mouseup?

2011-02-15 Thread dunbarx
This is actually a good thing. Because the actions are separate, you get more 
control.  It is therefore proper that if you want to combine them, you write it 
that way.



You just have to get used to the details.


Craig Newman


-Original Message-
From: Tiemo Hollmann TB 
To: 'How to use LiveCode' 
Sent: Tue, Feb 15, 2011 11:24 am
Subject: AW: How to hilite a checkbox with send mouseup?


Hi Jim,
thanks for your coaching. I wasn' t aware that sending the mousup message
wouldn't trigger the needed event.
So I was correct that I have to script both the message and the event.
Thank you
Tiemo

> -Ursprüngliche Nachricht-
> Von: use-livecode-boun...@lists.runrev.com [mailto:use-livecode-
> boun...@lists.runrev.com] Im Auftrag von Jim Ault
> Gesendet: Dienstag, 15. Februar 2011 17:02
> An: How to use LiveCode
> Betreff: Re: How to hilite a checkbox with send mouseup?
> 
> 
> 
> On Feb 15, 2011, at 7:07 AM, Tiemo Hollmann TB wrote:
> 
> > Hello,
> >
> > when sending:  send "mouseup" to btn "test" the button gets the
> > mouseUp
> > command, but doesn't hilite, though it's property Autohilite is true.
> >
> > Do I really have to set additionally the hilite of that button by
> > script?
> >
> > I also have "pass mouseUp" in the buttons mouseUp handler and I am
> > getting
> > "exit" as the result in the message box
> >
> > What am I missing? Why do I get "exit" in the message box?
> >
> mouseUp is a LCode message, not an event.
> 
> just as 'mouseUpIwantToTrap' is a message you could send to an object,
> or a stack script, or a back script, etc.
> 
> Clicking on a checkbox will both send the message and perform the event.
> set the hilite of btn "chkboxStatus" to true
> 
> Sending the 'mouseUp' message will work just fine even if the check
> box is hidden, on a different card, or on a card in a different
> stack.  The same goes for setting the hilite.
> 
> send "mouseUp" to btn id 1022 of card id 1446 of stack "Survey
> Questions"
> 
> set the hilite of btn "chkboxStatus" of card id 1446 of stack "Survey
> Questions" to true
> 
> 
> Hope this helps
> -
> Why not step through your code and see what happens in the flow of the
> script?
> It sounds like 'pass mouseUp' is triggering the 'exit' string.
> 
> Hope this helps
> 
> Jim Ault
> Las Vegas
> 
> 
> 
> ___
> 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

 
___
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: AW: How to hilite a checkbox with send mouseup?

2011-02-15 Thread Nonsanity
It would be better to do something like add another handler to the button:

on MouseUpWithHilite
set hilite of me to not hilite of me
mouseup
end MouseUpWithHilite

And send THAT message to the button from afar. This way, the existing
MouseUp handler in the button works as expected, and this message has the
same result as clicking the button (toggling the hilite in the process) and
enacting the MouseUp handler.

 ~ Chris Innanen
 ~ Nonsanity


On Tue, Feb 15, 2011 at 11:52 AM, Robert Brenstein  wrote:

> On 15.02.11 at 17:24 +0100 Tiemo Hollmann TB apparently wrote:
>
>> Hi Jim,
>> thanks for your coaching. I wasn' t aware that sending the mousup message
>> wouldn't trigger the needed event.
>> So I was correct that I have to script both the message and the event.
>> Thank you
>> Tiemo
>>
>
> In this case, you can use click instead of send:
>
> click at the loc of btn "test"
>
> This will create the event and send the mouseUp.
>
> Robert
>
>
> ___
> 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: AW: How to hilite a checkbox with send mouseup?

2011-02-15 Thread Robert Brenstein

On 15.02.11 at 17:24 +0100 Tiemo Hollmann TB apparently wrote:

Hi Jim,
thanks for your coaching. I wasn' t aware that sending the mousup message
wouldn't trigger the needed event.
So I was correct that I have to script both the message and the event.
Thank you
Tiemo


In this case, you can use click instead of send:

click at the loc of btn "test"

This will create the event and send the mouseUp.

Robert

___
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


AW: How to hilite a checkbox with send mouseup?

2011-02-15 Thread Tiemo Hollmann TB
Hi Jim,
thanks for your coaching. I wasn' t aware that sending the mousup message
wouldn't trigger the needed event.
So I was correct that I have to script both the message and the event.
Thank you
Tiemo

> -Ursprüngliche Nachricht-
> Von: use-livecode-boun...@lists.runrev.com [mailto:use-livecode-
> boun...@lists.runrev.com] Im Auftrag von Jim Ault
> Gesendet: Dienstag, 15. Februar 2011 17:02
> An: How to use LiveCode
> Betreff: Re: How to hilite a checkbox with send mouseup?
> 
> 
> 
> On Feb 15, 2011, at 7:07 AM, Tiemo Hollmann TB wrote:
> 
> > Hello,
> >
> > when sending:  send "mouseup" to btn "test" the button gets the
> > mouseUp
> > command, but doesn't hilite, though it's property Autohilite is true.
> >
> > Do I really have to set additionally the hilite of that button by
> > script?
> >
> > I also have "pass mouseUp" in the buttons mouseUp handler and I am
> > getting
> > "exit" as the result in the message box
> >
> > What am I missing? Why do I get "exit" in the message box?
> >
> mouseUp is a LCode message, not an event.
> 
> just as 'mouseUpIwantToTrap' is a message you could send to an object,
> or a stack script, or a back script, etc.
> 
> Clicking on a checkbox will both send the message and perform the event.
> set the hilite of btn "chkboxStatus" to true
> 
> Sending the 'mouseUp' message will work just fine even if the check
> box is hidden, on a different card, or on a card in a different
> stack.  The same goes for setting the hilite.
> 
> send "mouseUp" to btn id 1022 of card id 1446 of stack "Survey
> Questions"
> 
> set the hilite of btn "chkboxStatus" of card id 1446 of stack "Survey
> Questions" to true
> 
> 
> Hope this helps
> -
> Why not step through your code and see what happens in the flow of the
> script?
> It sounds like 'pass mouseUp' is triggering the 'exit' string.
> 
> Hope this helps
> 
> Jim Ault
> Las Vegas
> 
> 
> 
> ___
> 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: How to hilite a checkbox with send mouseup?

2011-02-15 Thread Jim Ault



On Feb 15, 2011, at 7:07 AM, Tiemo Hollmann TB wrote:


Hello,

when sending:  send "mouseup" to btn "test" the button gets the  
mouseUp

command, but doesn't hilite, though it's property Autohilite is true.

Do I really have to set additionally the hilite of that button by  
script?


I also have "pass mouseUp" in the buttons mouseUp handler and I am  
getting

"exit" as the result in the message box

What am I missing? Why do I get "exit" in the message box?


mouseUp is a LCode message, not an event.

just as 'mouseUpIwantToTrap' is a message you could send to an object,  
or a stack script, or a back script, etc.


Clicking on a checkbox will both send the message and perform the event.
   set the hilite of btn "chkboxStatus" to true

Sending the 'mouseUp' message will work just fine even if the check  
box is hidden, on a different card, or on a card in a different  
stack.  The same goes for setting the hilite.


send "mouseUp" to btn id 1022 of card id 1446 of stack "Survey  
Questions"


set the hilite of btn "chkboxStatus" of card id 1446 of stack "Survey  
Questions" to true



Hope this helps
-
Why not step through your code and see what happens in the flow of the  
script?

It sounds like 'pass mouseUp' is triggering the 'exit' string.

Hope this helps

Jim Ault
Las Vegas



___
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


How to hilite a checkbox with send mouseup?

2011-02-15 Thread Tiemo Hollmann TB
Hello,

when sending:  send "mouseup" to btn "test" the button gets the mouseUp
command, but doesn't hilite, though it's property Autohilite is true.

Do I really have to set additionally the hilite of that button by script?

I also have "pass mouseUp" in the buttons mouseUp handler and I am getting
"exit" as the result in the message box

What am I missing? Why do I get "exit" in the message box?

Thanks

Tiemo

 

 

___
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