• <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.setDisplayOptions Action

Format
s = CS.UI.setDisplayOptions(ʃwidth := ...ʅ
                         
ʃ, height := ...ʅ
                         
ʃ, resizable := ...ʅ
                         
ʃ, borderColor := ...ʅ
                         
ʃ, titleBarColor := ...ʅ
                         
ʃ, titleBarHeight := ...ʅ
                         
ʃ, keyboard := ...ʅ)
ArgumentDescriptionTypes / Required
widthAll display option arguments are
described in a table below.
number, string
not required
heightnumber, string
not required
resizableboolean
not required
borderColorstring
not required
titleBarColorstring
not required
titleBarHeightnumber
not required
keyboardboolean
not required
Description
The UI.setDisplayOptions action sets the display options for the current web view. Display options can be set for web views showing HTML dialogs or displaying HTML question text.
A web view's default and initial display options can be retrieved using UI.getDisplayOptions.
All display options apply to HTML dialogs, whereas the question text window only responds to the "height" property:
PropertyPlatformValue
"width"AllThe desired width, in display units or a percent, of the dialog.
"height"AllThe desired height, in display units or a percent, of the dialog, or the question text (on Windows only).
"resizable"WindowsIf true, the dialog can be resized.
"borderColor"WindowsThe color of the dialog border, which can be specified as a HTML color name (like "red") or a hex color code (like "#ff0000").
"titleBarColor"WindowsThe color of the dialog's title bar.
"titleBarHeight"WindowsThe height, in display units, of the dialog's title bar.
"keyboard"AndroidIf true, the soft keyboard is brought to the forefront when the dialog is shown.
Return Value
The action returns a boolean value indicating if any web view successfully processed the display options.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form.
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();

    // get the initial display options
    const displayOptions = CS.UI.getDisplayOptions();

    // if the user has not provided an explicit width and height, size the dialog
    // to 100% of the available width and 50% of the available height
    if( !displayOptions.width || !displayOptions.height ) {
        displayOptions.width = "100%";
        displayOptions.height = "50%";

        // size the dialog by setting the display options
        CS.UI.setDisplayOptionsAsync(displayOptions);
    }
</script>
See also: UI Action Invoker Namespace, UI.getDisplayOptions Action