Control.computeSize

Returns the preferred size of the receiver. <p> The <em>preferred size</em> of a control is the size that it would best be displayed at. The width hint and height hint arguments allow the caller to ask a control questions such as "Given a particular width, how high does the control need to be to show all of the contents?" To indicate that the caller does not wish to constrain a particular dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint. </p><p> If the changed flag is <code>true</code>, it indicates that the receiver's <em>contents</em> have changed, therefore any caches that a layout manager containing the control may have been keeping need to be flushed. When the control is resized, the changed flag will be <code>false</code>, so layout manager caches can be retained. </p>

@param wHint the width hint (can be <code>SWT.DEFAULT</code>) @param hHint the height hint (can be <code>SWT.DEFAULT</code>) @param changed <code>true</code> if the control's contents have changed, and <code>false</code> otherwise @return the preferred size of the control.

@exception SWTException <ul> <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> </ul>

@see Layout @see #getBorderWidth @see #getBounds @see #getSize @see #pack(bool) @see "computeTrim, getClientArea for controls that implement them"

  1. Point computeSize(int wHint, int hHint)
  2. Point computeSize(int wHint, int hHint, bool changed)
    class Control
    computeSize
    (
    int wHint
    ,
    int hHint
    ,
    bool changed
    )

Meta