Skip to main content

Maintaining unchanged the size of a screenset changing screen resolution

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

A screenset is created in Dialog System on a monitor set at a resolution of 1024 x 768.  However, when the programs are run on a monitor set at 800 x 600 the fonts and bitmaps present in the screenset change size etc.

There is, however, a way to prevent this from happening.

    

Resolution:

Multiple Resolution and Dynamic Window Sizing

Both the multiple resolution and dynamic window sizing features are enabled by a CALLOUT to "dsrtcfg" with a flag of 9 and an identifier that tells Dialog System what resolution the screenset was defined in.

Dialog System uses Panels V2 generic coordinates, which provides a basis for cross-resolution support and compatibility with differing graphics adapters. This results in differing coordinate values for what otherwise appear to be the same resolution value.

To check the value you need for your definition platform, a verification program is supplied with Dialog System: this displays a message box identifying the resolution identifier you need to use to implement the changes.

This is executed as follows:

runw dsreschk

This program displays a resolution identifier to be passed to the Dialog System run-time call as detailed below. Code the following dialog in your SCREENSET-INITIALIZED, or other dialog table which will be executed before the windows creation:

    CLEAR-CALLOUT-PARAMETERS $NULL

    CALLOUT-PARAMETER 1 CONFIG-FLAG $NULL

    CALLOUT-PARAMETER 2 CONFIG-VALUE $NULL

    MOVE 9 CONFIG-FLAG

    MOVE <resolution id> CONFIG-VALUE

    CALLOUT "dsrtcfg" 3 $PARMLIST

* CONFIG-FLAG and CONFIG-VALUE should be C5 4 byte data fields.

The demonstration screenset sizetest.gs demonstrates the use of this functionality.

Once enabled, you can switch off dynamic sizing by a further CALLOUT as detailed above, with a CONFIG-VALUE set to 0.

This screenset was defined under 1024x768 resolution. Simply run the screenset on any resolution monitor. The windows will be created at an appropriate size, and any resizing by dragging of the windows size border automatically repositions all windows and gadgets in an appropriate position.

Old KB# 5016