SCALEUNITS property
Applies To
Windows
Description
This is a WINDOW property that defines the units used when accessing layout properties like SIZE, CLIENTSIZE, TRACKINGSIZE and so on. Note that it also affects events like BUTTONDOWN and methods like TEXTREC too. It accepts the following values:
Usage
Remarks
Value | Description |
---|---|
"0" | Scaling units are Pixels |
"1" | Scaling units are DIPs |
Example
Scale a form and examine its SIZE using different SCALEUNITS
* // SCALEUNITS property equates - (from PS_WINDOW_EQUATES) equ PS_SCU_PIXELS$ to 0 equ PS_SCU_DIPS$ to 1 * // Assume we are currently running with Pixel units call set_Property_Only( @window, "SIZE", 10 : @fm: 10 : @fm : 400 : @fm :300 ) * // Now scale the window to twice its normal size ( actual XY remains constant * // for a form when setting SCALEFACTOR - only the width and height change) call set_Property_Only( @window, "SCALEUNITS", PS_SCU_DIPS$ ) * // SIZE returns 10x10x800x600 pxSize = get_Property( @window, "SIZE" ) * // Now set the scaling units to DIPs call set_Property_Only( @window, "SCALEUNITS", PS_SCU_DIPS$ ) * // SIZE returns 5x5x400x300 dipSize = get_Property( @window, "SIZE" ) * // Note that the X and Y returned in the DIPs SIZE above have also been scaled. * // The form has not moved, but the units of measurement have changed, so the * // location is reported relative to a _theoretical_ scaled desktop size.
At first glance it may seem that the SCALEUNITS property should be a SYSTEM property rather than a WINDOW one, but bear in mind that OpenInsight applications may inherit from one another, and executing a form designed for one set of units while running in another application with a different setting would undoubtedly cause problems.