return in field activates default button
    Klaus Major 
    klaus at major-k.de
       
    Sat Jul 28 05:48:52 CDT 2007
    
    
  
Hi Ken,
>> ...
>> Damn, but this happens to me from time to time and I am NOT  
>> dreaming ;-)
>
> No you're right, Klaus, because it just happened to me. I traced it to
Wow, really? Cool, thanks alot :-)
> the MetaCard Menu Bar that was inserted as a library. There are traps
> there for returnInField and enterInField which checks a doClick()
> function that checks for the defaultButton:
>
> function doClick
>   switch
>   case word 1 of the name of the target is "button" and the style of
> the target is not "menu" and not the autoArm of the target
>     click at the loc of the target
>     break
>   case the defaultButton of this card is not empty
>     click at the loc of the defaultButton of this card
>     break
>   default
>     return false
>   end switch
>   return true
> end doClick
>
> I also found out why it had previously not happened to me - for some
> reason, in order for "the defaultbutton of this cd" to return a
> non-empty value, the button that has its default property set to true
> must be in a group (it doesn't have to have the backgroundBehaviour
> turned on). I'm assuming that when you ran into this problem, your
> default button was in a group, right?
No, just a field and a button NOT grouped, as in my recipe.
> This is a bug, pure and simple. Now whether it's a *functional* bug
> (i.e. "the defaultbutton of this cd" should return a value even if the
> default button is not in a group as the docs state), or whether it's a
> *documentation* bug (where they should explain that the button must be
> in a group for it to register), is anyone's guess.
>
> Personally I think it's a functional bug, but I would also like the
> mctools changed so that it doesn't automatically trigger the button on
> returnInField if the field is supposed to accommodate multiple  
> lines of
> text (perhaps something related to whether the vScrollbar is shown, or
> if not if the formattedHeight is less than the height of the field,
> etc.).
>
> Anyway, at least it's been found. Klaus do you want to do the honors
> and log the bug? Or would you like me to do that?
Yes, please, I'm just too humble ;-)
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
Regards
Klaus Major
klaus at major-k.de
http://www.major-k.de
    
    
More information about the metacard
mailing list