IntField — Numeric limited range input field
IntField
( | string label , |
integer minValue , | |
integer maxValue , | |
integer
initialValue
) ; |
label
Explanatory label above the input field
minValue
minimum value
maxValue
maximum value
initialValue
initial value
A numeric input field for integer numbers within a limited range. This can be considered a lightweight version of the <link linkend="Slider_widget">Slider</link> widget, even as a replacement for this when the specific UI doesn't support the Slider. Remember it always makes sense to specify limits for numeric input, even if those limits are very large (e.g. +/- MAXINT).
Fractional numbers are currently not supported.
{ UI::OpenDialog( `VBox( `IntField( "Percentage:", 0, 100, 50), `PushButton(`opt(`default), "&OK") ) ); UI::UserInput(); UI::CloseDialog(); }
// Simple IntField example { UI::OpenDialog( `VBox( `IntField( `id(`perc), "Percentage:", 0, 100, 50), `PushButton(`opt(`default), "&OK") ) ); UI::ChangeWidget(`perc, `Value, 42 ); UI::UserInput(); integer percentage = (integer) UI::QueryWidget(`perc, `Value); UI::CloseDialog(); UI::OpenDialog( `VBox( `Label( sformat( "You entered: %1%%", percentage) ), `PushButton(`opt(`default), "&OK") ) ); UI::UserInput(); UI::CloseDialog(); }