^
AutoPosition_SetNextUIElementRelativeTo
Lua: reagirl.AutoPosition_SetNextUIElementRelativeTo(string element_id)
Set the auto-positioning starting point to the position of a certain ui-element.
Means, autpositioning will place the next ui-element either underneath(when using reagirl.NextLine()) or next to the right of ui-element with element_id.
Note: when passing tabs as parameter, the next ui-element will be placed underneath it(as if you had used reagirl.NextLine())
Parameters:
string element_id |
the element-id of the ui-element, whose position shall be the starting point for the next autopositioned ui-element |
^
NextLine
Lua: reagirl.NextLine(integer y_offset)
Starts a new line, when autopositioning ui-elements using the _add-functions.
Parameters:
integer y_offset |
an additional y-offset, by which the next line shall be moved downwards; nil, for no offset |
^
Background_GetSetColor
Lua: integer red, integer green, integer blue = reagirl.Background_GetSetColor(boolean is_set, integer red, integer green, integer blue)
Gets/Sets the color of the background.
Returnvalues:
integer red |
the current red-color of the background |
integer green |
the current green-color of the background |
integer blue |
the current blue-color of the background |
Parameters:
boolean is_set |
true, set the new background-color; false, only retrieve the current background-color |
integer red |
the new red-color; 0-255 |
integer green |
the new green-color; 0-255 |
integer blue |
the new blue-color; 0-255 |
^
Button_Add
Lua: string button_guid = reagirl.Button_Add(optional integer x, optional integer y, integer w_margin, integer h_margin, string caption, string meaningOfUI_Element, optional function run_function)
Adds a button to a gui.
You can autoposition the button by setting x and/or y to nil, which will position the new button after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
The run-function gets as parameter:
- string element_id - the element_id as string of the pressed button that uses this run-function
Returnvalues:
string button_guid |
a guid that can be used for altering the button-attributes |
Parameters:
optional integer x |
the x position of the button in pixels; negative anchors the button to the right window-side; nil, autoposition after the last ui-element(see description) |
optional integer y |
the y position of the button in pixels; negative anchors the button to the bottom window-side; nil, autoposition after the last ui-element(see description) |
integer w_margin |
a margin left and right of the caption |
integer h_margin |
a margin top and bottom of the caption |
string caption |
the caption of the button |
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
optional function run_function |
a function that shall be run when the button is clicked; will get the button-element_id passed over as first parameter; nil, no run-function for this button |
^
Button_GetDisabled
Lua: boolean retval = reagirl.Button_GetDisabled(string element_id)
Gets a button's disabled(non clickable)-state.
Returnvalues:
boolean state |
true, the button is disabled; false, the button is not disabled. |
Parameters:
string element_id |
the guid of the button, whose disability-state you want to get |
^
Button_GetRadius
Lua: integer radius = reagirl.Button_GetRadius(string element_id)
Gets a button's radius.
Returnvalues:
integer radius |
the radius of the button |
Parameters:
string element_id |
the guid of the button, whose radius you want to get |
^
Button_SetDisabled
Lua: reagirl.Button_SetDisabled(string element_id, boolean state)
Sets a button as disabled(non clickable).
Parameters:
string element_id |
the guid of the button, whose disability-state you want to set |
boolean state |
true, the button is disabled; false, the button is not disabled. |
^
Button_SetRadius
Lua: reagirl.Button_SetRadius(string element_id, integer radius)
Sets the radius of a button.
Parameters:
string element_id |
the guid of the button, whose radius you want to set |
integer radius |
between 0 and 10 |
^
Checkbox_Add
Lua: string checkbox_guid = reagirl.Checkbox_Add(integer x, integer y, string caption, string meaningOfUI_Element, optional function run_function)
Adds a checkbox to a gui.
You can autoposition the checkbox by setting x and/or y to nil, which will position the new checkbox after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
The run-function will get two parameters:
- string element_id - the element_id of the toggled checkbox
- boolean checkstate - the new checkstate of the checkbox
Note: to align multiple lines of checkboxes under each other, check out Checkbox_SetWidth.
Returnvalues:
string checkbox_guid |
a guid that can be used for altering the checkbox-attributes |
Parameters:
optional integer x |
the x position of the checkbox in pixels; negative anchors the checkbox to the right window-side; nil, autoposition after the last ui-element(see description) |
optional integer y |
the y position of the checkbox in pixels; negative anchors the checkbox to the bottom window-side; nil, autoposition after the last ui-element(see description) |
string caption |
the caption of the checkbox |
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
boolean default |
true, set the checkbox checked; false, set the checkbox unchecked |
optional function run_function |
a function that shall be run when the checkbox is clicked; will get passed over the checkbox-element_id as first and the new checkstate as second parameter |
^
Checkbox_GetCheckState
Lua: boolean check_state = reagirl.Checkbox_GetCheckState(string element_id)
Gets a checkbox's current checked-state.
Returnvalues:
boolean check_state |
true, checkbox is checked; false, the checkbox is unchecked |
Parameters:
string element_id |
the guid of the checkbox, whose checkbox-state you want to get |
^
Checkbox_GetDisabled
Lua: boolean retval = reagirl.Checkbox_GetDisabled(string element_id)
Gets a checkbox's disabled(non clickable)-state.
Returnvalues:
boolean state |
true, the checkbox is disabled; false, the checkbox is not disabled. |
Parameters:
string element_id |
the guid of the checkbox, whose disability-state you want to get |
^
Checkbox_SetCheckState
Lua: reagirl.Checkbox_SetCheckState(string element_id, boolean check_state)
Sets a checkbox's state of the checkbox.
Parameters:
string element_id |
the guid of the checkbox, whose checkbox-state you want to set |
boolean check_state |
true, set checkbox checked; false, set checkbox unchecked |
^
Checkbox_SetDisabled
Lua: reagirl.Checkbox_SetDisabled(string element_id, boolean state)
Sets a checkbox as disabled(non clickable).
Parameters:
string element_id |
the guid of the checkbox, whose disability-state you want to set |
boolean state |
true, the checkbox is disabled; false, the checkbox is not disabled. |
^
Checkbox_Unlink
Lua: reagirl.Checkbox_Unlink(string element_id)
Unlinks a checkbox from extstate/ini-file/configvar.
Parameters:
string element_id |
the guid of the checkbox that you want to unlink from extstates/ini-files/configvars |
^
DropDownMenu_Add
Lua: string dropdown-menu_guid = reagirl.DropDownMenu_Add(optional integer x, optional integer y, integer w, string caption, optional integer Cap_width, string meaningOfUI_Element, table menuItems, integer menuSelectedItem, optional function run_function)
Adds a dropdown-menu to a gui.
You can autoposition the dropdown-menu by setting x and/or y to nil, which will position the new dropdown-menu after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
The run-function gets as parameters:
- string element_id - the element_id
- integer selected_menu_entry - the selected menu entry number
- string selected_menu_entry_name - the name of the selected menu entry
Returnvalues:
string dropdown |
menu_guid - a guid that can be used for altering the dropdown-menu-attributes |
Parameters:
optional integer x |
the x position of the dropdown-menu in pixels; negative anchors the dropdown-menu to the right window-side; nil, autoposition after the last ui-element(see description) |
optional integer y |
the y position of the dropdown-menu in pixels; negative anchors the dropdown-menu to the bottom window-side; nil, autoposition after the last ui-element(see description) |
integer w |
the width of the dropdown-menu; negative links width to the right-edge of the window |
string caption |
the caption of the dropdown-menu, shown to the left of the drop down menu |
optional integer Cap_width |
the width of the caption to set the actual menu to a fixed position; nil, put menu directly after caption |
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
table menuItems |
a table, where every entry is a menu-item |
integer menuSelectedItem |
the index of the pre-selected menu-item |
optional function run_function |
a function that shall be run when the menu is clicked/a new entry is selected; will get the dropdown-menu-element_id passed over as first parameter and the selected menu_item as second parameter |
^
DropDownMenu_GetDimensions
Lua: integer width = reagirl.DropDownMenu_GetDimensions(string element_id)
Gets the width of a drop down menu.
Returnvalues:
integer width |
the width of the drop down menu; negative anchors to right window-edge |
Parameters:
string element_id |
the guid of the drop down menu, whose width-state you want to set |
^
DropDownMenu_GetDisabled
Lua: boolean state = reagirl.DropDownMenu_GetDisabled(string element_id)
Gets a dropdown-menu's disabled(non clickable)-state.
Returnvalues:
boolean state |
true, the dropdown-menu is disabled; false, the dropdown-menu is not disabled. |
Parameters:
string element_id |
the guid of the dropdown-menu, whose disability-state you want to get |
^
DropDownMenu_GetMenuItems
Lua: table menuItems, integer menuSelectedItem = reagirl.DropDownMenu_GetMenuItems(string element_id)
Gets a dropdown-menu's menu-items and the index of the currently selected menu-item.
Returnvalues:
table menuItems |
a table that holds all menu-items |
integer menuSelectedItem |
the index of the currently selected menu-item |
Parameters:
string element_id |
the guid of the dropdown-menu, whose menuitems/currently selected item you want to get |
^
DropDownMenu_SetDimensions
Lua: reagirl.DropDownMenu_SetDimensions(string element_id, optional integer width)
Sets the width of a dropdownmenu.
Parameters:
string element_id |
the guid of the drop down menu, whose width-state you want to set |
optional integer width |
the new width of the drop down menu; negative anchors to right window-edge; nil, keep current width |
^
DropDownMenu_SetDisabled
Lua: reagirl.DropDownMenu_SetDisabled(string element_id, boolean state)
Sets a drop down menu as disabled(non clickable)-state.
Parameters:
string element_id |
the guid of the dropdown-menu, whose disability-state you want to set |
boolean state |
true, the dropdown-menu is disabled; false, the dropdown-menu is not disabled. |
^
DropDownMenu_SetMenuItems
Lua: reagirl.DropDownMenu_SetMenuItems(string element_id, table menuItems, integer menuSelectedItem)
Sets a dropdown-menu's menuitems and the index of the currently selected menu-item.
Parameters:
string element_id |
the guid of the dropdown-menu, whose menuitems/selected menu-item you want to set |
table menuItems |
an indexed table with all the menu-items |
integer menuSelectedItem |
the index of the pre-selected menu-item |
^
Ext_Tab_SetSelected
Lua: reagirl.Ext_Tab_SetSelected(string gui_name)
Focuses a specific tab of a ReaGirl-gui-window.
Parameter gui_name is the same as the name set in the first parameter of Gui_Open.
You can set a focused tab even if the window isn't opened yet. It will be focused the next time the specified gui-window is opened.
It also works for opened gui-windows.
Parameters:
string gui_name |
the name of the gui-window, whose tab you want to set to focused |
^
Ext_Window_Focus
Lua: boolean retval = reagirl.Ext_Window_Focus(string gui_name)
Focuses an opened ReaGirl-gui-window.
Parameter gui_name is the same as the name set in the first parameter of Gui_Open.
Returns false, if no window with the window name is currently opened.
Returnvalues:
boolean retval |
the gui-window is opened; false, the gui-window isn't opened |
Parameters:
string gui_name |
the name of the gui-window, which you want to focus |
^
Ext_Window_GetState
Lua: integer width, integer height, integer dockstate, integer x_position, integer y_position = reagirl.Ext_Window_GetState(string gui_name)
Gets the current width, height, position and dockstate of a ReaGirl-gui-window.
Returns nil if no such window exists/was ever opened.
Returnvalues:
integer width |
the width of the window in pixels |
integer height |
the height of the window in pixels |
integer dockstate |
0, window isn't docked; 1, window is docked |
integer x_position |
the x-position of the window in pixels |
integer y_position |
the y-position of the window in pixels |
Parameters:
optional string gui_name |
the name of the gui-window, of which you want to get the states(NOT the window title!); nil, use this script's currently/last opened window |
^
Ext_Window_IsOpen
Lua: boolean retval = reagirl.Ext_Window_IsOpen(string gui_name)
Returns, if a specific gui-window is open.
Returnvalues:
boolean retval |
the gui-window is opened; false, the gui-window isn't opened |
Parameters:
string gui_name |
the name of the gui-window, whose open-state you want to get |
^
Ext_Window_ResetToDefault
Lua: reagirl.Ext_Window_ResetToDefault(string gui_name)
Resets a ReaGirl-gui-window to it's default window dimensions and dockstate.
Parameters:
string gui_name |
the name of the gui-window, of which you want to get the states; nil, use this script's currently/last opened window |
^
Ext_Window_SetState
Lua: reagirl.Ext_Window_SetState(string gui_name, optional integer width, optional integer height, optional integer dockstate, optional integer x_position, optional integer y_position)
Sets a new width, height, position and dockstate of a ReaGirl-gui-window.
To keep a parameter to its current state, set it to nil.
Parameters:
string gui_name |
the name of the gui-window, of which you want to get the states; nil, use this script's currently/last opened window |
optional integer width |
the width of the window in pixels; nil, keep current |
optional integer height |
the height of the window in pixels; nil, keep current |
optional integer dockstate |
0, window isn't docked; 1, window is docked; nil, keep current |
optional integer x_position |
the x-position of the window in pixels; nil, keep current |
optional integer y_position |
the y-position of the window in pixels; nil, keep current |
^
AtEnter
Lua: reagirl.Gui_AtEnter(optional function run_func)
Adds a function that shall be run when someone hits Enter while the gui is opened.
Parameters:
function run_func |
a function, that shall be run when the user hits enter while gui is open; nil, removes the function |
^
Gui_AtExit
Lua: reagirl.Gui_AtExit(optional function run_func)
Adds a function that shall be run when the gui is closed with reagirl.Gui_Close()
Good to do clean up or committing of settings.
Parameters:
optional function run_func |
a function, that shall be run when the gui closes; nil to remove the function |
^
Gui_Close
Closes the gui-window.
^
Gui_ForceRefresh
Lua: reagirl.Gui_ForceRefresh()
Forces a refresh of the gui.
^
Gui_GetBoundaries
Lua: integer minimum_visible_x, integer maximum_visible_x, integer minimum_visible_y, integer maximum_visible_y, integer minimum_all_x, integer maximum_all_x, integer maximum_all_y, integer maximum_all_y = reagirl.Gui_GetBoundaries()
Returns the current boundaries of the ui-elements. Means, from 0 to the the farthest ui-element-width/height at right/bottom edge of the gui-window.
These boundaries are where the scrolling happens. If the boundaries are smaller/equal window size, all ui-elements are visible in the window and therefore no scrolling happens.
The first four retvals return the boundaries of all visible ui-elements, the last four return the boundaries of all ui-elements, including invisible.
Sticky ui-elements will be ignored.
^
Gui_IsOpen
Lua: boolean retval = reagirl.Gui_IsOpen()
Checks, whether the gui-window is open.
Returnvalues:
boolean retval |
true, Gui is open; false, Gui is not open |
^
Gui_Manage
Lua: reagirl.Gui_Manage()
Manages the gui-window.
Put this function in a defer-loop. It will manage, draw, show the gui.
^
Gui_New
Creates a new gui by removing all currently(if available) ui-elements.
^
Gui_Open
Lua: integer window_open, optional hwnd window_handler = reagirl.Gui_Open(string name, boolean restore_old_window_state, string title, string description, optional integer w, optional integer h, optional integer dock, optional integer x, optional integer y)
Opens a gui-window. If x and/or y are not given, it will be opened centered.
ReaGirl stores in the background the position, size and dockstate of the window. Set restore_old_window_state=true to automatically reopen the window with the position, size and dockstate of the window when it was closed the last time.
Returnvalues:
number retval |
1.0, if window is opened |
optional hwnd window_handler |
a hwnd-window-handler for this window; only returned, with JS-extension installed! |
Parameters:
string name |
name, will be used to store window position, size and dockstate when window is closed; make this name unique to your script like with your name as prefix for instance; newlines are not allowed |
boolean restore_old_window_state |
true, restore the window position, size and dockstate when the window last got closed
false, always open with the same position, size and dockstate |
string title |
the title of the window |
string description |
a description of what this dialog does, for blind users. Make it a sentence. |
optional integer w |
the width of the window; nil, try to autosize the to be opened window according to the ui-elements currently added to the gui(including invisible ones) |
optional integer h |
the height of the window; nil, try to autosize the to be opened window according to the ui-elements currently added to the gui(including invisible ones) |
optional integer dock |
the dockstate of the window; 0, undocked; 1, docked; nil=undocked |
optional integer x |
the x-position of the window; nil=x-centered |
optional integer y |
the y-position of the window; nil=y-centered |
^
Gui_PreventCloseViaEscForOneCycle
Lua: reagirl.Gui_PreventScrollingForOneCycle()
Prevents the closing of the gui via esc-key for one defer-cycle.
^
Gui_PreventEnterForOneCycle
Lua: reagirl.Gui_PreventEnterForOneCycle()
Prevents the user from hitting the enter-key for one cycle, so the run-function for the enter-key is not run in this cycle.
^
Gui_PreventScrollingForOneCycle
Lua: reagirl.Gui_PreventScrollingForOneCycle(optional boolean keyboard, optional boolean mousewheel_swipe, optional boolean scroll_buttons)
Prevents the scrolling of the gui via keyboard/mousewheel/swiping for this defer-cycle.
Parameters:
optional boolean keyboard |
true, prevent the scrolling via keyboard; false, scroll; nil, don't change |
optional boolean mousewheel_swipe |
true, prevent the scrolling via mousewheel/swiping; false, scroll; nil, don't change |
^
Image_Add
Lua: string image_guid = reagirl.Image_Add(integer x, integer y, integer w, integer h, string image_filename, string caption, string meaning of UI_Element, optional function run_function)
Adds an image to the gui. This image can run a function when clicked on it.
Very important: write into meaningOfUI_Element a small description of what the image shows. This will help blind people know, what the image means and what to do with it.
If you can't know what the image shows(an image viewer for instance) explain what's the purpose of the image like "cover image for the project" or something.
Keep in mind: blind people can't see the image so any kind of description will help them understand your script.
You can have different images for different scaling-ratios. You put them into the same folder and name them like:
image-filename.png - 1x-scaling
image-filename-2x.png - 2x-scaling
image-filename-3x.png - 3x-scaling
image-filename-4x.png - 4x-scaling
image-filename-5x.png - 5x-scaling
image-filename-6x.png - 6x-scaling
image-filename-7x.png - 7x-scaling
image-filename-8x.png - 8x-scaling
If a filename doesn't exist, it reverts to the default one for 1x-scaling.
ReaGirl will obey transparency set in png-images.
Images can be set to draggable. See Image_GetDraggable and Image_SetDraggable for enabling
dragging of the image to a destination ui-element.
The run_function will get three parameters:
- string element_id - the guid of the image
- string filename - the filename of the image
- optional string dropped_element_id - the element_id of the destination, where the image has been
dragged to
You can autoposition the image by setting x and/or y to nil, which will position the new image after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
If you want to force the image to be displayed with correct aspect ratio, see Image_KeepAspectRatio.
Returnvalues:
string image_guid |
a guid that can be used for altering the image-attributes |
Parameters:
optional integer x |
the x position of the image in pixels; nil, autoposition after the last ui-element(see description) |
optional integer y |
the y position of the image in pixels; nil, autoposition after the last ui-element(see description) |
integer w |
the width of the image in pixels(might result in stretched images!) |
integer h |
the height of the image in pixels(might result in stretched images!) |
string image_filename |
the filename of the imagefile to be shown |
string caption |
a descriptive name for the image |
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
optional function run_function |
a function that is run when the image is clicked; will get the image-element-id as first parameter and the image-filename passed as second parameter |
^
Image_ClearToColor
Lua: reagirl.Image_ClearToColor(string element_id, integer r, integer g, integer b)
Clears the image with a set r-g-b-color. It also clears the previously loaded image-filename.
Parameters:
string element_id |
the guid of the image |
integer r |
the red-value 0-255 |
integer g |
the green-value 0-255 |
integer b |
the blue-value 0-255 |
^
Image_GetDimensions
Lua: integer width, integer height = reagirl.Image_GetDimensions(string element_id)
Gets the width and height of an image.
Returnvalues:
integer width |
the width of the image; negative anchors to right window-edge |
integer height |
the height of the image; negative anchors to bottom window-edge |
Parameters:
string element_id |
the guid of the image, whose disability-state you want to set |
^
Image_GetDraggable
Lua: boolean draggable = reagirl.Image_GetDraggable(string element_id)
Gets the current draggable state of an image.
When draggable==true: if the user drags the image onto a different ui-element, the run_function of
the image will get a third parameter, holding the element_id of the destination-ui-element of the dragging.
Otherwise this third parameter will be nil.
Add a note in the meaningOfUI_element and the name of the image/caption of the ui-element, which clarifies, which ui-element is a source
and which is a target for dragging operations, so blind users know, which image can be dragged and whereto.
Otherwise, blind users will not know what to do!
Returnvalues:
boolean draggable |
true, image is draggable; false, image is not draggable |
Parameters:
string element_id |
the image-element, whose dragable state you want to get |
^
Image_GetImageFilename
Lua: string filename, string filename_scaled = reagirl.Image_GetImageFilename(string element_id)
Returns the filename of the currently loaded image.
Returnvalues:
string filename |
the filename of the currently loaded image |
string filename_scale |
if the gui is scaled>1, this will hold the filename of the loaded scaled image |
Parameters:
string element_id |
the guid of the image whose filename you want to get |
^
Image_KeepAspectRatio
Lua: reagirl.Image_KeepAspectRatio(string element_id, boolean state)
Set if the image shall keep its aspect ratio when shown.
Parameters:
string element_id |
the guid of the image, whose aspect ratio you want to set |
boolean state |
true, keep aspect ratio; false, stretch to meet dimensions of the image |
^
Image_Load
Lua: reagirl.Image_Load(string element_id, string image_filename)
Loads a new image-file of an existing image in the gui.
You can have different images for different scaling-ratios. You put them into the same folder and name them like:
image-filename.png - 1x-scaling
image-filename-2x.png - 2x-scaling
image-filename-3x.png - 3x-scaling
image-filename-4x.png - 4x-scaling
image-filename-5x.png - 5x-scaling
image-filename-6x.png - 6x-scaling
image-filename-7x.png - 7x-scaling
image-filename-8x.png - 8x-scaling
If a scaled-filename doesn't exist, the function reverts to the default one for 1x-scaling.
Parameters:
string element_id |
the guid of the image |
string image_filename |
the filename of the imagefile to be loaded |
^
Image_ReloadImage_Scaled
Lua: boolean loading_success = reagirl.Image_ReloadImage_Scaled(string element_id)
Realoads an image.
Returnvalues:
boolean loading_success |
true, loading was successful; false, loading was unsuccessful(missing file, etc) |
Parameters:
string element_id |
the image-element, whose image you want to reload |
^
Image_SetDimensions
Lua: reagirl.Image_SetDimensions(string element_id, optional integer width, optional integer height)
Sets the width and height of an image.
Parameters:
string element_id |
the guid of the image, whose width and height you want to set |
optional integer width |
the new width of the image; negative anchors to right window-edge; nil, keep current width |
optional integer height |
the new height of the image; negative anchors to bottom window-edge; nil, keep current height |
^
Image_SetDraggable
Lua: reagirl.Image_SetDraggable(string element_id, boolean draggable, table destination_element_ids)
Sets the current draggable state of an image.
When draggable==true: if the user drags the image onto a different ui-element, the run_function of
the image will get a third parameter, holding the element_id of the destination-ui-element of the dragging.
Otherwise this third parameter will be nil.
Add a note in the meaningOfUI_element and the name of the image/caption of the ui-element, which clarifies, which ui-element is a source
and which is a target for dragging operations, so blind users know, which image can be dragged and whereto.
Otherwise, blind users will not know what to do!
Parameters:
string element_id |
the image-element, whose dragable state you want to set |
boolean draggable |
true, image is draggable; false, image is not draggable |
table destination_element_ids |
a table with all guids of the ui-elements, where the image can be dragged to |
^
Inputbox_Add
Lua: string inputbox_guid = reagirl.Inputbox_Add(optional integer x, optional integer y, integer w, string caption, optional integer cap_width, string meaningOfUI_Element, optional string Default, optional function run_function_enter, function run_function_type)
Adds an inputbox to a gui.
You can autoposition the inputbox by setting x and/or y to nil, which will position the new inputbox after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
The caption will be shown before the inputbox.
Unlike other ui-elements, this one has the option for two run_functions, one for when the user hits enter in the inputbox and one for when the user types anything into the inputbox.
Important:
Screen reader users get an additional dialog shown when entering text, that will NOT run the run-function for typed text. This is due some limitations in Reaper's API and can't be circumvented.
So you can't rely only on the run_function_type but also need to add a run_function_enter, when you want to use the value immediately when typed in your script(like setting as a setting into an ini-file).
Otherwise blind users would be able to enter text but it will be ignored at hitting enter by your code, which would be unfortunate.
The run-functions get as parameters:
- string element_id - the element_id as string
- string text - the currently entered text
Returnvalues:
string inputbox_guid |
a guid that can be used for altering the inputbox-attributes |
Parameters:
optional integer x |
the x position of the inputbox in pixels; negative anchors the inputbox to the right window-side; nil, autoposition after the last ui-element(see description) |
optional integer y |
the y position of the inputbox in pixels; negative anchors the inputbox to the bottom window-side; nil, autoposition after the last ui-element(see description) |
integer w |
the width of the inputbox in pixels |
string caption |
the caption of the inpubox |
optional integer cap_width |
the width of the caption to set the actual inputbox to a fixed position; nil, put inputbox directly after caption |
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
optional string Default |
the "typed text" that the inputbox shall contain |
optional function run_function_enter |
a function that is run when the user hits enter in the inputbox(always used, even for screen reader users) |
function run_function_type |
a function that is run when the user types into the inputbox(only used if no screen reader is used) |
^
Inputbox_GetCursorOffset
Lua: integer cursor_offset = reagirl.Inputbox_GetCursorOffset(string element_id)
Gets an inputbox's current cursor offset.
Returnvalues:
integer cursor_offset |
the offset the cursor has in the current text in the inputbox |
Parameters:
string element_id |
the guid of the inputbox, whose cursor offset you want to get |
^
Inputbox_GetDisabled
Lua: boolean state = reagirl.Inputbox_GetDisabled(string element_id)
Gets an inputbox's disabled(non clickable)-state.
Returnvalues:
boolean state |
true, the inputbox is disabled; false, the inputbox is not disabled. |
Parameters:
string element_id |
the guid of the inputbox, whose disability-state you want to get |
^
Inputbox_GetPassword
Lua: reagirl.Inputbox_GetPassword(string element_id, boolean password_state)
gets an inputbox to show * instead of the text(for password entry, etc)
Returnvalues:
boolean password_state |
true, the inputbox shows * instead of the actual text; false, shows normal text |
Parameters:
string element_id |
the guid of the inputbox, whose password-input-state you want to get |
^
Inputbox_GetSelectedText
Lua: string text = reagirl.Inputbox_GetSelectedText(string element_id)
Gets an inputbox's currently selected text.
Returnvalues:
string text |
the text currently selected in the inputbox |
integer selection_startoffset |
the startoffset of the text-selection; -1, no text is selected |
integer selection_endoffset |
the endoffset of the text-selection; -1, no text is selected |
Parameters:
string element_id |
the guid of the inputbox, whose selected text you want to get |
^
Inputbox_GetText
Lua: string text = reagirl.Inputbox_GetText(string element_id)
Gets an inputbox's current text.
Returnvalues:
string text |
the text currently in the inputbox |
Parameters:
string element_id |
the guid of the inputbox, whose text you want to get |
^
Inputbox_SetDisabled
Lua: reagirl.Inputbox_SetDisabled(string element_id, boolean state)
Sets an inputbox as disabled(non clickable).
Parameters:
string element_id |
the guid of the inputbox, whose disability-state you want to set |
boolean state |
true, the inputbox is disabled; false, the inputbox is not disabled. |
^
Inputbox_SetEmptyText
Lua: string text = reagirl.Inputbox_SetEmptyText(string element_id, string empty_text)
Sets an inputbox's shown text when nothing has been input.
Returnvalues:
string empty_text |
a text that is shown, when nothing has been input |
Parameters:
string element_id |
the guid of the inputbox, whose text you want to get |
^
Inputbox_SetPassword
Lua: reagirl.Inputbox_SetPassword(string element_id, boolean password_state)
Sets an inputbox to show * instead of the text(for password entry, etc)
Parameters:
string element_id |
the guid of the inputbox, that you want to set to password-input |
boolean password_state |
true, set the inputbox to show * instead of the actual text; false, show normal text |
^
Inputbox_SetText
Lua: reagirl.Inputbox_SetText(string element_id, string new_text)
Sets a new text of an inputbox.
Will remove newlines from it.
Parameters:
string element_id |
the guid of the inputbox, whose disability-state you want to set |
string new_text |
the new text for the inputbox |
^
Label_Add
Lua: reagirl.Label_Add(optional integer x, optional integer y, string label, string meaningOfUI_Element, boolean clickable, optional function run_function)
Adds a label to the gui.
You can autoposition the label by setting x and/or y to nil, which will position the new label after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
It is possible to make labels draggable. See Label_SetDraggable and Label_GetDraggable for how to do it.
The run-function will get as parameters:
- string element_id - the element_id of the clicked label
- optional string dropped_element_id - the element_id of the ui-element, onto which the label was dragged
Parameters:
optional integer x |
the x position of the label in pixels; negative anchors the label to the right window-side; nil, autoposition after the last ui-element(see description) |
optional integer y |
the y position of the label in pixels; negative anchors the label to the bottom window-side; nil, autoposition after the last ui-element(see description) |
string label |
the text of the label |
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
boolean clickable |
true, the text is a clickable link-text; false or nil, the label-text is normal text |
optional function run_function |
a function that gets run when clicking the link-text(clickable=true) |
^
Label_AutoBackdrop
Lua: reagirl.Label_GetBackdrop(string element_id, string dest_element_id)
Sets a backdrop from label to underneath a specific ui-element defined by dest_element_id.
It will be autosized. The width will be determined from all ui-elements currently visible, the height will be determined by the position and height of dest_element_id.
To use it: determine, which ui-element shall be the lowest inside the rectangle(like one directly above the bottom line of the backdrop.)
Any ui-element in the same line does the trick. However, you should choose the highest ui-element in the lowest line or the backdrop might be drawn through it.
Parameters:
string element_id |
the label-element, that shall draw a backdrop |
string dest_element_id |
the ui-element, that shall be the lowest inside the backdrop(directly above the bottom line of the backdrop) |
^
Label_GetAlignement
Lua: integer alignment = reagirl.Label_GetAlignement(string element_id)
Gets the alignment of a label.
Returnvalues:
integer alignment |
the alignment of the label
flags&1: center horizontally
flags&2: right justify
flags&4: center vertically
flags&8: bottom justify |
Parameters:
string element_id |
the id of the element, whose alignment you want to get |
^
Label_GetBackdrop
Lua: integer width, integer height = reagirl.Label_GetBackdrop(string element_id)
Sets a background-rectangle in line-style for this label. You can use this to "include" different ui-elements of a common context underneath this label.
That way, you can structure your guis a little better.
Set height to 1 to just have a line before and after the first line of the label-text.
Returnvalues:
integer width |
the width of the backdrop in pixels |
integer height |
the height of the backdrop in pixels |
Parameters:
string element_id |
the label-element, whose dragable state you want to get |
^
Label_GetDraggable
Lua: boolean draggable = reagirl.Label_GetDraggable(string element_id)
Gets the current draggable state of a label.
When draggable==true: if the user drags the label onto a different ui-element, the run_function of
the label will get a second parameter, holding the element_id of the destination-ui-element of the dragging.
Otherwise this second parameter will be nil.
Add a note in the meaningOfUI_element of the label of the ui-element, which clarifies, which ui-element is a source
and which is a target for dragging operations, so blind users know, which label can be dragged and whereto.
Otherwise, blind users will not know what to do!
Returnvalues:
boolean draggable |
true, label is draggable; false, label is not draggable |
Parameters:
string element_id |
the label-element, whose dragable state you want to get |
^
Label_GetFontSize
Lua: integer font_size = reagirl.Label_GetFontSize(string element_id)
Gets the font-size of a label.
Returnvalues:
integer font_size |
the font_size of the label |
Parameters:
string element_id |
the id of the element, whose font-size you want to get |
^
Label_GetStyle
Lua: integer style1, integer style2, integer style3 = reagirl.Label_GetStyle(string element_id)
Gets the style of a label.
Returnvalues:
integer style1 |
the first style used:
0, no style
1, bold
2, italic
3, non anti-alias
4, outline
5, drop-shadow
6, underline
7, negative
8, 90° counter-clockwise
9, 90° clockwise |
integer style2 |
the rest, see style1 for more details |
integer style3 |
the rest, see style1 for more details |
Parameters:
string element_id |
the id of the element, whose label-style you want to get |
^
Label_SetAlignment
Lua: reagirl.Label_SetAlignment(string element_id, integer alignment)
Sets the font-size of a label.
Parameters:
string element_id |
the id of the element, whose font-size you want to set |
integer alignment |
the alignment of the label
flags&1: center horizontally
flags&2: right justify
flags&4: center vertically
flags&8: bottom justify |
^
Label_SetBackdrop
Lua: reagirl.Label_SetBackdrop(string element_id, integer width, integer height)
Sets a background-rectangle in line-style for this label. You can use this to "include" different ui-elements of a common context underneath this label.
That way, you can structure your guis a little better.
Set height to 1 to just have a line before and after the first line of the label-text.
Parameters:
string element_id |
the label-element, that shall draw a backdrop |
integer width |
the width of the backdrop in pixels |
integer height |
the height of the backdrop in pixels |
^
Label_SetDraggable
Lua: reagirl.Label_SetDraggable(string element_id, boolean draggable, table destination_element_ids)
Sets the current draggable state of a label.
When draggable==true: if the user drags the label onto a different ui-element, the run_function of
the label will get a second parameter, holding the element_id of the destination-ui-element of the dragging.
Otherwise this second parameter will be nil.
Add a note in the meaningOfUI_element of the ui-element, which clarifies, which ui-element is a source
and which is a target for dragging operations, so blind users know, which label can be dragged and whereto.
Otherwise, blind users will not know what to do!
Parameters:
string element_id |
the label-element, whose dragable state you want to set |
boolean draggable |
true, label is draggable; false, label is not draggable |
table destination_element_ids |
a table with all guids of the ui-elements, where the label can be dragged to |
^
Label_SetFontSize
Lua: reagirl.Label_SetFontSize(string element_id, integer font_size)
Sets the font-size of a label.
Parameters:
string element_id |
the id of the element, whose font-size you want to set |
integer font_size |
the font_size of the label |
^
Label_SetLabelText
Lua: reagirl.Label_SetLabelText(string element_id, string label)
Sets a new label text to an already existing label.
Parameters:
string element_id |
the id of the element, whose label you want to set |
string label |
the new text of the label |
^
Label_SetStyle
Lua: reagirl.Label_SetStyle(string element_id, integer style1, optional integer style2, optional integer style3)
Sets the style of a label.
You can combine different styles with each other in style1 through style3.
Parameters:
string element_id |
the id of the element, whose label-style you want to set |
integer style1 |
choose a style
0, no style
1, bold
2, italic
3, non anti-alias
4, outline
5, drop-shadow
6, underline
7, negative
8, 90° counter-clockwise
9, 90° clockwise |
optional integer style2 |
nil for no style; the rest, see style1 for more details |
optional integer style3 |
nil for no style; the rest, see style1 for more details |
^
Base64_Decoder
Lua: string decoded_string = reagirl.Base64_Decoder(string source_string)
Converts a Base64-encoded string into a normal string.
Returns nil in case of an error
Returnvalues:
string decoded_string |
the decoded string |
Parameters:
string source_string |
the Base64-encoded string |
^
Base64_Encoder
Lua: string encoded_string = reagirl.Base64_Encoder(string source_string, optional integer remove_newlines, optional integer remove_tabs)
Converts a string into a Base64-Encoded string.
Returns nil in case of an error
Returnvalues:
string encoded_string |
the encoded string |
Parameters:
string source_string |
the string that you want to convert into Base64 |
optional integer remove_newlines |
1, removes \n-newlines(including \r-carriage return) from the string
2, replaces \n-newlines(including \r-carriage return) from the string with a single space |
optional integer remove_tabs |
1, removes \t-tabs from the string
2, replaces \t-tabs from the string with a single space |
^
GetVersion
Lua: number version = reagirl.GetVersion()
Returns the version-number of the installed ReaGirl.
Returnvalues:
number version |
the version-number of the installed ReaGirl |
^
IsValidGuid
Lua: boolean retval = reagirl.IsValidGuid(string guid, boolean strict)
Checks, if guid is a valid guid. Can also be used for strings, that contain a guid somewhere in them(strict=false)
A valid guid is a string that follows the following pattern:
{........-....-....-....-............}
where . is a hexadecimal value(0-F)
Returnvalues:
boolean retval |
true, guid is/contains a valid guid; false, guid isn't/does not contain a valid guid |
Parameters:
string guid |
the guid to check for validity |
boolean strict |
true, guid must only be the valid guid; false, guid must contain a valid guid somewhere in it(means, can contain trailing or preceding characters) |
^
Mouse_GetCap
Lua: string clickstate, string specific_clickstate, integer mouse_cap, integer click_x, integer click_y, integer drag_x, integer drag_y, integer mouse_wheel, integer mouse_hwheel = reagirl.Mouse_GetCap(optional integer doubleclick_wait, optional integer drag_wait)
Checks clickstate and mouseclick/wheel-behavior, since last time calling this function and returns their states.
Allows you to get click, doubleclick, dragging, including the appropriate coordinates and mousewheel-states.
Much more convenient, than fiddling around with gfx.mouse_cap
Note: After doubleclicked, this will not return mouse-clicked-states, until the mouse-button is released. So any mouse-clicks during that can be only gotten from the retval mouse_cap.
This is to prevent automatic mouse-dragging after double-clicks.
Returnvalues:
string clickstate |
"", if not clicked, "CLK" for clicked and "FirstCLK", if the click is a first-click. |
string specific_clickstate |
either "" for not clicked, "CLK" for clicked, "DBLCLK" for doubleclick or "DRAG" for dragging |
integer mouse_cap |
the mouse_cap, a bitfield of mouse and keyboard modifier states
1: left mouse button
2: right mouse button
4: Control key
8: Shift key
16: Alt key
32: Windows key
64: middle mouse button |
integer click_x |
the x position, when the mouse has been clicked the last time |
integer click_y |
the y position, when the mouse has been clicked the last time |
integer drag_x |
the x-position of the mouse-dragging-coordinate; is like click_x for non-dragging mousestates |
integer drag_y |
the y-position of the mouse-dragging-coordinate; is like click_y for non-dragging mousestates |
integer mouse_wheel |
the mouse_wheel-delta, since the last time calling this function |
integer mouse_hwheel |
the mouse_horizontal-wheel-delta, since the last time calling this function |
Parameters:
optional integer doubleclick_wait |
the timeframe, in which a second click is recognized as double-click, in defer-cycles. 30 is approximately 1 second; nil, will use 15(default) |
optional integer drag_wait |
the timeframe, after which a mouseclick without moving the mouse is recognized as dragging, in defer-cycles. 30 is approximately 1 second; nil, will use 5(default) |
^
ReserveImageBuffer
Lua: integer image_buffer_index = reagirl.Gui_ReserveImageBuffer()
Reserves a framebuffer which will not be used by ReaGirl for drawing.
So if you want to code additional ui-elements, you can reserve an image buffer for blitting that way.
nil, if no additional framebuffer is available
Returnvalues:
integer image_buffer_index |
the index of a framebuffer you can safely use; nil, no more framebuffer available |
^
ResizeImageKeepAspectRatio
Lua: boolean retval = reagirl.ResizeImageKeepAspectRatio(integer image, integer neww, integer newh, optional number r, optional number g, optional number b)
Resizes an image, keeping its aspect-ratio. You can set a background-color for non rectangular-images.
Resizing upwards will probably cause artifacts!
Note: this uses image 1023 as temporary buffer so don't use image 1023, when using this function!
Returnvalues:
boolean retval |
true, blitting was successful; false, blitting was unsuccessful |
Parameters:
integer image |
an image between 0 and 1022, that you want to resize |
integer neww |
the new width of the image |
integer newh |
the new height of the image |
optional number r |
the red-value of the background-color; nil, = 0 |
optional number g |
the green-value of the background-color; nil, = 0 |
optional number b |
the blue-value of the background-color; nil, = 0 |
^
Window_GetCurrentScale
Lua: integer current_scaling_factor, boolean scaling_factor_override, integer current_system_scaling_factor = reagirl.Window_GetCurrentScale()
Gets the current scaling-factor
Returnvalues:
integer current_scaling_factor |
the scaling factor currently used by the script; nil, if autoscaling is activated |
boolean scaling_factor_override |
does the current script override auto-scaling |
integer current_system_scaling_factor |
the scaling factor that would be used, if auto-scaling would be on |
^
Window_SetCurrentScale
Lua: reagirl.Window_SetCurrentScale(optional integer newscale)
Sets a new scaling-factor that overrides auto-scaling/scaling preferences
Returnvalues:
optional integer newscale |
the scaling factor that shall be used in the script
nil, autoscaling/use preference
1-8, scaling factor between 1 and 8 |
^
ScreenReader_SendMessage
Lua: reagirl.ScreenReader_SendMessage()
Sends a message to the screen reader
Use this only when needed, means, don't permanently send messages. Otherwise, they will be cut off and the user doesn't get them.
^
Slider_Add
Lua: string slider_guid = reagirl.Slider_Add(optional integer x, optional integer y, integer width, string caption, optional integer cap_width, string meaningOfUI_Element, optional string unit, number start_val, number end_val, number step, number init_value, number default, optional function run_function)
Adds a slider to a gui.
You can autoposition the slider by setting x and/or y to nil, which will position the new slider after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
The caption will be shown before, the unit will be shown after the slider.
Note: when setting the unit to nil, no unit and number will be shown at the end of the slider.
Also note: when the number of steps is too many to be shown in a narrow slider, step-values may be skipped.
The run-function will get as parameters:
- string element_id - the element_id of the slider that uses this run-function
- integer value - the current slider-value
Returnvalues:
string slider_guid |
a guid that can be used for altering the slider-attributes |
Parameters:
optional integer x |
the x position of the slider in pixels; negative anchors the slider to the right window-side; nil, autoposition after the last ui-element(see description) |
optional integer y |
the y position of the slider in pixels; negative anchors the slider to the bottom window-side; nil, autoposition after the last ui-element(see description) |
integer width |
the width of the slider in pixels |
string caption |
the caption of the slider |
optional integer cap_width |
the width of the caption to set the actual slider to a fixed position; nil, put slider directly after caption |
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
optional string unit |
the unit shown next to the number the slider is currently set to |
number start_val |
the minimum value of the slider |
number end_val |
the maximum value of the slider |
number step |
the stepsize until the next value within the slider |
number init_value |
the initial value of the slider |
number default |
the default value of the slider |
optional function run_function |
a function that shall be run when the slider is dragged; will get passed over the slider-element_id as first and the new slider-value as second parameter |
^
Slider_GetDefaultValue
Lua: number value = reagirl.Slider_GetDefaultValue(string element_id)
Gets the current set value of the slider.
Returnvalues:
number value |
the current default value set in the slider |
Parameters:
string element_id |
the guid of the slider, whose default value you want to get |
^
Slider_GetDimensions
Lua: integer width = reagirl.Slider_GetDimensions(string element_id)
Gets the width of a slider.
Returnvalues:
integer width |
the width of the slider; negative anchors to right window-edge |
Parameters:
string element_id |
the guid of the slider, whose width you want to get |
^
Slider_GetDisabled
Lua: boolean state = reagirl.Slider_GetDisabled(string element_id)
Gets the current disability state of the slider.
Returnvalues:
boolean state |
true, slider is disabled; false, slider is enabled |
Parameters:
string element_id |
the guid of the slider, whose current disability-state you want to get |
^
Slider_GetEndValue
Lua: number max_value = reagirl.Slider_GetEndValue(string element_id)
Gets the current set maximum-value of the slider.
Returnvalues:
number max_value |
the current maximum-value set in the slider |
Parameters:
string element_id |
the guid of the slider, whose current maximum-value you want to get |
^
Slider_GetStartValue
Lua: number min_value = reagirl.Slider_GetStartValue(string element_id)
Gets the current set minimum-value of the slider.
Returnvalues:
number min_value |
the current minimum-value set in the slider |
Parameters:
string element_id |
the guid of the slider, whose current minimum-value you want to get |
^
Slider_GetValue
Lua: number value = reagirl.Slider_GetValue(string element_id)
Gets the current set value of the slider.
Returnvalues:
number value |
the current value set in the slider |
Parameters:
string element_id |
the guid of the slider, whose current value you want to get |
^
Slider_ResetToDefaultValue
Lua: reagirl.Slider_ResetToDefaultValue(string element_id)
Resets the current set value of the slider to the default value.
Parameters:
string element_id |
the guid of the slider, whose current value you want to reset to default |
^
Slider_SetDefaultValue
Lua: reagirl.Slider_SetDefaultValue(string element_id, number default_value)
Sets the default value of the slider.
Will not check, whether it is a valid value settable using the stepsize!
Parameters:
string element_id |
the guid of the slider, whose default value you want to set |
number default_value |
the new default value of the slider |
^
Slider_SetDimensions
Lua: reagirl.Slider_SetDimensions(string element_id, integer width)
Sets the width of a slider.
Parameters:
string element_id |
the guid of the slider, whose width you want to set |
integer width |
the new width of the slider; negative anchors to right window-edge; nil, keep current width |
^
Slider_SetDisabled
Lua: reagirl.Slider_SetDisabled(string element_id, boolean state)
Sets a slider disabled.
Parameters:
string element_id |
the guid of the slider, whose disablility-state you want to set |
boolean state |
true, slider is disabled; false, slider is enabled |
^
Slider_SetEndValue
Lua: reagirl.Slider_SetEndValue(string element_id, number max_value)
Sets the maximum value of the slider.
If current slider-value is bigger than maximum, the current slider-value will be changed to maximum.
Parameters:
string element_id |
the guid of the slider, whose max-value you want to set |
number max_value |
the new max value of the slider |
^
Slider_SetStartValue
Lua: reagirl.Slider_SetStartValue(string element_id, number start_value)
Sets the minimum value of the slider.
If current slider-value is smaller than minimum, the current slider-value will be changed to minimum.
Parameters:
string element_id |
the guid of the slider, whose minimum-value you want to set |
number start_value |
the new minimum value of the slider |
^
Slider_SetValue
Lua: reagirl.Slider_SetValue(string element_id, number value)
Sets the current value of the slider.
Will not check, whether it is a valid value settable using the stepsize!
Parameters:
string element_id |
the guid of the slider, whose value you want to set |
number value |
the new value of the slider |
^
Tabs_Add
Lua: string tabs_guid = reagirl.Tabs_Add(optional integer x, optional integer y, integer w, integer w_backdrop, integer h_backdrop, string caption, string meaningOfUI_Element, table tab_names, integer selected_tab, optional function run_function)
Adds a tab to a gui.
You can autoposition the tab by setting x and/or y to nil, which will position the new tab after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
You can also have a background drawn by the tab, which could be set to a specific size or set to autosize.
When set to autosize, it will enclose ui-elements currently visible in the gui.
If you don't want a background, set w_background or h_background to 0.
Keep in mind, that using auto-sizing of the background might lead to smaller backgrounds than the tabs themselves when there's only a few ui-elements available!
The run-function will get as parameters:
- string element_id - the tab's element-id
- integer selected_tab - the clicked tab
- string selected_tab_name - the clicked tab-name
Returnvalues:
string tabs_guid |
a guid that can be used for altering the tab-attributes |
Parameters:
optional integer x |
the x position of the tab in pixels; negative anchors the tab to the right window-side; nil, autoposition after the last ui-element(see description) |
optional integer y |
the y position of the tab in pixels; negative anchors the tab to the bottom window-side; nil, autoposition after the last ui-element(see description) |
optional integer w_backdrop |
the width of the tab's backdrop; negative, anchor it to the right window-edge; nil, autosize the backdrop to the gui-elements currently shown |
optional integer h_backdrop |
the height of the tab's backdrop; negative, anchor it to the bottom window-edge; nil, autosize the backdrop to the gui-elements currently shown |
string caption |
the caption of the tab |
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
table tab_names |
an indexed table with all tab-names |
integer selected_tab |
the index of the currently selected tab; 1-based |
optional function run_function |
a function that shall be run when a tab is clicked/selected via keys;
will get passed over the tab-element_id as first and
the new selected tab as second parameter as well as
the selected tab-name as third parameter |
^
Tabs_GetSelected
Lua: number value = reagirl.Tabs_GetSelected(string element_id)
Gets the selected tab of a tabs-element.
Returnvalues:
integer selected_tab |
the selected tab |
Parameters:
string element_id |
the guid of the tabs, whose selected tab you want to get |
^
Tabs_SetSelected
Lua: reagirl.Tabs_SetSelected(string element_id, integer selected_tab)
Sets the selected tab of a tabs-element.
Parameters:
string element_id |
the guid of the tabs, whose selected tab you want to set |
integer selected_tab |
the new selected tab |
^
Tabs_SetUIElementsForTab
Lua: reagirl.Tabs_SetUIElementsForTab(string element_id, integer tab_number, table element_ids_table)
Sets the ui-elements for a tab from a table.
The element_ids in the table element_ids_table consists of all ui-elements that shall be visible when this tab is selected.
Parameters:
string element_id |
the guid of the tabs, whose selected tab you want to set |
integer tab_number |
the number of the tab, whose ui-elements you want to set; 1-based |
table element_ids_table |
a table with all element_ids of all ui-elements that shall be shown when the tab is selected |
^
UI_Element_GetFocusRect
Lua: integer x, integer y, integer w, integer h, integer x2, integer y2, integer w2, integer h2 = reagirl.UI_Element_GetFocusRect()
gets the rectangle for focused ui-element. Can be used for custom ui-element, who need to control the focus-rectangle due some of their own ui-elements incorporated, like options in radio-buttons, etc.
the first four retvals give the set-position(including possible negative values), the second four retvals give the actual window-coordinates.
Parameters:
integer x |
the x-position of the focus-rectangle; negative, anchored to the right windowborder |
integer y |
the y-position of the focus-rectangle; negative, anchored to the bottom windowborder |
integer w |
the width of the focus-rectangle; negative, anchored to the right windowborder |
integer h |
the height of the focus-rectangle; negative, anchored to the bottom windowborder |
integer x2 |
the actual x-position of the focus-rectangle |
integer y2 |
the actual y-position of the focus-rectangle |
integer w2 |
the actual width of the focus-rectangle |
integer h2 |
the actual height of the focus-rectangle |
^
UI_Element_GetFocused
Lua: string element_guid = reagirl.UI_Element_GetFocused()
Get the ui-element-guid, that is currently focused.
Returnvalues:
string element_guid |
the element-id of the currently focused ui-element |
^
UI_Element_GetHovered
Lua: string element_guid = reagirl.UI_Element_GetHovered()
Get the ui-element-guid, where the mouse is currently.
Returnvalues:
string element_id |
the element-id of the currently hovered ui-element |
^
UI_Element_GetSetCaption
Lua: string caption = reagirl.UI_Element_GetSetCaption(string element_id, boolean is_set, string caption)
gets/sets the caption of the ui-element
Returnvalues:
string caption |
the caption of the ui-element |
Parameters:
string element_id |
the id of the element, whose caption you want to get/set |
boolean is_set |
true, set the caption; false, only retrieve the current caption |
string caption |
the caption of the ui-element |
^
UI_Element_GetSetMeaningOfUIElement
Lua: string meaningOfUI_Element = reagirl.UI_Element_GetSetMeaningOfUIElement(string element_id, boolean is_set, string meaningOfUI_Element)
gets/sets the meaningOfUI_Element of the ui-element, which will describe, how to use the ui-element to blind persons.
Very important when seting meaning_Of_UI_Elements for images: write into meaningOfUI_Element a small description of what the image shows. This will help blind people know, what the image means and what to do with it.
If you can't know what the image shows(an image viewer for instance) explain what's the purpose of the image like "cover image for the project" or something.
Keep in mind: blind people can't see the image so any kind of description will help them understand your script.
Returnvalues:
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
Parameters:
string element_id |
the id of the element, whose meaningOfUI_Element you want to get/set |
boolean is_set |
true, set the meaningOfUI_Element; false, only retrieve the current meaningOfUI_Element |
string meaningOfUI_Element |
the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
^
UI_Element_GetSetPosition
Lua: integer x, integer y, integer actual_x, integer actual_y = reagirl.UI_Element_GetSetPosition(string element_id, boolean is_set, integer x, integer y)
gets/sets the position of the ui-element
Returnvalues:
integer x |
the x-position of the ui-element |
integer y |
the y-position of the ui-element |
integer actual_x |
the actual current x-position resolved to the anchor-position including scaling and scroll-offset |
integer actual_y |
the actual current y-position resolved to the anchor-position including scaling and scroll-offset |
Parameters:
string element_id |
the id of the element, whose position you want to get/set |
boolean is_set |
true, set the position; false, only retrieve the current position |
integer x |
the x-position of the ui-element |
integer y |
the y-position of the ui-element |
^
UI_Element_GetSetRunFunction
Lua: func run_function, optional func run_function2 = reagirl.UI_Element_GetSetRunFunction(string element_id, boolean is_set, optional func run_function, optional func_run_function2)
gets/sets the run_function of the ui-element, which will be run, when the ui-element is toggled
Returnvalues:
func run_function |
the run_function of the ui-element |
optional func_run_function2 |
a second run-function used by some ui-elements; type-run-function for inputboxes |
Parameters:
string element_id |
the id of the element, whose run_function you want to get/set |
boolean is_set |
true, set the run_function; false, only retrieve the current run_function |
optional func run_function |
the run function of the ui-element; enter-run-function for inputboxes |
optional func_run_function2 |
a second run-function used by some ui-elements; type-run-function for inputboxes |
^
UI_Element_GetSetVisibility
Lua: boolean visible = reagirl.UI_Element_GetSetVisibility(string element_id, boolean is_set, boolean visible)
gets/sets the hidden-state of the ui-element
Returnvalues:
boolean hidden |
the hidden-state of the ui-element |
Parameters:
string element_id |
the id of the element, whose hidden-state you want to get/set |
boolean is_set |
true, set the hidden-state; false, only retrieve current hidde-state |
boolean visible |
true, set to visible; false, set to hidden |
^
UI_Element_GetSet_ContextMenu
Lua: string menu, function menu_runfunction = reagirl.UI_Element_GetSet_ContextMenu(string element_id, boolean is_set, optional string menu, optional function menu_runfunction)
gets/sets the context-menu and context-menu-run-function of a ui-element.
Setting this will show a context-menu, when the user rightclicks the ui-element.
Parameter menu is a list of fields separated by | characters. Each field represents a menu item.
Fields can start with special characters:
# : grayed out
! : checked
> : this menu item shows a submenu
< : last item in the current submenu
The menu_runfunction will be called with two parameters:
string element_id - the guid of the ui-element, whose context-menu has been used
integer selection - the index of the menu-item selected by the user
Returnvalues:
string menu |
the currently set menu for this ui-element; nil, no menu is available |
function menu_function |
a function that is called, after the user made a context-menu-selection; nil, no such function added to this ui-element |
Parameters:
string element_id |
the id of the element, whose context-menu you want to get/set |
boolean is_set |
true, set the menu; false, only retrieve the current menu |
optional string menu |
sets a menu for this ui-element; nil, no context-menu available |
optional function menu_runfunction |
sets a function that is called, after the user made a context-menu-selection; must be given when menu~=nil |
^
UI_Element_GetSet_DropZoneFunction
Lua: function dropzone_function = reagirl.UI_Element_GetSet_DropZoneFunction(string element_id, boolean is_set, optional function dropzone_function)
gets/sets the dropzone-run-function of a ui-element.
This will be called, when the user drag'n'drops files onto this ui-element.
The dropzone_function will be called with two parameters:
string element_id - the guid of the ui-element, on which files were dropped
table filenames - a table with all dropped filenames
It's also possible, that fx were dropped onto a drop-zone, since Reaper allows that.
So if you just want to have filenames, check, if the filename is not of format "@fx:fx_ident"
Returnvalues:
function dropzone_function |
a function that is called, after files were drag'n'dropped onto this ui-element |
Parameters:
string element_id |
the id of the element, whose description you want to get/set |
boolean is_set |
true, set the dropzone-function; false, only retrieve the dropzone-function |
optional function dropzone_function |
sets a function that is called, after the drag'n'dropped files onto this ui-element; nil, removes drop-zone |
^
UI_Element_GetType
Lua: string ui_type = reagirl.UI_Element_GetType(string element_id)
returns the type of the ui-element
Returnvalues:
string ui_type |
the type of the ui-element, like "Button", "Image", "Checkbox", "Edit" for InputBoxes and "ComboBox" for DropDownMenu, etc |
Parameters:
string element_id |
the id of the element, whose type you want to get |
^
UI_Element_IsElementAtMousePosition
Lua: boolean element_is_at_position = reagirl.UI_Element_IsElementAtMousePosition(string element_id)
returns, if ui-element with element_id is at mouse-position
Returnvalues:
boolean element_is_at_position |
true, ui-element is at mouse-position; false, ui-element is not at mouse-position |
Parameters:
string element_id |
the id of the element, of which you want to know, if it's at mouse-position |
^
UI_Element_Last_Element_Current_Position
Lua: integer last_x, integer last_y, integer last_w, integer last_h = reagirl.UI_Element_Last_Element_Current_Position()
Returns the x and y position as well as width and height of the last added ui-element.
Returnvalues:
integer last_x |
the x-position of the last added ui-element |
integer last_y |
the y-position of the last added ui-element |
integer last_w |
the width of the last added ui-element |
integer last_h |
the height of the last added ui-element |
^
UI_Element_Remove
Lua: reagirl.UI_Element_Remove(string element_id)
Removes a ui-element.
Parameters:
string element_id |
the id of the element that you want to remove |
^
UI_Element_SetFocusRect
Lua: reagirl.UI_Element_SetFocusRect(optional boolean override, integer x, integer y, integer w, integer h)
sets the rectangle for focused ui-element. Can be used for custom ui-element, who need to control the focus-rectangle due some of their own ui-elements incorporated, like options in radio-buttons, etc.
Parameters:
optional boolean override |
I forgot... |
integer x |
the x-position of the focus-rectangle; negative, anchor to the right windowborder |
integer y |
the y-position of the focus-rectangle; negative, anchor to the bottom windowborder |
integer w |
the width of the focus-rectangle; negative, anchor to the right windowborder |
integer h |
the height of the focus-rectangle; negative, anchor to the bottom windowborder |
^
UI_Element_SetFocused
Lua: reagirl.UI_Element_SetFocused(string element_id)
Set an ui-element focused.
Parameters:
string element_id |
the id of the ui-element, which you want to set to focused |
^
UI_Element_SetHiddenFromTable
Lua: reagirl.UI_Element_SetHiddenFromTable(table table_element_ids, boolean visible)
Set ui-elements stored in a table to hidden or visible.
Parameters:
table table_element_ids |
a table with all element_ids that you want to hide or make visible |
boolean visible |
true, set all ui-elements in table_element_ids to visible; false, set them to hidden |
^
UI_Elements_OutsideWindow
Lua: integer horz_outside, integer vert_outside = reagirl.UI_Elements_OutsideWindow()
returns, if any of the gui-elements are outside of the window and by how much.
Good for management of resizing window or scrollbars.
Returnvalues:
integer horz_outside |
the number of horizontal-pixels the ui-elements are outside of the window |
integer vert_outside |
the number of vertical-pixels the ui-elements are outside of the window |
^
Window_ForceSize_Maximum
Lua: reagirl.Window_ForceSize_Maximum(integer MaxW, integer MaxH)
Sets a maximum window size that will be enforced by ReaGirl.
Parameters:
integer MaxW |
the maximum window-width in pixels |
integer MaxH |
the maximum window-height in pixels |
^
Window_ForceSize_Minimum
Lua: reagirl.Window_ForceSize_Minimum(integer MinW, integer MinH)
Sets a minimum window size that will be enforced by ReaGirl.
Parameters:
integer MinW |
the minimum window-width in pixels |
integer MinH |
the minimum window-height in pixels |
^
Window_SetFocus
Lua: reagirl.Window_SetFocus()
Sets window focus back to the ReaGirl-gui-window.
| | Automatically generated by Ultraschall-API 5 - 121 elements available
|