Default Button

Pete pete at mollysrevenge.com
Thu Sep 1 15:43:59 EDT 2011


I have entered this as a bug - it's #9707.

Bob, I can't reproduce what you did with the mouseUp at the card level.
 Doesn't trigger for me under the circumstances you described.  It DOES
trigger when I CLICK on the card outside of any controls on it as you'd
expect, but not when I hit return subsequent to that.

One thing that's different from your experiment is the field controls on my
card have their lockText set to true and their traversalOn set to false so
they can never be "active" (which I take to mean they receive focus).  Don't
know if that affects the behavior or not.

I'm happy with the workaround I have of putting a returnKey handler at the
card level which sends a mouseUp mesage to "the defaultButton of me" and
it's now on record as a low priority bug.

Pete
Molly's Revenge <http://www.mollysrevenge.com>




On Thu, Sep 1, 2011 at 10:59 AM, Bob Sneidar <bobs at twft.com> wrote:

> I'm going to say that an active control is one that is not disabled and is
> targeted. I created a new stack, with only one card and one button. In the
> mouseUp of the button I put:
>
> answer "This is the default button" as sheet
>
> Hitting the return key triggers the mouseUp in the button. All well and
> good. Now I create a field and click in the field. Hitting the return key
> does NOT trigger the mouseUp of the button, AS YOU WOULD EXPECT.
>
> Now I tab out of the field so that there is nothing (that I can see)
> targeted. I hit return and I get the dialog, also as you would expect.
>
> NOW I click in the field, then click somewhere in the empty card and hit
> the return key. I do NOT get the dialog box, the mouseUp is NOT triggered,
> this is NOT what you would expect!
>
> I believe this is the source of your intermittent problems getting this to
> work. There is something about clicking in the empty space of a card that
> prevents the engine from sending the return key to the button. If anything,
> THIS is the bug. Tabbing out of the last field and clicking the card should
> result in the same condition, but obviously it does not.
>
> Let's get tricky. In the card script I put this:
> on mouseUp
>   put the target
> end mouseUp
>
> NOW I click the card, then hit the return key, and I get the mouseUp in the
> button triggering every time! Something about trapping the mouseUp message
> seems to produce the correct condition.
>
> Can anyone else verify this experiment?
>
> Bob
>
>
> On Sep 1, 2011, at 10:09 AM, Pete wrote:
>
> > Thanks everyone.
> >
> > Jacque, Like you I'm currently using a returnKey handler for the card
> that
> > sends mouseUp to the button to get round this.
> >
> > Craig, If I "put the defaultbutton of this card", I get the correct
> output.
> > Also, I'm not seeing anything in the dictionary about the button changing
> > size - is that in the defaultButton entry?
> >
> > Mark, maybe the difference between what you did and what I have is that I
> > have 3 field controls on the card in addition to the default Button.
>  Each
> > of the field controls has lockText set to true and traversalOn set to
> false.
> > Thing is, the dictionary says the default button behavior only works if
> > there is no active control on the card, but it doesn't define what an
> active
> > control is so I don't know if the way I defined the field controls
> qualifies
> > them as being inactive or not.
> >
> > I'm getting the behavior I want by using the card level returnKey handler
> > but wondering whether I should enter a bug report about this. There
> doesn't
> > seem any point in defining a button as the default button unless it acts
> as
> > defined in the dictionary, but it would be good to know what qualifies as
> an
> > "active control" before reporting it as a bug.
> >
> > Pete
> > Molly's Revenge <http://www.mollysrevenge.com>
> >
> >
> >
> >
> > On Thu, Sep 1, 2011 at 9:27 AM, Mark Schonewille <
> > m.schonewille at economy-x-talk.com> wrote:
> >
> >> Hi,
> >>
> >> This is what I just did:
> >>
> >> 1) create new stack
> >> 2) drag one default button from the tools palette into your stack
> >> 3) edit the script of the button to make it been on mouseUp (and nothing
> >> else)
> >> 4) compile and close script
> >> 5) press return
> >> 6) hear beep
> >>
> >> --
> >> Best regards,
> >>
> >> Mark Schonewille
> >>
> >> Economy-x-Talk Consulting and Software Engineering
> >> Homepage: http://economy-x-talk.com
> >> Twitter: http://twitter.com/xtalkprogrammer
> >> KvK: 50277553
> >>
> >> Send me a friend request on Facebook if you like
> >> https://www.facebook.com/marksch
> >>
> >> On 1 sep 2011, at 17:20, J. Landman Gay wrote:
> >>
> >>> On 8/31/11 7:29 PM, Pete wrote:
> >>>> I put a default button a card that has a couple of field controls on
> it.
> >>>> The field controls all have lockText set to true and traversalOn set
> to
> >>>> false.  Pressing the return key when the card is active does not
> execute
> >> the
> >>>> mouseUp handler for the default button as claimed by the dictionary.
>  Is
> >>>> there some other setting of the card/button/controls that I have to
> use?
> >>>
> >>> Funny, I never knew about this capability. I've always had to script it
> >> with a returnKey handler in the card, I've never seen a default
> behavior.
> >>
> >>
> >> _______________________________________________
> >> 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