Skip to content

GUI functions

apoxhu edited this page Dec 22, 2019 · 3 revisions

Simple inputs:

Confirm ( [string:title[, string:text]] )
Returns bool:result

TextInput ( [string:title[, string:default_text]] )
Returns string:result

Configurable popups:

MessageBox ( table:setup )
Returns a table with the following items:

{
  success:boolean,
  result:integer,
  inputs:{array of [name:string] = value:string},
  states:{array of [name:string] = state:boolean}
}

Setup table is:

{
  title:string,
  message:string,
  [ titleTextColor:string, ]
  [ messageTextColor:string, ]
  [ backColor:string, ]
  [timeout:number (ms), ]
  [timeoutResultCancel:boolean, ]
  [timeoutResultID:number, ]
  [icon:string, ]
  [display:(integer|lightuserdata), ]
  commands:{array of {value:integer, name:string}},
  inputs:{array of {name:string, value:string, blackFilter:string, whiteFilter:string, vkPlugin:string, maxTextLength:integer}},
  states:{array of {name:string, state:boolean[,group:integer]}
}

MessageBox({title='Test', message='Hello World!', commands={{name='Close'}}}) PopupInput ( [string:title], UIcaller:lightuserdata, table:{{'str'|'int'|'lua'|'handle', name, type-dependent}...}[, string:selectedValue[, integer:x, integer:y]] )
Returns string:value. Example: PopupInput('Test question', GetFocusDisplay(), {'Yes', 'No'})

WaitModal (...)

CloseAllOverlays ()
Returns nothing.

DeskLocked ()
Returns bool:locked

GetDisplayByIndex (...)

DefaultDisplayPositions (...)

GetFocusDisplay ()
Returns userdata (an Obj representing the display in focus).

GetDisplayCollect (...)

FindBestFocus ()
Returns nothing.

FindNextFocus ()
Returns nothing.

GetFocus ()
Returns userdata (an object you can use Obj functions on).

GetTopModal ()
Returns userdata or nil if no modal elements open.

Progress bar related functions:

StartProgress ( string:title )
Returns number:handle.
Handles are actually indexes starting from 0, and they are not unique but rather indicates the index visible on screen (if no progress bar is visible, index will be 0). This means you can clear all progress bars in a loop.

StopProgress ( number:handle )
Returns nothing.

SetProgress ( number:handle, number:value )
Returns nothing.

SetProgressRange ( number:handle, number:min, number:max )
Returns nothing.
Min, max can be any signed integer.

SetProgressText ( number:handle, string:text )
Returns nothing.
Puts given string after title.

IncProgress ( number:handle )
Returns nothing.

Clone this wiki locally