Changes between Version 2 and Version 3 of UserGuide/Lua


Ignore:
Timestamp:
06/11/2018 20:05:58 (19 months ago)
Author:
PulkoMandy
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuide/Lua

    v2 v3  
    170170 * {{{messagebox(message)}}} or {{{messagebox(window_title,message)}}} Displays a multiline message. It performs word-wrapping automatically, but you can also include character \n in message to force some carriage-returns. If you need variables in the message, use Lua's concatenation operator .. (two dots) to assemble the message string.
    171171
     172 * {{{windowopen(w,h,label)}}} Opens an empty window. It can then be populated using the functions below.
     173 * {{{windowprint(x, y, text, foreground, background)}}} prints some text in the window. The colors are in the range 0 to 3, from black to white.
     174 * {{{windowbutton(x, y, w, h, label, key)}}} Adds a button in the window, with the given label and shortcut key.
     175 * {{{windowrepeatbutton(x, y, w, h, label, key)}}} Adds a repeatable button. If the user holds the mouse button on it, events are generated repeatedly.
     176 * {{{windowinput(x, y, nbchar)}}} Creates a widget for text input. nbchar defines the width of it.
     177 * {{{accept, val = windowreadline(x, y, value, nbchar, maxchar, decimal, inputtype)}}} runs the text input procedure. x, y, nbchar should match the ones of a previously declared windowinput. nbchar defines the width of the control, while maxchar defines the max string length (the text can scroll if needed). This function blocks until the user is done editing the string. If the string is rejected (invalid format, or user pressed the escape key, {{{accept}}} is returned false. {{{val}}} is the new value of the string after editing.
     178 * {{{windowslider(horizontal, x, y, height, nb_elements, thumb_height, initial_position)}}} creates a slider/scroll bar.
     179 * {{{windowmoveslider(slider, nb_elements, thumb_height, position)}}} changes the position of a slider thumb.
     180
     181 * {{{button, button2, key = windowdodialog()}}} waits for the user to interact with the open window. It returs the identifier of the widget clicked by the user, ???, and a keycode if any key was pressed.
     182 * {{{windowclose()}}} closes a window.
     183
    172184=== Interactivity ===
    173185
     
    212224}}}
    213225
    214 = Known bugs and limitations =
    215  * The inputbox is limited. If you have needs that it can't meet, please contact us, we'll see if there is a way to improve it.
    216 
    217226= More reading =
    218227Lua is a well known programming language.
     
    228237So far this includes :
    229238 * Memory.lua : persistent on-disk storage for your scripts. Use this for storing your own settings or other data.
    230 
    231 We welcome any additions you want to make to this set of functions. If something proves too slow when done in lua, we may provide a faster C version, with the same interface whenever possible. This way all scripts can share the enhancements.º
     239 * gui.lua: wrapper for the low level GUI functions, providing a more declarative way to create and layout windows.
     240
     241We welcome any additions you want to make to this set of functions. If something proves too slow when done in lua, we may provide a faster C version, with the same interface whenever possible. This way all scripts can share the enhancements.