Skip to content

PERCWIN_CREATE

PERCWIN_CREATE creates a new percentage window.

Syntax

leo-grammar
CC "AdoScript" PERCWIN_CREATE	[ title:strValue ] [ with-second-bar:boolValue ]
								[ with-cancel-button:boolValue ] .
CC "AdoScript" PERCWIN_CREATE	[ title:strValue ] [ with-second-bar:boolValue ]
								[ with-cancel-button:boolValue ] .

Parameters

  • title (strValue, optional) - sets the title of the percentage window.
  • with-second-bar (boolValue, optional) - if true (i.e., specified alone or with a nonzero value), the percentage window is created with two progress bars, otherwise with one.
  • with-cancel-button (boolValue,optional) - if true (i.e. specified alone or with a nonzero value), the percentage window is created with a cancel button. The cancel button can be pushed by the user while the percentage window is visible. The "canceled" status can be retrieved with the command CC "AdoScript" PERCWIN_IS_CANCELED

Returns

none

Details

This command only creates a percentage window, but does not set the bar to a value.

To set the percentage value, PERCWIN_SET has to be called.

Only one percentage window can exist at a time. If PERCWIN_CREATE is called while another percentage window is existing, the previous one is destroyed automatically.

PERCWIN_CREATE does not return a result.

See Also

PERCWIN_IS_CANCELED
PERCWIN_DESTROY
PERCWIN_SET

Examples

asc
CC "AdoScript" PERCWIN_CREATE title:"My percentage window"
SET step:0
FOR i from:0 to:100 by:2 {
    SET step:(step + 1)
    CC "AdoScript" PERCWIN_SET percentage:(i) text:("Step " + STR step)
    CC "AdoScript" SLEEP ms:200
}
CC "AdoScript" INFOBOX "Finished!"
CC "AdoScript" PERCWIN_DESTROY
CC "AdoScript" PERCWIN_CREATE title:"My percentage window"
SET step:0
FOR i from:0 to:100 by:2 {
    SET step:(step + 1)
    CC "AdoScript" PERCWIN_SET percentage:(i) text:("Step " + STR step)
    CC "AdoScript" SLEEP ms:200
}
CC "AdoScript" INFOBOX "Finished!"
CC "AdoScript" PERCWIN_DESTROY

Creates a percentage windows, updates it regularly and then closes it after the user was informed and clicked ok.

Versions and Changes

Available since ADOxx 1.3