9 HighDPI Support

The resolution of modern screens is constantly growing. This means that the requirements for the design and quality of the operating elements and interfaces are also changing. Problems are often that applications appear much too small and text and graphics are displayed blurred or pixelated. The resolution, DPI and scaling set in the system, as well as fonts and the size and quality of images, influence the appearance of an application. To ensure that existing applications are also displayed in detail and sharpness on high-resolution screens, they must be prepared for HighDPI.

Figure 16-35: without HighDPI support

Figure 16-36: with HighDPI support

The IDM for Motif, Qt and Microsoft Windows as of version A.06.03.a (only the IDM for Windows 11 on Microsoft Windows) now provides the appropriate tools to support high-resolution screens and future-proof applications.
In addition, working with multiple screens has been improved. IDM applications now respect the system's DPI settings and scaling factors. As a result, previous problems such as pixelated, muddy, or too-small applications or reduced font sizes at high resolutions and small screen sizes (the effects can vary by system) no longer occur. The IDM now automatically adjusts geometry, layout, font sizes, graphics and cursors to the appropriate resolution and DPI determined by the system.
The scaling factor is based on the system settings of the respective desktop environment.
However, the user is free to make other settings or intervene creatively through various new attributes, options and mechanisms.

9.1 Start options

-IDMscale <integer>

The startup option -IDMscale <integer> can be used to enable or disable scaling by the IDM. Under Qt and Motif, the value specifies the scaling in %.

Figure 16-37: left started normally (system scaling 100%), right started with 150% scaling

Note

This option should not be used under Microsoft Windows. DPI awareness is a property of the application and should be specified in a manifest file. For testing purposes, DPI awareness can be turned on (value: 1) or off (value: 0).

Attention:

It is recommended to not use a scaling > 0 and < 100%, as this may impact the display and operation of objects.

-IDMtiledpi <integer>

Graphics are automatically scaled according to the set scaling factor. It is assumed here that the images have been designed for a DPI value of 96. If the images of the application have been designed for a higher resolution, this can be set via the start option -IDMtiledpi <integer>. The size of an image is then converted to the currently valid DPI value based on this value and scaled accordingly.

Likewise, this setting can be made directly on the setup object with the .tiledpi attribute (see Enhancement to the setup object).

9.2 Layout resources

Until now, the available predefined resources in IDM were always WSI- or system-dependent and always required complex adaptations when transferred to other systems. IDM A.06.03.a now offers WSI-independent and HighDPI-compliant predefined layout resources for the first time. This includes font , color and cursor resources, which are available on all systems in similar form and meaning. This offers the enormous added value that dialogs which have been completely converted to the new UI resources can now be transferred to other systems easily and without effort. These resources can be identified by the naming scheme UI*_FONT, UI*_COLOR or UI*_CURSOR.

Example:

module Resc

 

font FontNormal "UI_FONT";

font FontBig "UI_FONT", 16;

font FontFixed "UI_FIXED_FONT";

 

cursor CurStop "UI_STOP_CURSOR";

 

!! Background color for group objects

color ColGrp "UI_BG_COLOR";

!! Background color for input objects

color ColInp "UI_INPUTBG_COLOR";

The UI_resource names can also be queried - like all other predefined resource names- at the setup object via the attributes .colorname[integer], .fontname[integer], .cursorname[integer].

Cursor

The uniform Cursor resources have the naming scheme UI*_CURSOR and are defined as follows:

UI_CURSOR

Default cursor usually arrow

UI_IBEAM_CURSOR

Edittext insertion marker

UI_WAIT_CURSOR

Busy indicator, "hourglass"

UI_CROSS_CURSOR

Cross

UI_UP_CURSOR

Up arrow

UI_SIZEDIAGF_CURSOR

Sizing arrow from upper left to lower right

UI_SIZEDIAGB_CURSOR

Sizing arrow from lower left to upper right

UI_SIZEVER_CURSOR

Sizing arrow from top to bottom

UI_SIZEHOR_CURSOR

Sizing arrow from left to right

UI_MOVE_CURSOR

Moving arrow in all directions

UI_STOP_CURSOR

Prohibition sign (crossed out circle)

UI_HAND_CURSOR

Hand symbol (index finger used for pointing)

UI_HELP_CURSOR

Arrow with question mark (for context help mode)

Fonts

The unified font resources have the naming scheme UI*_FONT and are defined as follows:

UI_FONT

Font used by default for UI elements (Default or Dialog Font).

UI_FIXED_FONT

Font with a fixed character width.

UI_MENU_FONT

Font used for menus.

UI_TITLE_FONT

Font used in the window title bar.

UI_SMALLTITLE_FONT

Font used in a small/low window title bar.

UI_STATUSBAR_FONT

Font used in the status bar.

UI_NULL_FONT

Behavior as if no font setting was made (null).
The WSI uses the default system font provided for the UI element or a system fallback font.

Color

The color resources have the naming scheme UI*_COLOR and are defined as follows:

UI_BG_COLOR

Color used by default for general backgrounds of (mostly group) objects.
Used for object classes with attribute .bgc/.bgc[], e.g. window, groupbox, notepage, statictext, pushbutton...

UI_FG_COLOR

Color used by default for general foreground/text color of (mostly group) objects.
Used for object classes with attribute .fgc/.fgc [], e.g. window, groupbox, notepage, statictext, pushbutton...

UI_INPUTBG_COLOR

Color used by default for backgrounds of input/selection objects.
Use e.g. for edittext, lists, tables, poptext, treeview...(e.g. object classes with attributes .bgc/.textbgc)

UI_INPUTFG_COLOR

Color used by default for foregrounds of input/selection objects, such as edittext, lists, tables, poptext, treeview
(e.g. object classes with attributes .fgc/.textfgc).

UI_BUTTONBG_COLOR

Color used by default in the background of button-like objects, e.g. pushbutton or image
(e.g. object classes with attribute .bgc/.imagebgc).

UI_BUTTONFG_COLOR

Color used by default when foregrounding button-type objects,
e.g. pushbutton or image (e.g. object classes with attribute .fgc/.imagefgc).

UI_BORDER_COLOR

Color used by default as border (e.g. at .bordercolor).

UI_ACTIVEBG_COLOR

Color that is used by default as background color of the active element, e.g. for lists, pop text, tables, possibly progressbar, markers etc.
Mostly inversion of the normal foreground and background colors of the widget (e.g. object classes with attribute .bgc ).

UI_ACTIVEFG_COLOR

Color that is used by default as foreground/text color of the active element, e.g. for lists, poptext, tables, possibly progressbar, markers etc.
Mostly inversion of the normal foreground and background colors of the object (e.g. object classes with attribute .fgc).

UI_TITLEBG_COLOR

Color used by default as background color for title bars or borders of windows/dialogs,
if supported (e.g. at attribute .titlebgc).

UI_TITLEFG_COLOR

Color to be used by default as foreground/ text color for title bars or borders of windows/dialogs,
if supported (e.g. at attribute .titlefgc).

UI_MENUBG_COLOR

Color to be used by default as background color for menus,
if supported (e.g. at attribute .titlebgc).

UI_MENUFG_COLOR

Color to be used by default as foreground/text color for menus,
if supported (e.g. at attribute .titlefgc).

UI_HEADERBG_COLOR

Color used by default as background color in table headers - if supported.

UI_HEADERFG_COLOR

Color used by default as foreground/text color for table headers – if supported.
Use with tablefield (e.g. at attribute .rowheadfgc, .cloheadfgc).

UI_NULL_COLOR

Behavior as if no color (null) was set. WSI draws according to its default palette.

It may happen that not all UI*COLORS differ from each other. This is due to the fact that most colors are "calculated" from a few basic colors from the desktops.

Notes Motif:

In addition to the UI*_COLOR colors, the system names for color resources have been completed. Newly added are:

  • INACTIVE_BACKGROUND
  • INACTIVE_FOREGROUND
  • INACTIVE_TOP_SHADOW
  • INACTIVE_BOTTOM_SHADOW
  • INACTIVE_SELECT
  • SECONDARY_BACKGROUND
  • SECONDARY_FOREGROUND
  • SECONDARY_TOP_SHADOW
  • SECONDARY_BOTTOM_SHADOW
  • SECONDARY_SELECT

Notes Windows:

The UI*_COLOR colors access the Windows system colors. It should be noted that with the introduction of Visual Styles, the individual objects no longer use the system colors, but the colors defined by the theme. Depending on the selected theme there can be strong discrepancies. Therefore, if possible, no colors (or better the UI_NULL_COLOR) should be set under Windows.
Furthermore, it should be noted that with Windows 10 the color variety has been reduced. For example, the colors UI_HEADERBG_COLOR, UI_HEADERFG_COLOR, UI_MENUBG_COLOR, UI_MENUFG_COLOR, UI_TITLEBG_COLOR and UI_TITLEFG_COLOR are no longer supported. This means that these colors are still available and usable for the user, but they are currently not used by any object by default.

Notes Qt:

The UI*_COLOR colors access the colors of the standard palette offered by Qt. The colors are based on the ColorGroup Normal or Active. The colors of the standard palette are determined by the currently set system style.

In addition to the UI*_COLOR colors, the predefined colors have been supplemented by further ColorRoles offered by the Qt Toolkit. New additions (in all forms of the ColorGroups) are:

  • BRIGHTTEXT
  • ALTERNATEBASE
  • TOOLTIPBASE
  • TOOLTIPTEXT
  • LINK
  • LINKVISITED
  • PLACEHOLDERTEXT

9.3 Enhancement to the tile resource

The existing scaling options at the Tile resource have been extended. It is now possible to specify a .propscale that determines how a tile should be scaled. Thus, tiles can now be scaled according to the following characteristics:

Figure 16-38: the same picture with different values of the attribute .scalestyle at a system scaling of 150%

The following values are available for selection in the rule language:

Definition on Tile Dynamic setting Meaning
noscale scalestyle_none

The pattern or image is not scaled. .tiledpi has no impact.

scale scalestyle_any

The height and width of the pattern or image are fully enlarged to fit the available area.

propscale scalestyle_prop

Height and width of the pattern or image are enlarged to the available area, while height and width proportions of the pattern or image are maintained in any case. I.e. free spaces can be created above and below or left and right.

numscale scalestyle_num

The scaling of the pattern or image is done by a numerical scaling divider. The scaling is done in quarter steps, i.e. 1.25-fold, 1.5-fold, 1.75-fold, 2-fold, 2.25-fold, 2.5-fold, and so on.
A downscaling is done down to a maximum of 0.25-fold.

dpi scalestyle_dpi

The pattern or image is always scaled according to the set screen scaling.

Not provided

scalestyle_auto

The pattern or image is scaled according to the set screen scaling. A scaling compatible to the previous version takes place. Default value

The scalestyle can be specified either directly with the tile definition or as a dynamic attribute.

Tile definition:

tileSpec ::= <tileBitmap> | "<file path>" | "<graphics resource>" { scale | noscale | numscale | propscale | dpiscale} ;

Dynamic attribute:

 

Identifier

Data Type

Rule Language

.scalestyle

enum

C

AT_scalestyle

DT_enum

COBOL

AT-scalestyle

DT-enum

Classification

object-specific attribute

Objects

tile

Access

get, set

Default value

scalestyle_auto

changed event

no

Inheritance

Example:

dialog D

tile Ti_Rect_Pattern 5,5,

  "#####",

  "# #",

  "# #",

  "# #",

  "#####" noscale;          // corresponds to scalestyle_none

tile Ti_BG „bg.gif“ scale;  // corresponds to scalestyle_any

tile Ti_Logo „logo.gif“;    // default: scalestyle_auto

...

on dialog start {

  if setup.scale > 100 then

  Ti_Logo.scalestyle := scalestyle_prop;   // dynamic

endif

}

See also chapter “tile (pattern)” in manual “Resource Reference”.

9.4 Enhancement to the font resource

The font resource has a new property .propscale. This controls whether the horizontal and vertical raster should be set proportionally to the maximum value, which is determined by calculating the value of xraster and yraster of the font raster.

The property can be specified either directly whith the font definition or as a dynamic attribute.

The divisor is used to refine the grid.

Font definition:

fontspec ::=

...

...

{ x:= * <xscale> % + <xoffset> | / <xdivider>} { y:= * <yscale> %

+ <yoffset> | / <ydivider>}

{ propscale }

{ r:= "<RefString >" } ;

Dynamic attribute:

 

Identifier

Data Type

Rule Language

.propscale

boolean

C

AT_propscale

DT_boolean

COBOL

AT-propscale

DT-boolean

Classification

object-specific attribute

Objects

font

Access

get, set

Default value

false

changed event

no

Inheritance

See also chapter “font ” in manual “Resource Reference”.

9.5 Enhancement to the setup object

 

Identifier

Data Type

Rule Language

.tiledpi

integer

C

AT_tiledpi

DT_integer

COBOL

AT-tiledpi

DT-integer

Classification

object-specific attribute

Objects

setup

Access

get, set

Default value

changed event

no

Inheritance

 

Identifier

Data Type

Rule Language

.tiledpi

integer

C

AT_tiledpi

DT_integer

COBOL

AT-tiledpi

DT-integer

Classification

object-specific attribute

Objects

setup

Access

get, set

Default value

96

changed event

no

Inheritance

This attribute determines for which resolution the images/patterns were designed. The size of an image/pattern is converted to the currently valid DPI value based on this value.

See also chapter “tile (pattern)” in manual “Object Reference”.

9.6 Enhancement to the image object

For better alignment and extended layout options, the following attributes on the Image object can now be used to control margins or spacing:

 

Identifier

Data Type

Rule Language

.xmargin

integer

C

AT_xmargin

DT_integer

COBOL

AT-ymargin

DT-integer

Classification

object-specific attribute

Objects

image

Access

get, set

Default value

0

changed event

no

Inheritance

ja

This attribute determines the horizontal distance between the border and the display area.

 

 

Identifier

Data Type

Rule Language

.ymargin

integer

C

AT_ymargin

DT_integer

COBOL

AT-ymargin

DT-integer

Classification

object-specific attribute

Objects

image

Access

get, set

Default value

0

changed event

no

Inheritance

ja

This attribute determines the vertical distance between the border and the display area.

See also chapter “tile (pattern)” in manual “Object Reference”.

9.7 Support of HiDPI image variants

To achieve an optimal design of the interface regarding images and application icons when using the higher resolution, it is recommended to use images adapted to the scaling factor.
Until now, there were only limited options for the Windows and Qt window systems. Up to now, Windows has offered the ICON/BITMAP mechanism and Qt the Icon Resource mechanism for support in this regard. Both mechanisms allow multiple resolution levels to be maintained, but are limited in terms of image type or usage. Such a mechanism does not exist for Motif.
The IDM A.06.03.a therefore provides an option for loading multiple resolution levels that can be applied equally to Windows, Qt and Motif and is thus also system-independent.
The tile management of the IDM was only able to load one image file (e.g.: tile Ti smiley.gif) and did not keep several resolution factors of these (except for the exceptions mentioned above). If there is a scaling of the application, the new loading mechanism for tile files now tries to load the image data for the corresponding scaling factor first. For this purpose, the extension @nx is added to the file name and in front of the suffix, similar to the Qt mechanism. Here n stands for the scaling factor between 2 and 9. The numbre 2 corresponds to a scaling of 150%-249%, 3 of 250%-349%, and so on.
Reasonably the size changes of the variant images should correspond to the scaling factor, whereby a check by the IDM does not take place. So, for example, original image smiley.gif (32x32 pixels), smiley@2x.gif (64x64 pixels), smiley@3x.gif (96x96 pixels), smiley@4x.gif (128x128 pixels).

Example:

tile Ti „smiley.gif“;  // at a scaling of 200% the IDM

                       // automatically loads the image

                       // smiley@2x.gif, if present (Windows, Motif, Qt)

 

                       // at a scaling of 300% the IDM

                       // automatically loads the image

                       // smiley@3x.gif, if present (Windows, Motif, Qt)

 

tile Ti2 „smiley.ico“  // only Windows! ICON mechanism of Windows

                       // takes the best image for the resolution level

                       // from the .ico file

 

tile Ti3 „:/smiley“    // only Qt! The resource mechanism of Qt takes

                       // the best image for the resolution level

                       // from the resource file with the given alias

                       //



9.8 Installation notes

To prepare an application for different resolutions, it may be necessary to keep the images for the different scaling levels. If you want to use this feature and not use the ICON mechanism of Windows or the resource mechanism of Qt, you should take care to deliver the image files according to the @ naming (see chapter “Support of HiDPI image variants”) with your application or include them in the installation packages if necessary.

9.9 Geometry and coordinates

Coordinates and dimensions are transformed by the IDM to match the scale factor of the system to ensure a representation consistent with the system settings.

The geometry units are set in IDM pixel values or raster as before.

The IDM pixel values are internally extrapolated and converted into real pixel values according to the scaling factor. This scales the application as a whole and maintains ratios and proportions of objects to and among each other.

This conversion is done in both directions. When querying the size and position of objects as well as during event processing, the real pixel values from the IDM are also cleaned up and returned in IDM pixel values. The scaling factor is then calculated out again. This applies to all pixel-oriented geometry attributes.

Raster values are either linked to the (HighDPI-capable) character set used or are also set in IDM pixel values and then scaled up. The raster units can also be determined to IDM pixel values based on the underlying font.

9.10 High resolution support under Motif

The Motif toolkit itself does not contain any special technology to support high resolutions, but if the X display used has the Xrender extension implemented and there is support for XFT fonts with the corresponding fonts, IDM applications for Motif can be run on HighDPI screens respecting the scaling factor of the desktop.

What can be done to check whether support is available on the X-Display/desktop used? For this purpose, the server information of the X-Display can be queried via the -IDMserver option:

$ idm -IDMserver

ServerVendor The X.Org Foundation

VendorRelease 12013000

Motif at compiletime @(#)Motif Version 2.3.8

Motif at runtime 2003

XRenderVersion 11 (active)

XFT Support yes (active)

Scaling 200% (active)

Screen dpi 96 (tile dpi: 96, scaled dpi: 192)

The version of the Xrender extension and its usability (active) is listed as well as the presence of XFT and its usability. The "Scaling" line shows the scaling factor set by the user in the desktop/ display settings, or the scaling factor overwritten by the user.

The dpi information provided by X is mostly the default value of 96dpi and thus does not necessarily reflect the real DPI value available on the monitor. The optionally output "tile dpi" and "scaled dpi" are used to control the DPI values used for the images and controls.

Dynamic scaling change is not provided for Motif applications. Likewise, a conversion of the scaling cannot be detected in the desktop.

XFT / Font Handling / Motif Font Support

For a GUI application, the basis for different desktop scaling is provided by the fonts used. In contrast to the fonts that could previously be used under Motif/X, which were mostly specified via an XLFD (X Logical Font Descriptor), XFT fonts are also scaled according to the defined scaling of the desktop.

Until now, the fonts that could be used for IDM for Motif had not automatically adapted to different desktop scaling.

XFT support is available in the IDM only on Linux platforms. Since most desktops on Linux platforms do not set the default font for Motif widgets properly, the IDM uses Liberation Sans as the default font and Liberation Mono as the fixed-width font if no font is set in the dialog. This causes texts in IDM dialogs to scale even without a font set.
By explicitly disabling scaling (via the -IDMscale=0 startup option), the old default fonts can be preserved.

To set an XFT font, only the font name and any additional modifiers are required, as with previous font definitions in the IDM. If the font is available as an XFT font on the system, it will be loaded. The list of XFT fonts available on the system can be viewed in the IDM Editor.

Under CDE-compliant platforms such as AIX and HP-UX, the IDM uses -dt-interface_system-medium-r-normal-* as the default font and -dt-interface_user-medium-r-normal-* as the fixed-width font if no font has been set. Depending on the scaling factor, different sizes of the font are used. Between 1%...75% xs (extra small) is used, between 75%-150% m (medium) is used, between 150%-250% l (large) is used and from 250% xxl (extra extra large) is used. This allows scalability for such applications even if no XFT fonts are available.

9.11 High resolution IDM support for Windows 11

There is now one IDM for Windows 11 and one for Windows 10. The IDM for Windows 11 supports DPI awareness and High DPI.

The IDM for Windows 11 supports high resolutions of the PerMonitor V2 model. Since the support of high resolutions is a feature of the application, it must be marked accordingly in the application manifest. Corresponding settings can be found in the IDM examples. The IDM then recognizes this independently and converts the coordinates accordingly to the configured scaling factor. In other words, the pixel coordinates of the IDM are virtual pixels that are converted according to the defined scaling factor.

The manifest files of the IDM examples mark the built applications as High DPI-Aware. To build an application that is not DPI-Aware, the entire <asmv3:application> block must be removed from the manifest file.

Notes IDM for Windows 11

Note for all functions that process Microsoft Windows messages: If the application supports high resolutions, then all coordinates received via Microsoft Windows messages are the real high-resolution coordinates. The IDM, on the other hand, uses coordinates adjusted for the scaling factor. It must therefore be taken into account that in the case of support for high resolutions, the IDM coordinates are generally no longer identical to the Microsoft Windows coordinates. This affects, for example, input handler, canvas, monitor and subclassing functions, as well as the USW implementations.

Notes IDM for Windows 10 and 11:

The support of high resolutions requires a different processing of Windows messages. As a result, this means that it is no longer possible to adjust windows to underlying constraints, such as grid coordinates, while moving or zooming. Only after releasing the mouse button the window is adjusted to the next grid coordinate.

Internally defined cursors are now enlarged or reduced to the size required by the system in order to automatically adjust them to the defined scaling factor. This ensures that the cursors are displayed correctly if the application supports high resolutions. Previously, the cursors were either filled with transparent areas or simply cut off if the size did not fit.

Images (tile resource) are automatically enlarged according to the defined scaling factor. It is assumed that the images are designed for a DPI value of 96. If the images of the application are designed for a higher resolution, then this can be set in the setup object with the attribute .tiledpi. Automatic adjustment applies only to the tile resource. Images specified directly via filename at the .picture attribute of the image object are not automatically adjusted.

The dialog or message font defined in the system parameters is now used as the default font, since this adapts to the resolution. This can lead to changes in the display of objects that do not have a font set. The mentioned font can be configured via Windows system settings.

The old system fonts are not DPI-Aware. Only the new UI*_FONT fonts adapt to the set resolution.
The old Windows fonts ANSI_FIXED_FONT, ANSI_VAR_FONT, DEVICE_DEFAULT_FONT and SYSTEM_FONT cannot be adapted to different resolutions, so their use is discouraged. The use of fonts without size specification is not recommended, because in such a case a font-specific default size is chosen by Windows font mapper, which does not adapt to different resolutions.

9.12 High resolution support under Qt

To support high resolutions, the IDM enables Qt-side HighDpi scaling as well as the possible rendering of images beyond their actual requested size. I.e. the scaling is done based on the pixel density of the monitor.

Among Linux desktop environments, the support for HighDPI is unfortunately very different and advanced. Since the values for logical and actual pixel density as well as scaling factors are obtained from the Qt framework, less popular desktop environments may provide insufficient values here.

Notes for HighDPI preferences

Qt still offers some environment variables that can be used to control the display at high resolutions. When using such environment variables, however, you should be aware that this overrides the behavior of the IDM, which can lead to unwanted display effects.

Remarks for tile scaling

Objects are displayed by default with the values specified by the desktop style by the WSI/Toolkit. It can therefore happen in certain situations that the desired settings regarding the size and scaling of tiles are not implemented. This applies to the use of tiles for objects with tabs such as the notebook or notepages as well as menus with menuitems. Although the IDM sets the desired display options, the final display is subject to the display policy of the respective DrawingEngine of the set UI style. This means that the display may differ from the set options depending on the style or options may be ignored completely.

9.13 Enhancements/ changes to the IDMED

Arbitrary selection of the font for the user interfaces or rule code is no longer possible. Instead, the font size can be selected between Small - Normal - Large - Extra Large. Of course, this has an influence on the window size.

Under Motif, XFT fonts are also listed in the fonts setting dialog. In addition, the list of selectable fonts can be reduced to UI fonts, X fonts, and XFT fonts for clarity.

The IDMED, TracefileAnalyzer as well as the debugger now use UI resources.

9.14 High-resolution support for USW programming

The DM_GetToolkitDataEx function has been improved to support HighDPI. The Toolkit Datastructure DM_ToolkitDataArgs has been extended for this purpose and now provides detailed information about DPI, scale factor and image. These can be requested via the AT_DPI and AT_XWidget attributes.

Note Motif

The USW programmer must convert the coordinates between the IDM (this concerns attributes as well as events) and the Motif values/structures/functions (X.../ Xt.../ Xm...). The data required for a conversion can be requested via function DM_GetToolkitDataEx using AT_DPI and the Toolkit Datastructure DM_ToolkitDataArgs structure (tile.scale.factor). Depending on the image type, scaling may also be required.

Note for Windows 11

The IDM for Windows 11 supports high resolutions. If an application is released for high resolutions, then the USW objects it uses must also support high resolutions. This means that the USW objects from Windows will have real coordinates (scaled up by the scaling factor), while the IDM will work with virtual coordinates (not scaled up). Practically, not much will change, since the IDM performs the coordinate calculations for the USW object. But it should be taken into account that the control call for UC_C_PrefSize expects real coordinates, since these are normally calculated from toolkit values. If fixed numbers are used here as in the ucarrow example, then these must be corrected by the current DPI value (see ucarrow example).

If the application was started as DPI-Aware, the task UC_I_clientarea of the function UC_Inquire now also expects the high-resolution values.

Extensions to the C Interface for DM_GetToolkitDataEx and DM_GetToolkitDataEx()

In order to support high definition, the C Interface functions "DM_GetToolkitData()", "DM_GetToolkitDataEx()" and "DM_ToolkitDataArgs" (for toolkit data structure) have the following:

Attribute AT_DPI

Renders the DPI value of the system or the displayed object. The function "DM_GetToolkitDataEx()" must be selected with a pointer on a "DM_ToolkitDataArgs" toolkitdata structure. Further DPI related information is rendered in this structure. It is extended with the data field "dpi" and the sub data structure "scale".

Attribute "AT_Tile" resp. "AT_XTile"

This attribute already exists for the "tile" ressource. Now the function "DM_GetToolkitDataEx()" can be selected by a pointer on the toolkit data structure "DM_ToolkitDataArgs" that has been extended with the sub data structure "tile". This structure contains, among other values, the DPI value for which the "tile" ressource has been developed.

Attribute "AT_IsNull"

Renders a value unequal "0" if the specified "color" or "font" ressource has previously been defined to "UI_NULL_FONT" resp. "UI_NULL_COLOR".

 

See also chapter “Toolkit Datastructure DM_ToolkitDataArgs” in manual “Resource Reference”.

See also chapter “DM_GetToolkitDataEx” in manual “C Interface - Functions”.

See also chapter “DM_GetToolkitDataEx” in manual “C Interface - Functions”.