Topic: APLX Help : System Classes : Properties : scale
[ Previous | Next | Contents | Index | APL Home ]

The 'scale' property

Scalar integer in the range 1 to 6

Valid for: All displayable objects, and the Printer and System objects

The scale property sets the units which apply to dimensions of an object. The supported values are:

  1. Use 'character' units. A character unit has the same height as a line of text in the default system font (16 points), and the width of a typical character (8 points). However, because the system font is a proportional font, the width of a given string of characters is not in general an exact multiple of character units. Note that this case has the unfortunate characteristic that the vertical and horizontal scales are different, so it is best to avoid using it.
  2. Use 'dialog' units, (1/8 system-font high, 1/4 system-font wide)
  3. Use point units (nominally 72 points per inch)
  4. Use 'twips' units (nominally 1440 twips per inch)
  5. Use pixel units (also usually 72 per inch on the Macintosh), but this depends on the resolution and screen size.
  6. Use nominal millimetres. Depending on the screen size, this may not be accurate for controls displayed on a screen, but it should be accurate when printing on paper (provided the printer driver is set up correctly).

Changing the scale property on an object has no immediate visible effect, but sets the units for subsequent reading or setting of dimensional properties such as size. It is important to remember that the size property uses the units of the object to which it applies, but the where and extent properties use the units of the parent object. For compatibility with other APL systems, the default value for scale is 1, character units. However, it is usually much better to use scale 5, pixel units, in your applications.

Note that, in APLX, the parent control's scale property is inherited by any children at the time the child is created. Thus, if you set the scale of the System object to 5 before creating any windows, all subsequently-created objects will inherit this value.

Scale used for the Draw method

When you use the Draw method to draw geometric shapes and text on a control or window, a separate scale (specific to the Draw method operations) is used. This is initially set to be the same as the control's scale property value, but can be changed using the 'Scale' operation of the Draw method. This does not affect the scale property of the control.

In addition to the values shown above, you also have the option of using a Draw-method scale which is proportional to the window or control size.

Topic: APLX Help : System Classes : Properties : scale
[ Previous | Next | Contents | Index | APL Home ]