stlab.adobe.com Adobe Systems Incorporated

Mac Widget Metrics
[Widget Library]

Parameters

The following is a list of metrics one can supply for a widget on the Mac. All values are in unit pixels. All values default to 0.

NameStructureNotes
size [ width, height ] Base size of the widget
adjust_position [ left, top ] Number of pixels to push the widget. Positive values move the widget away from the origin of the window.
adjust_size [ width, height ] Adjustments made to the base size of the widget. The adjusted size is passed to the OS so the resulting widget is the base size originally intended.
adjust_baseline value Adjustment of the baseline. Positive values move the baseline away from the origin of the window.
outset [ left, top, right, bottom ] Amount of outset for a given edge of the widget. These amounts affect the base size and position of the widget when the bounds of the widget are set. See Placement Pipeline.
frame [ left, top, right, bottom ] Amount of frame for a given edge of the widget.
inset [ left, top, right, bottom ] Amount of inset for a given edge of the widget.
spacing value If there is text in the widget, this is the spacing needed between the widget's visual element and the text for the widget. Example: check_box has a nonzero spacing, but button has a spacing of 0 (because the text overlays the visual element).

Metrics Pipelines

Measurement Pipeline

  1. All the possible text strings for the widget are measured. The largest width, height and baseline are preserved on a per-element basis (i.e., it is possible for one piece of text to contribute the max width and another to contribute the max height)
  2. The base height of the widget is set to size.height - adjust_size.height
  3. The base width of the widget is set to size.width - adjust_size.width
  4. If text width is nonzero then text_width + spacing is added to the base width of the widget
  5. If there is a valid text baseline value the baseline of the result is set to text_baseline + adjust_baseline
  6. The outset.left is added to the resultant left outset
  7. The outset.left + outset.right is subtracted from the resultant right outset
  8. The outset.top is added to the resultant top outset
  9. The outset.top + outset.bottom is subtracted from the resultant bottom outset
  10. Resultant frame is set from frame
  11. Resultant inset is set from inset
  12. The resultant extents is returned

Placement Pipeline

  1. adjust_position.left - extents.outset.left is added to the left position of the widget
  2. adjust_position.top - extents.outset.top is added to the top position of the widget
  3. The height of the widget is increased by adjust_size.height + extents.outset.top + extents.outset.bottom
  4. The width of the widget is increased by adjust_size.width + extents.outset.left + extents.outset.right
  5. The bounds of the widget are set

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google