storesize

Asks GDC to store the current size of the current window.

Important: This front call function is experimental. For more information on what experimental means, read the discussion at Experimental front calls.

Syntax

ui.Interface.frontCall("standard", "storesize",
  [], [result]) 
  1. result - The execution status (TRUE=success, FALSE=error).

Usage

This allows you to create the classic GUI with Show/Hide details.

When show is clicked, the window grows to show more information. When hide is clicked, the window returns to its original size.
ON ACTION details
  IF state = 1 THEN
    CALL f.setElementHidden("g2",1)
    CALL f.setElementText("details","&Show details")
    CALL ui.interface.frontCall("standard","restoresize",[200],[ret])
    LET state = 0
  ELSE
    CALL ui.interface.frontCall("standard","storesize",[],[ret])
    CALL f.setElementHidden("g2",0)
    CALL f.setElementText("details","&Hide details")
    LET state = 1
  END IF

The restoresize frontcall takes an optional parameter to define the delay (in milliseconds) used to revert the window size. The window will then smoothly shrink or grow to reach the saved size instead of having its new size immediately.

Calling restoresize without calling storesize, or on a different window, has no effect.

The stored size is a desired size; the layout has always higher priority. For instance, if the saved size is 800x600 and the content of the window is 1024x768, GDC will not be able to shrink to the expected size.