• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security and Formatting Options
      • Base Actions
      • Application Namespace
      • Clipboard Namespace
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
      • Message Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • System Namespace
      • UI Namespace
        • UI Action Invoker Namespace
        • UI.alert Action
        • UI.closeDialog Action
        • UI.enumerateWebViews Action
        • UI.getDisplayOptions Action
        • UI.getInputData Action
        • UI.getMaxDisplayDimensions Action
        • UI.postWebMessage Action
        • UI.setDisplayOptions Action
        • UI.showDialog Action
        • UI.view Action
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

UI.getMaxDisplayDimensions Action

Format
s = CS.UI.getMaxDisplayDimensions()
Description
The UI.getMaxDisplayDimensions action returns the maximum dimensions, in display units, of HTML dialogs that CSPro can show.
Return Value
The action returns an object with two properties:
PropertyValue
"width"A number containing the maximum possible width of HTML dialogs.
"height"A number containing the maximum possible height of HTML dialogs.
For example, this object, represented in JSON, may look like this:
{
 
"width": 1382,
 
"height": 741
}
Exceptions
The action does not throw exceptions.
Example (HTML + JavaScript)
This example uses the asynchronous version of UI.setDisplayOptions to ensure that the action does not block the current thread:
<script>
    const CS = new CSProActionInvoker();

    // size the HTML dialog to 80% of the maximum possible width and height
    const maxDisplayDimensions = CS.UI.getMaxDisplayDimensions()

    CS.UI.setDisplayOptionsAsync({
        width: maxDisplayDimensions.width * 0.8,
        height: maxDisplayDimensions.height * 0.8,
    });
</script>
See also: UI Action Invoker Namespace, Display Dimensions