Skip to content

Automatic scaling

Info

All functionality described below requires the script libraries:

  • scWM
  • scAlert for logging errors

WideQuick Modular Framework comes with a scaling feature. This means that project will automatically scale to to the screen it is currently being displayed on. This also works on WideQuick Remote Clients and on WideQuick Web Clients. However, Web Clients will scale relative to the browser window rather than the screen resolution.

Scaling is achieved using the built in zoom-function in WideQuick. Since scaling is done by zooming in the view as opposed to scaling the objects in the view no consideration needs to be taken when building views. They will look identical no matter the display or browser window.

Scaling popups

Popups can also use this scaling factor to automatically resize themselves to the screen or browser. Scaling is in direct proportion to the scaling of the main window. This is done using the function below on the onLoad() script of the popup:

Add this to the onLoad script of the popup
1
scWM.scaleAndPlacePopup(this) 

Unlike the automatic scaling for workviews, popups require that pannable/zoomable is enabled on the workview of the popup. This can be modified under Workview properties/Layout. An image of the settings for layout is provided below:

Pannable/Zoomable

Placement for popups

For smaller popups it is not always necessary to scale the popup, even on smaller screens. However, we still want to center the popup. This can achieved by using the function below on the onLoad() script for the popup workview:

Add this to the onLoad script of the popup
1
scWM.placePopup(this)

This will ensure that the popup is placed in the center of the screen.