<doc>
  <legacy_id>1169</legacy_id>
  <name>margins</name>
  <type>property</type>
  <syntax>
    <example>set the margins of <i>object</i> to {<i>pixels</i> | <i>left</i>,<i>top</i>,<i>right</i>,<i>bottom</i>}</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Appearance &amp; Positioning</category>
  </classification>
  <references>
    <property tag="bottomMargin">bottomMargin Property</property>
    <property tag="boundingRect">boundingRect Property</property>
    <property tag="formattedHeight">formattedHeight Property</property>
    <property tag="formattedWidth">formattedWidth Property</property>
    <property tag="leftMargin">leftMargin Property</property>
    <property tag="rectangle">rectangle Property</property>
    <property tag="rightMargin">rightMargin Property</property>
    <property tag="topMargin">topMargin Property</property>
    <property tag="wideMargins">wideMargins Property</property>
    <property tag="textAlign">textAlign Property</property>
  </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>Specifies how much empty space is left on each side between an <glossary tag="object">object's</glossary> edges and its contents.</summary>
  <examples>
    <example>set the margins of group ID 8 to 20 <code><i>-- sets all four margins</i></code></example>
    <example>set the margins of button myButton to 2,10,2,10</example>
    <example>set the margins of field "Info" to three</example>
  </examples>
  <description>
    <p>Use the <b>margins</b> <glossary tag="property">property</glossary> to control how close text within a <keyword tag="button">button</keyword> or <keyword tag="field">field</keyword> can come to the <glossary tag="object">object's</glossary> edges, how close <glossary tag="object">objects</glossary> in a <command tag="group">group</command> can come to the <glossary tag="group">group's</glossary> edges, and how the <property tag="label">label</property> of a <keyword tag="graphic">graphic</keyword> is displayed.</p><p/><p><b>Value:</b></p><p>The <b>margins</b> of an object consists of either a <href tag="../glossary/nondashnegative.xml">non-negative</href> <keyword tag="integer">integer</keyword>, or four <href tag="../glossary/nondashnegative.xml">non-negative</href> <glossary tag="integer">integers</glossary> separated by commas.</p><p/><p>By default, the <b>margins</b> <glossary tag="property">property</glossary> of a <keyword tag="field">field</keyword> is set to 8. If the <glossary tag="field">field's</glossary> <property tag="wideMargins">wideMargins</property> <glossary tag="property">property</glossary> is true, the <glossary tag="field">field's</glossary> <b>margins</b> is set to 20.</p><p/><p>The default <b>margins</b> setting for an <glossary tag="object">object</glossary> other than a <keyword tag="field">field</keyword> is 4.</p><p/><p><b>Comments:</b></p><p>If a single integer is specified, all four margins of the object are set to that number of pixels. If four integers are provided, the object's top, left, bottom, and right margins are set to each one respectively:</p><p/><p>* item 1 of the <b>margins</b> <glossary tag="property">property</glossary> is equal to the leftMargin<b/></p><p>*  2 of the <b>margins</b> is equal to the topMargin<b/></p><p>*  3 of the <b>margins</b> is equal to the rightMargin<b/></p><p>*  4 is equal to the bottomMargin<b/></p><p/><p>If the <b/>lookAndFeel is set to "Motif", <glossary tag="control">controls</glossary> require two <property tag="pixels">pixels</property> of margin space for the border that shows when the <keyword tag="control">control</keyword> is <glossary tag="active control">active (focused)</glossary>. To avoid interfering with this border on <glossary tag="Unix">Unix systems</glossary>, set the <b>margins</b> <glossary tag="property">property</glossary> of <glossary tag="group">groups</glossary> to at least 2 if the <command tag="group">group</command> contains <glossary tag="control">controls</glossary> whose <property tag="traversalOn">traversalOn</property> <glossary tag="property">property</glossary> is set to true.</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> The <b>margins</b> of an <glossary tag="object">object</glossary> include the 2-<glossary tag="pixel">pixel</glossary> space required for the focus border, even if the <property tag="lookAndFeel">lookAndFeel</property> is not "Motif". This means that 2 is the smallest usable margin, rather than zero. For example, if the <b>margins</b> of a <keyword tag="field">field</keyword> is set to zero, a few <property tag="pixels">pixels</property> at the edge of the <glossary tag="field">field's</glossary> text may be cut off.</p><p/><p>The <b>margins</b> setting of an <keyword tag="image">image</keyword>, <keyword tag="player">player</keyword>, or <keyword tag="scrollbar">scrollbar</keyword> has no effect.</p>
  </description>
</doc>