>
>Hi Everyone,
>
>    I hope you can help me with my attempts to script the behaviour and
>appearance of buttons.  I've run into a couple of small problems.
>
>    1.  I wanted to create some buttons that would appear as 3-D when the
>mouse is moved over them, and then simply display there names without border
>in 2-D when the mouse is moved away.  The default settings, in their
>property windows, for the buttons were borders showing and 3-D.  I put the
>following handlers in the script of a group containing the buttons.
>
> on mouseEnter
> if first word of the target is "button"
> then
> set the showBorder of the target to true
> end if
> end mouseEnter
>
> on mouseLeave
> if first word of the target is "button"
> then
> set the showBorder of the target to false
> end if
> end mouseLeave
>
>    The handlers work fine, but when clicking one of the buttons takes me to
>another card or shows a new group, it sometimes (not all of the time) causes
>the button to remain as 3-D when I return to the original card.  Any way
>around this?
>
>    2.  On a similar note, I wanted to create other buttons that are 3-D and
>raised (embossed) when not in use (for example, a note field is hidden) and
>then appear 3-D depressed (engraved) when clicked (for example, when the
>note field is shown).  I also want the button's name and background to
>reverse colours.  So, I used the following script.
>
>on mouseUp
>  lock screen
>  if the visible of fld "Note" of group "Main" is true
>  then
># Button is embossed.
>    set the name of me to "Show my notes"
>    set the hilite of me to false
>     set the foreGroundColor of me to "Black"
>    hide fld "Note"
>  else
># Button is engraved
>    set the name of me to "Hide my notes"
>    set the hilite of me to true
>     set the foreGroundColor of me to "White"
>    set the backGroundColor of me to "black"
>    show fld "Note"
>    if fld "Note" is empty
>    then
>      put "Type your note here�" into fld "Note"
>      select text of fld "Note"
>    end if
>
>    Once again, the handler works fine for a few clicks, but after
>navigating a few cards the button usually loses its border and, hence, it's
>3-D appearance.  I wonder if this has anything to do with the fact that the
>button's hilite is shared.  Any thoughts on this?

In both cases you can reset the default state of buttons in an openCard statement. Also
I've noticed the buttons tend to default in the state they were when you saved the 
stack.

>
>    Regards,
>
>        Greg
>
>_________________________________________


Regards, Andu 
_______________________
[EMAIL PROTECTED]

Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to