Re: Rookie question - mouseUp on unlocked field

2000-09-26 Thread Sjoerd Op 't Land

I think making the field clear whenever the user clicks in it it is not
nice. If the user want to select some characters, the field clears. Maybe
you want to clear the field when the user clicks the first time (so a cursor
appears). Then the script would be:

on openField
  put empty into field "Degrees C"
  put empty into field "Degrees F"
end openField

A nice one would be:

on returnInField
  send "mouseUp" to button "Convert"
end returnInField

on enterInField
  send "mouseUp" to button "Convert"
end enterInField

So when the user presses return or enter, the convert starts.

BTW Do you know how to round numbers on a certain digits? If not, you can
use this:

set the numberFormat to "0.##"

Tim Barber wrote:
 Hi all 
 
 I'm just fiddling around trying to learn how to use MC.  I'm creating a simple
 temperature converter, and I've encountered a problem.
 
 My card consists of two fields (Degrees C and Degrees F), two labels(for the
 fields) and two buttons (Convert and Quit)
 
 If I understand the MetaTalk reference correctly (and it's more than likely I
 don't), an unlocked field doesn't receive mouseUp messages unless you hold
 down the ctrl key (I'm on a Mac).  How then do I script the field to clear
 itself when I click in it?  I've tried using a selectionChanged message
 handler, but it started acting weird.  Here is the code I'm using.
 
 on selectionChanged #or mouseUp   put empty into field "Degrees C"   put empty
 into field "Degrees F" #I want it to clear both fields   select field "Degrees
 C" end selectionChanged #or mouseUp
 
 My plan is that you click on either field and it clears both.  You then enter
 whichever value you have (Centigrade or Fahrenheit) into the field, and click
 the Convert button.  Depending on which field you entered, the Convert button
 calculates the result and populates the other.
 
 TIA 
 Tim 


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: Rookie question - mouseUp on unlocked field

2000-09-26 Thread Phil Davis



Sjoerd Op 't Land wrote:
 
 I think making the field clear whenever the user clicks in it it is not
 nice. If the user want to select some characters, the field clears. Maybe
 you want to clear the field when the user clicks the first time (so a cursor
 appears). Then the script would be:
 
 on openField
   put empty into field "Degrees C"
   put empty into field "Degrees F"
 end openField
 
 A nice one would be:
 
 on returnInField
   send "mouseUp" to button "Convert"
 end returnInField
 
 on enterInField
   send "mouseUp" to button "Convert"
 end enterInField
 
 So when the user presses return or enter, the convert starts.
 
 BTW Do you know how to round numbers on a certain digits?


Take a look at the description of the "round" function in the Metatalk
Reference stack. It explains how to tell MC which digit to round on.

Phil

 If not, you can
 use this:
 
 set the numberFormat to "0.##"
 
 Tim Barber wrote:
  Hi all
 
  I'm just fiddling around trying to learn how to use MC.  I'm creating a simple
  temperature converter, and I've encountered a problem.
 
  My card consists of two fields (Degrees C and Degrees F), two labels(for the
  fields) and two buttons (Convert and Quit)
 
  If I understand the MetaTalk reference correctly (and it's more than likely I
  don't), an unlocked field doesn't receive mouseUp messages unless you hold
  down the ctrl key (I'm on a Mac).  How then do I script the field to clear
  itself when I click in it?  I've tried using a selectionChanged message
  handler, but it started acting weird.  Here is the code I'm using.
 
  on selectionChanged #or mouseUp   put empty into field "Degrees C"   put empty
  into field "Degrees F" #I want it to clear both fields   select field "Degrees
  C" end selectionChanged #or mouseUp
 
  My plan is that you click on either field and it clears both.  You then enter
  whichever value you have (Centigrade or Fahrenheit) into the field, and click
  the Convert button.  Depending on which field you entered, the Convert button
  calculates the result and populates the other.
 
  TIA
  Tim
 
 Archives: http://www.mail-archive.com/metacard%40lists.best.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.

-- 
Phil Davis
-
[EMAIL PROTECTED]
(503) 417-7930  x234
-
Facilitator
Essentials of eBusiness Computing
Information Technology Institute
http://www.iti.com

Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




RE: Rookie question - mouseUp on unlocked field

2000-09-26 Thread Tim Barber
Title: RE: Rookie question - mouseUp on unlocked field





Excellent suggestions, thank you.
Tim
--
From:  Sjoerd Op 't Land
Reply To:  [EMAIL PROTECTED]
Sent:  Tuesday, 26 September 2000 16:28
To:  [EMAIL PROTECTED]
Subject:  Re: Rookie question - mouseUp on unlocked field


I think making the field clear whenever the user clicks in it it is not
nice. If the user want to select some characters, the field clears. Maybe
you want to clear the field when the user clicks the first time (so a cursor
appears). Then the script would be:


on openField
 put empty into field Degrees C
 put empty into field Degrees F
end openField


A nice one would be:


on returnInField
 send mouseUp to button Convert
end returnInField


on enterInField
 send mouseUp to button Convert
end enterInField


So when the user presses return or enter, the convert starts.


BTW Do you know how to round numbers on a certain digits? If not, you can
use this:


set the numberFormat to 0.##


Tim Barber wrote:
 Hi all 
 
 I'm just fiddling around trying to learn how to use MC. I'm creating a simple
 temperature converter, and I've encountered a problem.
 
 My card consists of two fields (Degrees C and Degrees F), two labels(for the
 fields) and two buttons (Convert and Quit)
 
 If I understand the MetaTalk reference correctly (and it's more than likely I
 don't), an unlocked field doesn't receive mouseUp messages unless you hold
 down the ctrl key (I'm on a Mac). How then do I script the field to clear
 itself when I click in it? I've tried using a selectionChanged message
 handler, but it started acting weird. Here is the code I'm using.
 
 on selectionChanged #or mouseUp put empty into field Degrees C put empty
 into field Degrees F #I want it to clear both fields select field Degrees
 C end selectionChanged #or mouseUp
 
 My plan is that you click on either field and it clears both. You then enter
 whichever value you have (Centigrade or Fahrenheit) into the field, and click
 the Convert button. Depending on which field you entered, the Convert button
 calculates the result and populates the other.
 
 TIA 
 Tim 



Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.