<doc>
  <legacy_id>2218</legacy_id>
  <name>closeField</name>
  <type>message</type>
  <syntax>
    <example>closeField</example>
  </syntax>
  <library></library>
  <objects>
    <field/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>User Interaction</category>
  </classification>
  <references>
    <message tag="focusOut">focusOut Message</message>
    <message tag="openField">openField Message</message>
    <message tag="exitField">exitField Message</message>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Sent to a <keyword tag="field">field</keyword> when the <command tag="focus">focus</command> is being removed from that <keyword tag="field">field</keyword> and the <glossary tag="field">field's</glossary> content has changed.</summary>
  <examples>
    <example>on closeField <code><i>-- make sure the user has entered a valid date</i></code></p><p>  if the text of me is not a date then</p><p>    beep</p><p>    answer "Please enter a date."</p><p>    select text of me</p><p>  end if</p><p>end closeField</example>
  </examples>
  <description>
    <p>Handle the <b>closeField</b> <keyword tag="message box">message</keyword> if you want to make sure a <glossary tag="field">field's</glossary> content is correct after it has been changed.</p><p/><p><b>Comments:</b></p><p>The selection is removed from a field (and the field loses focus) when another window is brought to the front, when the user clicks in another field, or when the user tabs out of the field. The field also loses focus when the <b>select</b> <glossary tag="command">command</glossary> is used to <command tag="select">select</command> text in another <keyword tag="field">field</keyword>. However, the <b>closeField</b> <keyword tag="message box">message</keyword> is not sent when the user clicks in the same <keyword tag="field">field</keyword>.</p><p/><p>The <b>closeField</b> <keyword tag="message box">message</keyword> is not sent when a <glossary tag="handler">handler</glossary> changes the field's contents using the <command tag="put">put</command> <glossary tag="command">command</glossary>.</p><p/><p>If the <b>lookAndFeel</b> <glossary tag="property">property</glossary> is set to "Macintosh", the <b>closeField</b> <keyword tag="message box">message</keyword> is generally not sent when another control (such as a <keyword tag="button">button</keyword>) is clicked. This is because clicked buttons do not receive the <command tag="focus">focus</command> on <glossary tag="Mac OS">Mac OS systems</glossary>, and therefore the <keyword tag="selection">selection</keyword> remains active.</p><p/><p>The <b>closeField</b> <keyword tag="message box">message</keyword> is also sent to <glossary tag="button">buttons</glossary> whose <property tag="menuMode">menuMode</property> is "comboBox", since the type-in box in a <glossary tag="combo box">combo box</glossary> behaves like a <keyword tag="field">field</keyword>.</p><p/><p>If a field is closing and its contents have not changed, the <b>exitField</b> <keyword tag="message box">message</keyword> is sent instead of <b>closeField</b>.</p>
  </description>
</doc>