^
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.
Note: if the user chose a color-theme for ReaGirl-guis, this color will be overridden by the theme-colors!
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 |
^
Burgermenu_Add
Lua: string burgermenu_guid = reagirl.Burgermenu_Add(optional integer x, optional integer y, string caption, integer mode, string meaningOfUI_Element, string menu, optional function run_function, optional string unique_identifier)
Adds a burgermenu to a gui.
You can autoposition the burgermenu by setting x and/or y to nil, which will position the new burgermenu 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 burgermenu that uses this run-function
- integer selected_menu_id - the index of the selected menu-entry. Note: will skip the top-entry of a submenu and grayed out menus!
- string selected_menu_name - the name of the selected menu-entry
- boolean menu_selection_checked - true, if the menu-selection-entry is checked; false, if not
Returnvalues:
| string burgermenu_guid |
| a guid that can be used for altering the button-attributes |
Parameters:
| optional integer x |
| the x position of the burgermenu in pixels; negative anchors the burgermenu to the right window-side; nil, autoposition after the last ui-element(see description) |
| optional integer y |
| the y position of the burgermenu in pixels; negative anchors the burgermenu to the bottom window-side; nil, autoposition after the last ui-element(see description) |
| string caption |
| the caption of the burgermenu |
| integer mode |
| 1, burger-menu is 15x15 pixels*scale; 2, burger-menu is 30x30 pixes*scale |
| string meaningOfUI_Element |
| the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
| string menu |
| the menu that shall be shown when clicking the button; refer to gfx.showmenu() on how to set this parameter |
| optional function run_function |
| a function that shall be run when the burgermenu is clicked; will get the burgermenu-element_id passed over as first parameter; nil, no run-function for this burgermenu |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
Burgermenu_GetMenu
Lua: string menu = reagirl.Burgermenu_GetMenu(string element_id)
Sets the menu of a burgermenu
Returnvalues:
| string menu |
| the menu of the burgermenu |
Parameters:
| string element_id |
| the guid of the burgermenu, whose menu you want to get |
^
Burgermenu_SetMenu
Lua: boolean retval = reagirl.Burgermenu_SetMenu(string element_id, string menu)
Sets the menu of a burgermenu
Returnvalues:
| boolean retval |
| true, setting was succesful; false, setting was unsuccessful |
Parameters:
| string element_id |
| the guid of the burgermenu, whose menu you want to set |
| string menu |
| the new menu for the burgermenu |
^
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, optional string unique_identifier)
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 |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
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_GetEdgeStyle
Lua: boolean top_left, boolean top_right, boolean bottom_left, boolean bottom_right = reagirl.Button_GetEdgeStyle(string element_id)
Gets, if the individual edges of a button are rounded or square.
Returnvalues:
| boolean top_left |
| true, edge is square; false, edge is rounded |
| boolean top_right |
| true, edge is square; false, edge is rounded |
| boolean bottom_left |
| true, edge is square; false, edge is rounded |
| boolean bottom_right |
| true, edge is square; false, edge is rounded |
Parameters:
| string element_id |
| the guid of the button, whose 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; between 0 and 10 |
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_SetEdgeStyle
Lua: reagirl.Button_SetEdgeStyle(string element_id, boolean top_left_square, boolean top_right_square, boolean bottom_left_square, boolean bottom_right_square)
Sets, if the individual edges of a button are rounded or square.
Parameters:
| string element_id |
| the guid of the button, whose edge-styles you want to set |
| boolean top_left_square |
| true, edge is square; false, edge is rounded |
| boolean top_right_square |
| true, edge is square; false, edge is rounded |
| boolean bottom_left_square |
| true, edge is square; false, edge is rounded |
| boolean bottom_right_square |
| true, edge is square; false, edge is rounded |
^
Button_SetRadius
Lua: boolean retval = reagirl.Button_SetRadius(string element_id, integer radius)
Sets the radius of a button.
Returnvalues:
| boolean retval |
| true, setting was succesful; false, setting was unsuccessful |
Parameters:
| string element_id |
| the guid of the button, whose radius you want to set |
| integer radius |
| the radius of the edges of the button; 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, optional string unique_identifier)
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 |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
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_LinkToConfigVar
Lua: reagirl.Checkbox_LinkToConfigVar(string element_id, string configvar_name, integer bit, boolean persist)
Links a checkbox to a configvar-bit.
All changes to the configvar-bit will be immediately visible for this checkbox.
Clicking the checkbox also updates the configvar-bit immediately.
Note: this will only allow bitfield-integer config-vars. All others could cause malfunction of Reaper!
Read the Reaper Internals-docs for all available config-variables(run the action ultraschall_Help_Reaper_ConfigVars_Documentation.lua for more details)
If the checkbox was already linked to extstate or ini-file, the linked-state will be replaced by this new one.
Use reagirl.Checkbox_Unlink() to unlink the checkbox from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the checkbox that shall toggle a config-var-bit |
| string configvar_name |
| the config-variable, whose bit you want to toggle |
| integer bit |
| the bit that shall be toggled; &1, &2, &4, &8, &16, etc |
| boolean persist |
| true, make this setting persist; false, make this setting only temporary until Reaper restart |
^
Checkbox_LinkToExtstate
Lua: reagirl.Checkbox_LinkToExtstate(string element_id, string section, string key, string false_val, string true_val, string default, boolean persist)
Links a checkbox to an extstate.
All changes to the extstate will be immediately visible for this checkbox.
Clicking the checkbox also updates the extstate immediately.
If the checkbox was already linked to a config-var or ini-file, the linked-state will be replaced by this new one.
Use reagirl.Checkbox_Unlink() to unlink the checkbox from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the checkbox, that you want to link to an extstate |
| string section |
| the section of the linked extstate |
| string key |
| the key of the linked extstate |
| string false_val |
| the value that shall be seen and stored as false |
| string true_val |
| the value that shall be seen and stored as true |
| string default |
| the default value, if the extstate hasn't been set yet |
| boolean persist |
| true, the extstate shall be stored persistantly; false, the extstate shall not be stored persistantly |
^
Checkbox_LinkToIniValue
Lua: reagirl.Checkbox_LinkToIniValue(string element_id, string ini_file, string section, string key, string false_val, string true_val, string default, boolean persist)
Links a checkbox to an ini-value.
All changes to the ini-value will be immediately visible for this checkbox.
Clicking the checkbox also updates the inivalue immediately.
If the checkbox was already linked to extstate or config-variable, the linked-state will be replaced by this new one.
Use reagirl.Checkbox_Unlink() to unlink the checkbox from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the checkbox that you want to link to an ini-value |
| string ini_file |
| the filename of the ini-file |
| string section |
| the section of the ini-file |
| string key |
| the key of the ini-file |
| string false_val |
| the value that shall be seen and stored as false |
| string true_val |
| the value that shall be seen and stored as true |
| string default |
| the default value, if the ini-file hasn't been set yet |
^
Checkbox_LinkToToggleState
Lua: reagirl.Checkbox_LinkToToggleState(string element_id, integer section, string command_id, boolean run_command)
Links a checkbox to a toggle-command-state of an action.
All changes to the toggle-state will be immediately visible for this checkbox.
Clicking the checkbox also updates the toggle-state immediately, which also updates existing toolbar-button-states.
You can set run_command=true, which will run the action everytime the checkstate is toggled.
This might be important to use, if the action behind the toggle-state needs to be run to change states in Reaper AND toggle the toggle-state as well.
Keep it at run_command=false, if you only want to change the toggle-state of the action without running it.
Note: some actions only change toggle-action, when they are run(like "Transport: Toggle repeat"). In these cases, the action will be run as well.
This shouldn't affect regular actions.
If the checkbox was already linked to a config-var or ini-file, the linked-state will be replaced by this new one.
Use reagirl.Checkbox_Unlink() to unlink the checkbox from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the checkbox, that you want to link to an extstate |
| integer section |
the section of the command, whose toggle state you want to link
0, Main
100, Main (alt recording)
32060, MIDI Editor
32061, MIDI Event List Editor
32062, MIDI Inline Editor
32063, Media Explorer |
| string command_id |
| the action command id of the command |
| boolean run_command |
| true, run the action to change the toggle-state; false, only change toggle-state(see note above!) |
^
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 |
^
ColorRectangle_Add
Lua: string color_rectangle_guid = reagirl.ColorRectangle_Add(optional integer x, optional integer y, integer w, integer h, integer r, integer g, integer b, string caption, string meaningOfUI_Element, boolean color_selector_when_clicked, optional function run_function, optional string unique_identifier)
Adds a color-rectangle to a gui.
When color_selector_when_clicked is set to true and a run-function is passed, the run-function will be run after the color-rectangle got closed.
You can autoposition the color-rectangle by setting x and/or y to nil, which will position the new color_rectangle after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
If you want to choose a color by name, use reagirl.Color_EnumerateNames() to get all possible color-names(all html-colornames as defined by the W3C are supported plus more).
Convert the name to the color-values using Color_GetColorValuesByName.
Colors who have a name are better for screen reader users, since the color name will be reported accordingly.
See this page for more details and color-names: https://www.w3.org/wiki/CSS/Properties/color/keywords
The run-function gets as parameter:
- string element_id - the element_id as string of the clicked color-rectangle that uses this run-function
- integer red - the red color-value
- integer green - the green color-value
- integer blue - the blue color-value
Note: if you want a decorative, non-clickable color-rectangle, use reagirl.DecorRectangle_Add()
Returnvalues:
| string color_rectangle_guid |
| a guid that can be used for altering the color-rectangle-attributes |
Parameters:
| optional integer x |
| the x position of the color-rectangle in pixels; negative anchors the color-rectangle to the right window-side; nil, autoposition after the last ui-element(see description) |
| optional integer y |
| the y position of the color-rectangle in pixels; negative anchors the color-rectangle to the bottom window-side; nil, autoposition after the last ui-element(see description) |
| integer w |
| the width of the color-rectangle in pixels |
| integer h |
| the height of the color-rectangle in pixels |
| integer r |
| red-value from 0-255 |
| integer g |
| green-value from 0-255 |
| integer b |
| blue-value from 0-255 |
| string caption |
| the caption of the color-rectangle |
| string meaningOfUI_Element |
| the meaningOfUI_Element of the ui-element(for tooltips and blind users). Make it a sentence that ends with . or ? |
| boolean color_selector_when_clicked |
true, clicking the color rectangle will open up a color-selection dialog. The run_function will be run right after the user closd the color-selector-dialog.
false, clicking will not open a color-selector. |
| optional function run_function |
| a function that shall be run when the color-rectangle is clicked; will get the color-rectangle-element_id passed over as first parameter and r,g,b as second, third and fourth parameter; nil, no run-function for this color-rectangle |
| optional string unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
ColorRectangle_GetColor
Lua: integer r, integer g, integer g = reagirl.ColorRectangle_GetColor(string element_id)
Gets a color-rectangle's color.
Returnvalues:
| integer r |
| the red-value of the color; 0-255 |
| integer g |
| the green-value of the color; 0-255 |
| integer b |
| the blue-value of the color; 0-255 |
Parameters:
| string element_id |
| the guid of the color-rectangle, whose color you want to get |
^
ColorRectangle_GetEdgeStyle
Lua: boolean square_top_left, boolean square_top_right, boolean square_bottom_left, boolean square_bottom_right = reagirl.ColorRectangle_GetEdgeStyle(string element_id)
Get, if the individual corners of a decorative rectangle are square or round.
Returnvalues:
| boolean square_top_left |
| true, edge is square, false, edge is round |
| boolean square_top_right |
| true, edge is square, false, edge is round |
| boolean square_bottom_left |
| true, edge is square, false, edge is round |
| boolean square_bottom_right |
| true, edge is square, false, edge is round |
Parameters:
| string element_id |
| the element_id of the decorative rectangle, whose edges you want to set to square |
^
ColorRectangle_GetRadius
Lua: integer radius = reagirl.ColorRectangle_GetRadius(string element_id)
Gets a color-rectangle's radius.
Returnvalues:
| integer radius |
| the radius of the color-rectangle |
Parameters:
| string element_id |
| the guid of the color-rectangle, whose radius you want to get |
^
ColorRectangle_SetColor
Lua: reagirl.ColorRectangle_SetColor(string element_id, integer r, integer g, integer b)
Sets the color of a color-rectangle.
Parameters:
| string element_id |
| the guid of the color-rectangle, whose color you want to set |
| integer r |
| the red-value of the color-element; 0-255 |
| integer g |
| the green-value of the color-element; 0-255 |
| integer b |
| the blue-value of the color-element; 0-255 |
^
ColorRectangle_SetEdgeStyle
Lua: reagirl.ColorRectangle_SetEdgeStyle(string element_id, boolean square_top_left, boolean square_top_right, boolean square_bottom_left, boolean square_bottom_right)
Set, if the individual corners of a color-rectangle are square or round.
Parameters:
| string element_id |
| the element_id of the decorative rectangle, whose edges you want to set to square |
| boolean square_top_left |
| true, edge is square, false, edge is round |
| boolean square_top_right |
| true, edge is square, false, edge is round |
| boolean square_bottom_left |
| true, edge is square, false, edge is round |
| boolean square_bottom_right |
| true, edge is square, false, edge is round |
^
ColorRectangle_SetRadius
Lua: reagirl.ColorRectangle_SetRadius(string element_id, integer radius)
Sets the radius of a color-rectangle.
Parameters:
| string element_id |
| the guid of the color-rectangle, whose radius you want to set |
| integer radius |
| between 0 and 10 |
^
Color_EnumerateNames
Lua: string color_name = reagirl.Color_EnumerateNames(integer index)
Enumerates all possible color-names. These names can be used with reagirl.Color_GetColorValuesByName to get the corresponding color-value.
Supports all standard html-names as defined by the W3C:
AliceBlue - 240, 248, 255
AntiqueWhite - 250, 235, 215
Aquamarine - 127, 255, 212
Azure - 240, 255, 255
Beige - 245, 245, 220
Bisque - 255, 228, 196
Black - 0, 0, 0
BlanchedAlmond - 255, 235, 205
Blue - 0, 0, 255
BlueViolet - 138, 43, 226
Brown - 165, 42, 42
BurlyWood - 222, 184, 135
CadetBlue - 95, 158, 160
Chartreuse - 127, 255, 0
Chocolate - 210, 105, 30
Coral - 255, 127, 80
CornflowerBlue - 100, 149, 237
Cornsilk - 255, 248, 220
Crimson - 220, 20, 60
Cyan - 0, 255, 255
DarkBlue - 0, 0, 139
DarkCyan - 0, 139, 139
DarkGoldenRod - 184, 134, 11
DarkGray - 169, 169, 169
DarkGreen - 0, 100, 0
DarkKhaki - 189, 183, 107
DarkMagenta - 139, 0, 139
DarkOliveGreen - 85, 107, 47
DarkOrange - 255, 140, 0
DarkOrchid - 153, 50, 204
DarkRed - 139, 0, 0
DarkSalmon - 233, 150, 122
DarkSeaGreen - 143, 188, 143
DarkSlateBlue - 72, 61, 139
DarkSlateGray - 37, 56, 60
DarkTurquoise - 0, 206, 209
DarkViolet - 148, 0, 211
DeepPink - 255, 20, 147
DeepSkyBlue - 0, 191, 255
DimGray - 105, 105, 105
DodgerBlue - 30, 144, 255
FireBrick - 178, 34, 34
FloralWhite - 255, 250, 240
ForestGreen - 34, 139, 34
Gainsboro - 220, 220, 220
GhostWhite - 248, 248, 255
Gold - 255, 215, 0
GoldenRod - 218, 165, 32
Gray - 128, 128, 128
Green - 0, 128, 0
GreenYellow - 173, 255, 47
HoneyDew - 240, 255, 240
HotPink - 255, 105, 180
IndianRed - 205, 92, 92
Indigo - 75, 0, 130
Ivory - 255, 255, 240
Khaki - 240, 230, 140
Lavender - 230, 230, 250
LavenderBlush - 255, 240, 245
LawnGreen - 124, 252, 0
LemonChiffon - 255, 250, 205
LightBlue - 173, 216, 230
LightCoral - 240, 128, 128
LightCyan - 224, 255, 255
LightGoldenRodYellow - 250, 250, 210
LightGray - 211, 211, 211
LightGreen - 144, 238, 144
LightPink - 255, 182, 193
LightSalmon - 255, 160, 122
LightSeaGreen - 32, 178, 170
LightSkyBlue - 135, 206, 250
LightSlateGray - 119, 136, 153
LightSteelBlue - 176, 207, 222
LightYellow - 255, 255, 224
Lime - 0, 255, 0
LimeGreen - 50, 205, 50
Linen - 250, 240, 230
Magenta - 255, 0, 255
Maroon - 128, 0, 0
MediumAquaMarine - 102, 205, 170
MediumBlue - 0, 0, 205
MediumOrchid - 186, 85, 211
MediumPurple - 147, 112, 219
MediumSeaGreen - 60, 179, 113
MediumSlateBlue - 123, 104, 238
MediumSpringGreen - 0, 250, 154
MediumTurquoise - 72, 209, 204
MediumVioletRed - 199, 21, 133
MidnightBlue - 25, 25, 112
MintCream - 245, 255, 250
MistyRose - 255, 228, 225
Moccasin - 255, 228, 181
NavajoWhite - 255, 222, 173
Navy - 0, 0, 128
OldLace - 254, 240, 227
Olive - 128, 128, 0
OliveDrab - 107, 142, 35
Orange - 255, 165, 0
OrangeRed - 255, 69, 0
Orchid - 218, 112, 214
PaleGoldenRod - 238, 232, 170
PaleGreen - 152, 251, 152
PaleTurquoise - 175, 238, 238
PaleVioletRed - 219, 112, 147
PapayaWhip - 255, 239, 213
PeachPuff - 255, 218, 185
Peru - 205, 133, 63
Pink - 255, 192, 203
Plum - 221, 160, 221
PowderBlue - 176, 224, 230
Purple - 128, 0, 128
RebeccaPurple - 102, 51, 153
Red - 255, 0, 0
RosyBrown - 188, 143, 143
RoyalBlue - 65, 105, 225
SaddleBrown - 139, 69, 19
Salmon - 250, 128, 114
SandyBrown - 244, 164, 96
SeaGreen - 46, 139, 87
SeaShell - 255, 245, 238
Sienna - 160, 82, 45
Silver - 192, 192, 192
SkyBlue - 135, 206, 235
SlateBlue - 106, 90, 205
SlateGray - 112, 128, 144
Snow - 255, 250, 250
SpringGreen - 0, 255, 127
SteelBlue - 70, 130, 180
Tan - 210, 180, 140
Teal - 0, 128, 128
Thistle - 216, 191, 216
Tomato - 255, 99, 71
Turquoise - 64, 224, 208
Violet - 238, 130, 238
Wheat - 245, 222, 179
WhiteSmoke - 245, 245, 245
Yellow - 255, 255, 0
YellowGreen - 154, 205, 50
Returnvalues:
| string color_name |
| the name of the color |
Parameters:
| integer index |
| the index of the color-name(1 and higher) |
^
Color_GetColorValuesByName
Lua: integer red, integer green, integer blue = reagirl.Color_GetColorValuesByName(string color_name)
Gets the color values by a color name.
Supports all standard html-names as defined by the W3C and more(use reagirl.Color_EnumerateNames to get all names):
AliceBlue - 240, 248, 255
AntiqueWhite - 250, 235, 215
Aquamarine - 127, 255, 212
Azure - 240, 255, 255
Beige - 245, 245, 220
Bisque - 255, 228, 196
Black - 0, 0, 0
BlanchedAlmond - 255, 235, 205
Blue - 0, 0, 255
BlueViolet - 138, 43, 226
Brown - 165, 42, 42
BurlyWood - 222, 184, 135
CadetBlue - 95, 158, 160
Chartreuse - 127, 255, 0
Chocolate - 210, 105, 30
Coral - 255, 127, 80
CornflowerBlue - 100, 149, 237
Cornsilk - 255, 248, 220
Crimson - 220, 20, 60
Cyan - 0, 255, 255
DarkBlue - 0, 0, 139
DarkCyan - 0, 139, 139
DarkGoldenRod - 184, 134, 11
DarkGray - 169, 169, 169
DarkGreen - 0, 100, 0
DarkKhaki - 189, 183, 107
DarkMagenta - 139, 0, 139
DarkOliveGreen - 85, 107, 47
DarkOrange - 255, 140, 0
DarkOrchid - 153, 50, 204
DarkRed - 139, 0, 0
DarkSalmon - 233, 150, 122
DarkSeaGreen - 143, 188, 143
DarkSlateBlue - 72, 61, 139
DarkSlateGray - 37, 56, 60
DarkTurquoise - 0, 206, 209
DarkViolet - 148, 0, 211
DeepPink - 255, 20, 147
DeepSkyBlue - 0, 191, 255
DimGray - 105, 105, 105
DodgerBlue - 30, 144, 255
FireBrick - 178, 34, 34
FloralWhite - 255, 250, 240
ForestGreen - 34, 139, 34
Gainsboro - 220, 220, 220
GhostWhite - 248, 248, 255
Gold - 255, 215, 0
GoldenRod - 218, 165, 32
Gray - 128, 128, 128
Green - 0, 128, 0
GreenYellow - 173, 255, 47
HoneyDew - 240, 255, 240
HotPink - 255, 105, 180
IndianRed - 205, 92, 92
Indigo - 75, 0, 130
Ivory - 255, 255, 240
Khaki - 240, 230, 140
Lavender - 230, 230, 250
LavenderBlush - 255, 240, 245
LawnGreen - 124, 252, 0
LemonChiffon - 255, 250, 205
LightBlue - 173, 216, 230
LightCoral - 240, 128, 128
LightCyan - 224, 255, 255
LightGoldenRodYellow - 250, 250, 210
LightGray - 211, 211, 211
LightGreen - 144, 238, 144
LightPink - 255, 182, 193
LightSalmon - 255, 160, 122
LightSeaGreen - 32, 178, 170
LightSkyBlue - 135, 206, 250
LightSlateGray - 119, 136, 153
LightSteelBlue - 176, 207, 222
LightYellow - 255, 255, 224
Lime - 0, 255, 0
LimeGreen - 50, 205, 50
Linen - 250, 240, 230
Magenta - 255, 0, 255
Maroon - 128, 0, 0
MediumAquaMarine - 102, 205, 170
MediumBlue - 0, 0, 205
MediumOrchid - 186, 85, 211
MediumPurple - 147, 112, 219
MediumSeaGreen - 60, 179, 113
MediumSlateBlue - 123, 104, 238
MediumSpringGreen - 0, 250, 154
MediumTurquoise - 72, 209, 204
MediumVioletRed - 199, 21, 133
MidnightBlue - 25, 25, 112
MintCream - 245, 255, 250
MistyRose - 255, 228, 225
Moccasin - 255, 228, 181
NavajoWhite - 255, 222, 173
Navy - 0, 0, 128
OldLace - 254, 240, 227
Olive - 128, 128, 0
OliveDrab - 107, 142, 35
Orange - 255, 165, 0
OrangeRed - 255, 69, 0
Orchid - 218, 112, 214
PaleGoldenRod - 238, 232, 170
PaleGreen - 152, 251, 152
PaleTurquoise - 175, 238, 238
PaleVioletRed - 219, 112, 147
PapayaWhip - 255, 239, 213
PeachPuff - 255, 218, 185
Peru - 205, 133, 63
Pink - 255, 192, 203
Plum - 221, 160, 221
PowderBlue - 176, 224, 230
Purple - 128, 0, 128
RebeccaPurple - 102, 51, 153
Red - 255, 0, 0
RosyBrown - 188, 143, 143
RoyalBlue - 65, 105, 225
SaddleBrown - 139, 69, 19
Salmon - 250, 128, 114
SandyBrown - 244, 164, 96
SeaGreen - 46, 139, 87
SeaShell - 255, 245, 238
Sienna - 160, 82, 45
Silver - 192, 192, 192
SkyBlue - 135, 206, 235
SlateBlue - 106, 90, 205
SlateGray - 112, 128, 144
Snow - 255, 250, 250
SpringGreen - 0, 255, 127
SteelBlue - 70, 130, 180
Tan - 210, 180, 140
Teal - 0, 128, 128
Thistle - 216, 191, 216
Tomato - 255, 99, 71
Turquoise - 64, 224, 208
Violet - 238, 130, 238
Wheat - 245, 222, 179
WhiteSmoke - 245, 245, 245
Yellow - 255, 255, 0
YellowGreen - 154, 205, 50
Returnvalues:
| integer red |
| the red-value of the color |
| integer green |
| the green-value of the color |
| integer blue |
| the blue-value of the color |
Parameters:
| string color_name |
| the name of the color, whose color-values you want to retrieve |
^
Color_GetName
Lua: string color_name = reagirl.Color_GetName(integer red, integer green, integer blue)
Gets the name of a color by its values.
These names can be used with reagirl.Color_GetColorValuesByName to get the corresponding color-value.
If a specific color-value has no standard-name, it will return "".
Supports all standard html-names as defined by the W3C:
AliceBlue - 240, 248, 255
AntiqueWhite - 250, 235, 215
Aquamarine - 127, 255, 212
Azure - 240, 255, 255
Beige - 245, 245, 220
Bisque - 255, 228, 196
Black - 0, 0, 0
BlanchedAlmond - 255, 235, 205
Blue - 0, 0, 255
BlueViolet - 138, 43, 226
Brown - 165, 42, 42
BurlyWood - 222, 184, 135
CadetBlue - 95, 158, 160
Chartreuse - 127, 255, 0
Chocolate - 210, 105, 30
Coral - 255, 127, 80
CornflowerBlue - 100, 149, 237
Cornsilk - 255, 248, 220
Crimson - 220, 20, 60
Cyan - 0, 255, 255
DarkBlue - 0, 0, 139
DarkCyan - 0, 139, 139
DarkGoldenRod - 184, 134, 11
DarkGray - 169, 169, 169
DarkGreen - 0, 100, 0
DarkKhaki - 189, 183, 107
DarkMagenta - 139, 0, 139
DarkOliveGreen - 85, 107, 47
DarkOrange - 255, 140, 0
DarkOrchid - 153, 50, 204
DarkRed - 139, 0, 0
DarkSalmon - 233, 150, 122
DarkSeaGreen - 143, 188, 143
DarkSlateBlue - 72, 61, 139
DarkSlateGray - 37, 56, 60
DarkTurquoise - 0, 206, 209
DarkViolet - 148, 0, 211
DeepPink - 255, 20, 147
DeepSkyBlue - 0, 191, 255
DimGray - 105, 105, 105
DodgerBlue - 30, 144, 255
FireBrick - 178, 34, 34
FloralWhite - 255, 250, 240
ForestGreen - 34, 139, 34
Gainsboro - 220, 220, 220
GhostWhite - 248, 248, 255
Gold - 255, 215, 0
GoldenRod - 218, 165, 32
Gray - 128, 128, 128
Green - 0, 128, 0
GreenYellow - 173, 255, 47
HoneyDew - 240, 255, 240
HotPink - 255, 105, 180
IndianRed - 205, 92, 92
Indigo - 75, 0, 130
Ivory - 255, 255, 240
Khaki - 240, 230, 140
Lavender - 230, 230, 250
LavenderBlush - 255, 240, 245
LawnGreen - 124, 252, 0
LemonChiffon - 255, 250, 205
LightBlue - 173, 216, 230
LightCoral - 240, 128, 128
LightCyan - 224, 255, 255
LightGoldenRodYellow - 250, 250, 210
LightGray - 211, 211, 211
LightGreen - 144, 238, 144
LightPink - 255, 182, 193
LightSalmon - 255, 160, 122
LightSeaGreen - 32, 178, 170
LightSkyBlue - 135, 206, 250
LightSlateGray - 119, 136, 153
LightSteelBlue - 176, 207, 222
LightYellow - 255, 255, 224
Lime - 0, 255, 0
LimeGreen - 50, 205, 50
Linen - 250, 240, 230
Magenta - 255, 0, 255
Maroon - 128, 0, 0
MediumAquaMarine - 102, 205, 170
MediumBlue - 0, 0, 205
MediumOrchid - 186, 85, 211
MediumPurple - 147, 112, 219
MediumSeaGreen - 60, 179, 113
MediumSlateBlue - 123, 104, 238
MediumSpringGreen - 0, 250, 154
MediumTurquoise - 72, 209, 204
MediumVioletRed - 199, 21, 133
MidnightBlue - 25, 25, 112
MintCream - 245, 255, 250
MistyRose - 255, 228, 225
Moccasin - 255, 228, 181
NavajoWhite - 255, 222, 173
Navy - 0, 0, 128
OldLace - 254, 240, 227
Olive - 128, 128, 0
OliveDrab - 107, 142, 35
Orange - 255, 165, 0
OrangeRed - 255, 69, 0
Orchid - 218, 112, 214
PaleGoldenRod - 238, 232, 170
PaleGreen - 152, 251, 152
PaleTurquoise - 175, 238, 238
PaleVioletRed - 219, 112, 147
PapayaWhip - 255, 239, 213
PeachPuff - 255, 218, 185
Peru - 205, 133, 63
Pink - 255, 192, 203
Plum - 221, 160, 221
PowderBlue - 176, 224, 230
Purple - 128, 0, 128
RebeccaPurple - 102, 51, 153
Red - 255, 0, 0
RosyBrown - 188, 143, 143
RoyalBlue - 65, 105, 225
SaddleBrown - 139, 69, 19
Salmon - 250, 128, 114
SandyBrown - 244, 164, 96
SeaGreen - 46, 139, 87
SeaShell - 255, 245, 238
Sienna - 160, 82, 45
Silver - 192, 192, 192
SkyBlue - 135, 206, 235
SlateBlue - 106, 90, 205
SlateGray - 112, 128, 144
Snow - 255, 250, 250
SpringGreen - 0, 255, 127
SteelBlue - 70, 130, 180
Tan - 210, 180, 140
Teal - 0, 128, 128
Thistle - 216, 191, 216
Tomato - 255, 99, 71
Turquoise - 64, 224, 208
Violet - 238, 130, 238
Wheat - 245, 222, 179
WhiteSmoke - 245, 245, 245
Yellow - 255, 255, 0
YellowGreen - 154, 205, 50
Returnvalues:
| string color_name |
| the name of the color |
Parameters:
| integer red |
| the red-value of the color |
| integer green |
| the green-value of the color |
| integer blue |
| the blue-value of the color |
^
Color_GetSet
Lua: integer r, integer g, integer b = reagirl.Color_GetSet(string color_name, booean is_set, integer r, integer g, integer b)
Get/set a new color-value for areas of the ui-elements. It will have an immediate effect on all ui-elements sharing that color.
Setting colors will affect only this ReaGirl-gui-instance.
Note: if the user has chosen a theme in the settings, then the theme settings will be used instead of the ones you try to set.
Also note: it will not check, if the colors are properly readable, so check twice, if readability is present by having huge contrasts between colors.
Also make a screenshot of your gui, put it into an image-program and turn it into grayscale. If everything is still readable, you are good to go. If not, then make some of the hard to read colors darker or brighter.
That way you can be sure, that color-blind people or people who need high contrast can read and use your gui.
(This is the reason, why a user-theme overrides your colors, as the user might want to choose a different color-layout for better readability for all ReaGirl-guis.)
The following colors can be set:
Gui_Background_Color - the background-color of the gui
Burgermenu_Area - the click-area of the burger-menu
Burgermenu_Stripes - the stripes of the burger-menu
Buttons_Area - the click-area of the button
Buttons_TextBG - the background of the button-text
Buttons_TextFG - the foreground of the button-text
Buttons_TextFG_disabled - the foreground-color of the button-text when the button is disabled
Checkbox_CheckArea - the area that's visible, when the checkbox is checked
Checkbox_CheckArea_disabled - the area that's visible, when the checkbox is checked and disabled
Checkbox_CaptionBG - the dropshadow of the caption
Checkbox_CaptionFG - the foreground-color of the caption
Checkbox_CaptionFG_disabled - the foreground-color of the caption when checkbos is disabled
Checkbox_background - the background of the checkbox(behind the checked-symbol
DropDownMenu_Area - the click-area of the dropdownmenu
DropDownMenu_AreaTextBG - the background of the text in the click-area of the dropdownmenu
DropDownMenu_AreaTextFG - the foreground of the text in the click-area of the dropdownmenu
DropDownMenu_AreaTextFGdisabled - the foreground of the text in the click-area when dropdownmenu is disabled
DropDownMenu_CaptionBG - the dropshadow of the caption of the dropdownmenu
DropDownMenu_CaptionFG - the foreground of the caption of the dropdownmenu
DropDownMenu_CaptionFGdisabled - the foreground of the caption of the dropdownmenu when it's disabled
DropDownMenu_Circle - the circle of the drop-down-area
DropDownMenu_Circle_disabled - the circle of the drop-down-area when disabled
Inputbox_Area - the typing-area of the inputbox
Inputbox_Cursor - the cursor of the inputbox
InputBox_CaptionBG - the dropshadow of the caption of the inputbox
Inputbox_CaptionFG - the foreground of the caption of the inputbox
Inputbox_CaptionFGdisabled - the foreground of the caption of the inputbox when it's disabled
InputBox_TextBGTyped - the background of the typed text of the inputbox
InputBox_TextFGTyped - the foreground of the typed text of the inputbox
InputBox_TextFGTypeddisabled - the foreground of the typed text of the inputbox when it's disabled
Inputbox_DropdownArea - the dropdown-area
Inputbox_DropdownArea_Circle - the circle of the drop-down-area
Inputbox_DropdownArea_Circle_disabled - the circle of the drop-down-area when disabled
Label_TextBG - the background of the label
Label_TextFG - the foreground of the label
Label_TextFGclickable - the foreground of the clickable label
Label_BackDrop - the backdrop of labels
Scrollbar_Background - the background of the scroll-bar
Scrollbar_Foreground - the foreground of the scroll-bar
Slider_Border - the border of the slider-area
Slider_Center - the center of the slider-area
Slider_Center_disabled - the center of the slider-area when slider is disabled
Slider_Circle_center - the center of the slider-knob
Slider_Circle_center_disabled - the center of the slider-knob, when slider is disabled
Slider_DefaultLine - the color of the default-line of the slider-area
Slider_CaptionBG - the drop-shadow of the slider-caption
Slider_CaptionFG - the foreground of the slider-caption
Slider_CaptionFG_disabled - the foreground of the slider-caption when slider is disabled
Tabs_Inner_Background - the background of the tab-area under the tabs(should be the same as Tabs_Inner_Tabs_Selected)
Tabs_Inner_Tabs_Selected - the color of the selected tab
Tabs_Inner_Tabs_Unselected - the color of the unselected tab
Tabs_CaptionBG - the drop-shadow of the tab-caption-texts
Tabs_CaptionFG - the foreground of the tab-caption-texts
Toolbar_Area - the click-area of the toolbar-button
Toolbar_CaptionBG - the drop-shadow of the caption
Toolbar_CaptionFG - the foreground of the caption
Toolbar_TextBG - the drop-shadow of the text-button
Toolbar_TextFG - the foreground-color of the text-button
Returnvalues:
| integer r |
| the red value of the color; 0-255 |
| integer g |
| the green value of the color; 0-255 |
| integer b |
| the blue value of the color; 0-255 |
Parameters:
| string color_name |
| the name of the color(see description for more details); case sensitive! |
| boolean is_set |
| true, set a new color; false, get the current set color |
| integer r |
| the red value of the color; 0-255 |
| integer g |
| the green value of the color; 0-255 |
| integer b |
| the blue value of the color; 0-255 |
^
DecorRectangle_Add
Lua: string decor_rectangle_guid = reagirl.DecorRectangle_Add(optional integer x, optional integer y, integer w, integer h, integer radius, integer r, integer g, integer b)
Adds a decorative color-rectangle to a gui.
A decorative rectangle is only there for gui-design and has no functionality. You can't tab it or click it.
If you want to choose a color by name, use reagirl.Color_EnumerateNames() to get all possible color-names(all html-colornames as defined by the W3C are supported plus more).
Convert the name to the color-values using Color_GetColorValuesByName.
Colors who have a name are better for screen reader users, since the color name will be reported accordingly.
See this page for more details and color-names: https://www.w3.org/wiki/CSS/Properties/color/keywords
Note: if you want a clickable color-rectangle, use reagirl.ColorRectangle_Add()
Returnvalues:
| string decor_rectangle_guid |
| a guid that can be used for altering the decorative color-rectangle's attributes |
Parameters:
| optional integer x |
| the x position of the color-rectangle in pixels; negative anchors the color-rectangle to the right window-side; nil, autoposition after the last ui-element(see description) |
| optional integer y |
| the y position of the color-rectangle in pixels; negative anchors the color-rectangle to the bottom window-side; nil, autoposition after the last ui-element(see description) |
| integer w |
| the width of the color-rectangle in pixels |
| integer h |
| the height of the color-rectangle in pixels |
| integer radius |
| the radius of the rectangle |
| integer r |
| red-value from 0-255 |
| integer g |
| green-value from 0-255 |
| integer b |
| blue-value from 0-255 |
^
DecorRectangle_GetColor
Lua: integer r, integer g, integer b = reagirl.DecorRectangle_GetColor(string element_id)
Sets the color of a decorative-rectangle.
Returnvalues:
| integer r |
| the red value of the decorative rectangle's color |
| integer g |
| the green value of the decorative rectangle's color |
| integer b |
| the blue value of the decorative rectangle's color |
Parameters:
| string element_id |
| the element_id of the decorative rectangle, whose edges you want to set to square |
^
DecorRectangle_GetEdgeStyle
Lua: boolean square_top_left, boolean square_top_right, boolean square_bottom_left, boolean square_bottom_right = reagirl.DecorRectangle_GetEdgeStyle(string element_id)
Get, if the individual corners of a decorative rectangle are square or round.
Returnvalues:
| boolean square_top_left |
| true, edge is square, false, edge is round |
| boolean square_top_right |
| true, edge is square, false, edge is round |
| boolean square_bottom_left |
| true, edge is square, false, edge is round |
| boolean square_bottom_right |
| true, edge is square, false, edge is round |
Parameters:
| string element_id |
| the element_id of the decorative rectangle, whose square-state of the edges you want get |
^
DecorRectangle_GetRadius
Lua: integer radius = reagirl.DecorRectangle_GetRadius(string element_id)
Gets the current radius of the edges of a decorative rectangle.
Returnvalues:
| integer radius |
| the radius of the edges of the decorative rectangle |
Parameters:
| string element_id |
| the element_id of the decorative rectangle, whose edge-radius you want to get |
^
DecorRectangle_SetColor
Lua: reagirl.DecorRectangle_SetColor(string element_id, integer r, integer g, integer b)
Sets the color of a decorative-rectangle.
Parameters:
| string element_id |
| the element_id of the decorative rectangle, whose edges you want to set to square |
| integer r |
| the red value of the decorative rectangle's color |
| integer g |
| the green value of the decorative rectangle's color |
| integer b |
| the blue value of the decorative rectangle's color |
^
DecorRectangle_SetEdgeStyle
Lua: reagirl.DecorRectangle_SetEdgeStyle(string element_id, boolean square_top_left, boolean square_top_right, boolean square_bottom_left, boolean square_bottom_right)
Set, if the individual corners of a decorative rectangle are square or round.
Parameters:
| string element_id |
| the element_id of the decorative rectangle, whose edges you want to set to square |
| boolean square_top_left |
| true, edge is square, false, edge is round |
| boolean square_top_right |
| true, edge is square, false, edge is round |
| boolean square_bottom_left |
| true, edge is square, false, edge is round |
| boolean square_bottom_right |
| true, edge is square, false, edge is round |
^
DecorRectangle_SetRadius
Lua: integer radius = reagirl.DecorRectangle_SetRadius(string element_id, integer radius)
Sets the radius of the edges of a decorative rectangle.
Parameters:
| string element_id |
| the element_id of the decorative rectangle, whose edge-radius you want to set |
| integer radius |
| the radius of the edges of the decorative rectangle |
^
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 |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
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_GetSelectedMenuItem
Lua: integer selected_menu_item = reagirl.DropDownMenu_GetSelectedMenuItem(string element_id)
Gets the selected menu item of a drop down menu.
Returnvalues:
| integer selected_menu_item |
| the selected menu-item, 1 to maximum number of existing items |
Parameters:
| string element_id |
| the guid of the drop down menu, whose selected menu item you want to get |
^
DropDownMenu_LinkToExtstate
Lua: reagirl.DropDownMenu_LinkToExtstate(string element_id, string section, string key, string default, boolean persist)
Links a drop down menu to an extstate.
All changes to the extstate will be immediately visible for this drop down menu.
If the drop down menu was already linked to an ini-file, the linked-state will be replaced by this new one.
Use reagirl.DropDownMenu_UnLink() to unlink the drop down menu from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the drop down menu, that you want to link to an extstate |
| string section |
| the section of the linked extstate |
| string key |
| the key of the linked extstate |
| string default |
| the default value, if the extstate hasn't been set yet |
| boolean persist |
| true, the extstate shall be stored persistantly; false, the extstate shall not be stored persistantly |
^
DropDownMenu_LinkToIniValue
Lua: reagirl.DropDownMenu_LinkToIniValue(string element_id, string ini_file, string section, string key, string default, boolean persist)
Links a drop down menu to an ini-file-entry.
All changes to the ini-file-entry will be immediately visible for this drop down menu.
Entering text into the inputbox also updates the ini-file-entry immediately.
If the drop down menu was already linked to an ini-file, the linked-state will be replaced by this new one.
Use reagirl.Inputbox_UnLink() to unlink the inputbox from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the inputbox, that you want to link to an extstate |
| string ini_file |
| the filename of the ini-file, whose value you want to link to this slider |
| string section |
| the section of the linked ini-file |
| string key |
| the key of the linked ini-file |
| string default |
| the default value, if the ini-file hasn't been set yet |
| boolean persist |
| true, the ini-file shall be stored persistantly; false, the ini-file shall not be stored persistantly |
^
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 |
^
DropDownMenu_SetSelectedMenuItem
Lua: boolean retval = reagirl.DropDownMenu_SetSelectedMenuItem(string element_id, integer selected_menu_item)
Sets the selected menu-item.
Returnvalues:
| boolean retval |
| true, menu item could be selected; false, menu item could not be selected(i.e. it does not exist) |
Parameters:
| string element_id |
| the guid of the drop down menu, whose width-state you want to set |
| integer selected_menu_item |
| 1 to maximum number of items |
^
DropDownMenu_Unlink
Lua: reagirl.DropDownMenu_Unlink(string element_id)
Unlinks a drop down menu from extstate/ini-file/configvar.
Parameters:
| string element_id |
| the guid of the drop down menu, that you want to unlink from an extstate/inifile-entry/configvar |
^
Ext_IsAnyReaGirlGuiHovered
Lua: boolean retval = reagirl.Ext_IsAnyReaGirlGuiHovered()
Returns, if any ReaGirl-window is currently hovered by the mouse.
Returnvalues:
| boolean retval |
| true, a ReaGirl-window is currently hovered; false, no ReaGirl-window is currently hovered |
^
Ext_SendEvent
Lua: reagirl.Ext_SendEvent(string reagirl_instance_guid, string name_of_ui_element, integer event, string text, integer value, integer value2, integer value3)
Sends a message to a ui-element in a ReaGirl-gui.
To get the values needed for your target gui, go into ReaGirl-settings into the development-tab.
Choose the option to show gui/ui-element-name in the ReaScript console.
Then open the gui in question. Use Tab/Shift+Tab to select the ui-element you want to have. The ReaScript-console-window will show the name of the gui-window and the name of the currently focused ReaGirl-ui-element.
These you can use with this function by copying the names from within the quotes.
Note: events can also be sent to hidden ui-elements!
Also note: if multiple ui-elements have the same name, they will all be set with the same value(if they are the correct ui-element-type).
The run-functions of ui-elements that received events will be run as well.
The sent event will be executed in the next defer-cycle. If you send the same event multiple times to a ui-element within one defer-cycle, it will only be executed once.
Parameters:
| string reagirl_instance_guid |
| the guid of a ReaGirl-window-instance |
| string name_of_ui_element |
| the name of the ui-element(usually the caption) |
| integer event |
the event to send:
1, send a left click to the ui-element
2, set checkbox to true
3, set checkbox to false
4, set dropdownmenu-item(use parameter value to pass the index of the dropdownmenu-item)
5, set slider-value(use parameter value to pass the value of the slider)
6, scroll to ui-element
7, scroll to ui-element and set keyboard focus to it
8, set label text/text of inputboxes
9, set color of a color-rectangle(use value for r, value2 for g, value3 for b-value; 0-255 each)
10, set the state of a toolbar-button |
| string text |
| the text to pass to a ui-element; use "" if not needed |
| integer value |
| the value to pass to a ui-element; use 0 if not needed |
| integer value2 |
| the second value to pass to a ui-element; use 0 if not needed |
| integer value3 |
| the third value to pass to a ui-element; use 0 if not needed |
^
Ext_SendEventByID
Lua: reagirl.Ext_SendEventByID(string reagirl_instance_guid, string id_of_ui_element, integer event, string text, integer value, integer value2, integer value3)
Sends a message to a ui-element in a ReaGirl-gui.
To get the values needed for your target gui, go into ReaGirl-settings into the development-tab.
Choose the option to show gui/ui-element-name in the ReaScript console.
Then open the gui in question. Use Tab/Shift+Tab to select the ui-element you want to have. The ReaScript-console-window will show the name of the gui-window and the name of the currently focused ReaGirl-ui-element as well as its ID(if given).
These you can use with this function by copying the gui-name and the ui-element-id from within the quotes.
Note: events can also be sent to hidden ui-elements!
Also note: if multiple ui-elements have the same id, they will all be set with the same value(if they are the correct ui-element-type).
The run-functions of ui-elements that received events will be run as well.
The sent event will be executed in the next defer-cycle. If you send the same event multiple times to a ui-element within one defer-cycle, it will only be executed once.
Parameters:
| string reagirl_instance_guid |
| the guid of a ReaGirl-window-instance |
| string id_of_ui_element |
| the name of the ui-element |
| integer event |
the event to send:
1, send a left click to the ui-element
2, set checkbox to true
3, set checkbox to false
4, set dropdownmenu-item(use parameter value to pass the index of the dropdownmenu-item)
5, set slider-value(use parameter value to pass the value of the slider)
6, scroll to ui-element
7, scroll to ui-element and set keyboard focus to it
8, set label text/text of inputboxes
9, set color of a color-rectangle(use value for r, value2 for g, value3 for b-value; 0-255 each)
10, set the state of a toolbar-button |
| string text |
| the text to pass to a ui-element; use "" if not needed |
| integer value |
| the value to pass to a ui-element; use 0 if not needed |
| integer value2 |
| the second value to pass to a ui-element; use 0 if not needed |
| integer value3 |
| the third value to pass to a ui-element; use 0 if not needed |
^
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_UI_Element_GetHovered
Lua: string window_name, string window_guid, string ui_element_type, string ui_element_guid, string ui_element_name = reagirl.Ext_UI_Element_GetHovered()
Returns the ReaGirl-UI-element the mouse is currently hovering above, including the window name and its unique identifier.
This returns it for any opened ReaGirl-gui-instance, not just the ones from the current gui.
If you just want to have the hovered ui-element of the current script, use reagirl.UI_Element_GetHovered().
Returns "" if the mouse is not hovered above any ui-element
Returnvalues:
| string window_name |
| the name of the window, as named by the Gui_Open-function in the ReaGirl-script |
| string window_guid |
| the unique identifier of the hovered ReaGirl-gui-instance |
| string ui_element_type |
| the type of the ui-element |
| string ui_element_guid |
| the identifier of the ui-element |
| string ui_element_name |
| the name of the ui-element(usually the caption) |
| string ui_element_tabname |
| if the hovered ui-element is a tab, this will have the name of the tab currently hovered |
^
Ext_Window_Close
Lua: boolean retval = reagirl.Ext_Window_Close(string gui_name, optional string gui_identifier)
Closes an opened ReaGirl-gui-window from the outside.
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 close |
| optional string gui_identifier |
| a unique identifier(guid) of an opened ReaGirl-gui-instance |
^
Ext_Window_Focus
Lua: boolean retval = reagirl.Ext_Window_Focus(string gui_name, optional string gui_identifier)
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 |
| optional string gui_identifier |
| a unique identifier(guid) of an opened ReaGirl-gui-instance |
^
Ext_Window_GetInstances
Lua: integer window_count, table window_instances = reagirl.Ext_Window_GetInstances()
Returns the currently opened ReaGirl-window-instances.
The window_instances retval is of the following format:
window_instance[index][1]="window name" - the name of the window-instance, as given in reagirl.Gui_Open()
window_instance[index][2]="Guid" - a unique identifier for this ReaGirl-gui-instance
Only opened windows will be shown here!
Returnvalues:
| integer window_count |
| the number of opened ReaGirl-windows |
| table window_instances |
| a table with all window-instance names and identifiers currently opened |
^
Ext_Window_GetProcessTime
Lua: number process_time = reagirl.Ext_Window_GetProcessTime(string reagirl_instance_guid)
Returns, how much processing time a ReaGirl-instance uses for its gui-management/drawing operations.
Gives you a hint, whether you have too many gui-elements in your gui that could cause lagging of the gui or Reaper.
Returnvalues:
| number process_time |
| the amount of processing-time the instance needed in the last defer-cycle |
Parameters:
| string reagirl_instance_guid |
| the guid of a ReaGirl-window-instance |
^
Ext_Window_GetState
Lua: integer width, integer height, integer dockstate, integer x_position, integer y_position = reagirl.Ext_Window_GetState(string gui_name, optional string gui_instance)
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 |
| optional string gui_instance |
| the identifier(guid) of an opened ReaGirl-script-instance |
^
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 |
| optional string gui_instance |
| the unique identifier(guid) of an opened ReaGirl-script-instance |
^
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 minimum_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_GetCurrentScriptInstance
Lua: string gui_name, string gui_instance_identifier = reagirl.Gui_GetCurrentScriptInstance()
Returns the current gui-name(as given by reagirl.Gui_Open()) and the current gui-instance-identifier.
Note: gui_name might be "" when Gui_Open has not been used yet!
gui_instance_identifier stays the same until the script stops, no matter how often you close and reopen the gui-window with reagirl.Gui_Open()
Returnvalues:
| string gui_name |
| the current gui-name, as given by reagirl.Gui_Open() |
| string identifier |
| the gui-identifier of the current gui-instance |
^
Gui_GetSetStickyOffset
Lua: integer y_offset_top, integer y_offset_bottom = reagirl.Gui_GetSetStickyOffset(boolean is_set, integer y_offset, integer y_offset_bottom)
gets/sets the y-offset of the ui-element, when tabbing through it.
With this, you can prevent ui-elements getting stuck behind sticky elements when tabbing/scrolling through it.
Rule of thumb for y_offset_top:
Put the first ui-element right under the sticky element and use the same y-position as value for y_offset_top. That way, it looks seamless.
Returnvalues:
| integer y_offset_top |
| the offset from the top. Tabbed ui-elements at the top will be moved down by this value. |
| integer y_offset_bottom |
| the offset from the bottom. Tabbed ui-elements at the bottom will be moved up by this value. |
Parameters:
| boolean is_set |
| true, set the sticky-offset; false, only retrieve current sticky-offset |
| integer y_offset_top |
| the offset from the top. Tabbed ui-elements at the top will be moved down by this value. |
| integer y_offset_bottom |
| the offset from the bottom. Tabbed ui-elements at the bottom will be moved up by this value. |
^
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(optional boolean keep_running)
Manages the gui-window.
Put this function in a defer-loop. It will manage, draw, show the gui.
Note: if you set the parameter keep_running to true, you don't need to add a defer-loop in your script.
Parameters:
| optional boolean keep_running |
| true, run the gui without a dedicated defer-loop; nil or false, add a defer-loop to the gui-script that calls reagirl.Gui_Manage() frequently. |
^
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.
Note for Mac-users: y=0 is at the top of the screen, not the bottom! So if you want to place a window at the top, use y=0!
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 and control characters 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, optional string unique_identifier)
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 |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
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_GetAutoUpdate
Lua: boolean auto_update = reagirl.Image_GetAutoUpdate(string element_id)
Gets, if auto-update has been enabled for an image.
Auto-update means, that the image is reloaded automatically when the file is changed. Will only check for the unscaled, original image-file,
so if you want to auto-update scaled images, you need to update the unscaled image last.
Used for things like "Cover images" where the user can update the cover-image in another app, so it instantly gets reloaded when the user has finished saving the file.
The updating happens three seconds after the image-file has finished saving.
Returnvalues:
| boolean auto_update |
| true, auto-update is enabled for this image; false, auto-update is not enabled for this image |
Parameters:
| string element_id |
| the image-element, whose auto-update-state you want to get |
^
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_GetDropShadow
Lua: boolean has_drop_shadow = reagirl.Image_GetDropShadow(string element_id)
Gets, if the image is drawn with a drop-shadow. This is helpful for images, that might not be correctly visible in either light or dark-theme or if conflicting colors are chosen by the user or the script.
Returnvalues:
| boolean has_drop_shadow |
| true, drop-shadow is enabled for this image; false, drop-shadow is not enabled for this image |
Parameters:
| string element_id |
| the image-element, whose drop-shadow-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_SetAutoUpdate
Lua: reagirl.Image_SetAutoUpdate(string element_id, boolean auto_update)
Sets auto-update-state for an image.
Auto-update means, that the image is reloaded automatically when the file is changed. Will only check for the unscaled, original image-file,
so if you want to auto-update scaled images, you need to update the unscaled image last.
Used for things like "Cover images" where the user can update the cover-image in another app, so it instantly gets reloaded when the user has finished saving the file.
The updating happens three seconds after the image-file has finished saving.
Parameters:
| string element_id |
| the image-element, whose auto-update-state you want to set |
| boolean auto_update |
| true, auto-update is enabled for this image; false, auto-update is not enabled for this image |
^
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 |
^
Image_SetDropShadow
Lua: reagirl.Image_SetDropShadow(string element_id, boolean has_drop_shadow)
Sets, if the image shall be drawn with a drop-shadow. This is helpful for images, that might not be correctly visible in either light or dark-theme or if conflicting colors are chosen by the user or the script.
Parameters:
| string element_id |
| the image-element, whose drop-shadow-state you want to set |
| boolean has_drop_shadow |
| true, drop-shadow is enabled for this image; false, drop-shadow is not enabled for this image |
^
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, optional string unique_identifier)
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) |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
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_GetTextSuggestions
Lua: table suggestions = reagirl.Inputbox_GetTextSuggestions(string element_id)
Gets the currently available text-suggestions of an inputbox, that can be chosen by the user via a drop-down-menu in the inputbox.
Text suggestions are not available for screen reader users, due to API-limitations.
Parameters:
| string element_id |
| the guid of the inputbox, whose text suggestions you want to get |
^
Inputbox_LinkToConfigVar
Lua: reagirl.Inputbox_LinkToConfigVar(string element_id, string configvar_name, boolean persist)
Links an inputbox to a configvar.
All changes to the configvar will be immediately visible for this inputbox.
Entering text also updates the configvar-bit immediately.
Note: this will only allow string config-variables. All others could cause malfunction of Reaper!
Read the Reaper Internals-docs for all available config-variables(run the action ultraschall_Help_Reaper_ConfigVars_Documentation.lua for more details)
If the inputbox was already linked to extstate or ini-file, the linked-state will be replaced by this new one.
Use reagirl.Inputbox_Unlink() to unlink the inputbox from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the inputbox that shall set a config-var |
| string configvar_name |
| the config-variable, whose value you want to update using the slider |
| boolean persist |
| true, make this setting persist; false, make this setting only temporary until Reaper restart |
^
Inputbox_LinkToExtstate
Lua: reagirl.Inputbox_LinkToExtstate(string element_id, string section, string key, string default, boolean persist)
Links an inputbox to an extstate.
All changes to the extstate will be immediately visible for this inputbox.
If the inputbox was already linked to a config-var or ini-file, the linked-state will be replaced by this new one.
Use reagirl.Inputbox_UnLink() to unlink the inputbox from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the inputbox, that you want to link to an extstate |
| string section |
| the section of the linked extstate |
| string key |
| the key of the linked extstate |
| string default |
| the default value, if the extstate hasn't been set yet |
| boolean persist |
| true, the extstate shall be stored persistantly; false, the extstate shall not be stored persistantly |
^
Inputbox_LinkToIniValue
Lua: reagirl.Inputbox_LinkToIniValue(string element_id, string ini_file, string section, string key, string default, boolean persist)
Links an inputbox to an ini-file-entry.
All changes to the ini-file-entry will be immediately visible for this inputbox.
Entering text into the inputbox also updates the ini-file-entry immediately.
If the inputbox was already linked to a config-var or extstate, the linked-state will be replaced by this new one.
Use reagirl.Inputbox_UnLink() to unlink the inputbox from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the inputbox, that you want to link to an extstate |
| string ini_file |
| the filename of the ini-file, whose value you want to link to this slider |
| string section |
| the section of the linked ini-file |
| string key |
| the key of the linked ini-file |
| string default |
| the default value, if the ini-file hasn't been set yet |
| boolean persist |
| true, the ini-file shall be stored persistantly; false, the ini-file shall not be stored persistantly |
^
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 |
^
Inputbox_SetTextSuggestions
Lua: reagirl.Inputbox_SetTextSuggestions(string element_id, table suggestions)
Sets text-suggestions, that can be chosen by the user via a drop-down-menu in the inputbox.
Text suggestions are not available for screen reader users, due to API-limitations.
Parameters:
| string element_id |
| the guid of the inputbox, whose text suggestions you want to set |
| table suggestions |
| a table with all text suggestions, that the user can choose from |
^
Inputbox_Unlink
Lua: reagirl.Inputbox_Unlink(string element_id)
Unlinks an inputbox from extstate/ini-file/configvar.
Parameters:
| string element_id |
| the guid of the inputbox, that you want to unlink from an extstate/inifile-entry/configvar |
^
Label_Add
Lua: string label_id = reagirl.Label_Add(optional integer x, optional integer y, string label, string meaningOfUI_Element, boolean clickable, optional function run_function, optional string unique_identifier)
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
Returnvalues:
| string label_id |
| a guid that can be used for altering the label-attributes |
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) |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
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_GetLabelText
Lua: string label_text = reagirl.Label_GetLabelText(string element_id)
Gets the text of a label.
Returnvalues:
| string label_text |
| the current text of a label |
Parameters:
| string element_id |
| the id of the element, whose label you want to set |
^
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 |
^
Meter_Add
Lua: string meter_guid = reagirl.Meter_Add(integer x, integer y, integer w, integer h, integer mode, string caption, string meaningOfUI_Element, optional function run_function, optional string unique_identifier)
Adds a meter to a gui.
You can autoposition the meter by setting x and/or y to nil, which will position the new meter 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 meter
- number db_value - the current db_value
Note: the run-function will be run in every single defer-cycle! Helpful when linked to hardware inputs or track-level.
Returnvalues:
| string meter_guid |
| a guid that can be used for altering the meter-attributes |
Parameters:
| optional integer x |
| the x position of the meter in pixels; negative anchors the meter to the right window-side; nil, autoposition after the last ui-element(see description) |
| optional integer y |
| the y position of the meter in pixels; negative anchors the meter to the bottom window-side; nil, autoposition after the last ui-element(see description) |
| integer w |
| the width of the meter |
| integer h |
| the height of the meter |
| integer mode |
| 1, meter is color-changing rectangle; 2, meter goes from left to right; 3, meter goes from bottom to top |
| string caption |
| the caption of the meter |
| 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 in every defer-cycle; will get passed over the meter-element_id as first and the db-value as second parameter |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
see also:
^
Meter_GetLink
Lua: integer linked = reagirl.Meter_GetLink(string element_id)
Gets, to which a meter is currently linked.
Returnvalues:
| integer linked |
| 0, unlinked; 1, linked to hardware input; 2, linked to track |
Parameters:
| string element_id |
| the guid of the meter, whose peaks you want to get |
^
Meter_GetMode
Lua: integer mode = reagirl.Meter_GetMode(string element_id)
Gets a meter's currently draw-mode.
Returnvalues:
| integer mode |
the draw mode
1, meter is a color-changing rectangle
2, meter goes from left to right
3, meter goes from bottom to top |
Parameters:
| string element_id |
| the guid of the meter, whose draw-mode you want to get |
^
Meter_GetOptions
Lua: boolean show_peak_value, boolean show_peak_hold, boolean show_peak_indicators = reagirl.Meter_GetOptions(string element_id)
Gets a meter's currently draw-options.
Returnvalues:
| boolean show_peak_value |
| true, show the peak-value in the meter; false, don't show |
| boolean show_peak_hold |
| true, show the peak hold-line in the meter; false, don't show |
| boolean show_peak_indicators |
| true, show the peak-indicator-lines; false, don't show |
Parameters:
| string element_id |
| the guid of the meter, whose draw-options you want to get |
^
Meter_GetPeak
Lua: table peaks = reagirl.Meter_GetPeak(string element_id)
Gets a meter's currently drawn peaks.
Note: when you just set them, the set peaks can only be got in the next defer-cycle.
Returnvalues:
| table peaks |
| all currently drawn peaks |
Parameters:
| string element_id |
| the guid of the meter, whose peaks you want to get |
^
Meter_GetScreenreaderOptions
Lua: integer report_clippings = reagirl.Meter_GetScreenreaderOptions(string element_id)
Gets options for usage of a meter with screen reader.
These override the preferences in the ReaGirl-settings, so be careful when using them.
You should be fine when doing a script for yourself, but when you do a script that shall be shared with others, communicate openly, that you override the preferences.
Otherwise people may have unexpected experiences and report this as bug.
Use reagirl.Settings_Global_GetSet() to get/set the various current screen reader options.
Parameters:
| string element_id |
| the guid of the meter, whose screen reader options you want to set |
| integer report_clippings |
0, global preferences are used
1, when gui has focus
2, also when gui has no focus
3, never |
see also:
^
Meter_LinkToHWInput
Lua: reagirl.Meter_LinkToHWInput(string element_id, integer hwinput_index)
Links a meter to a certain harware input-level.
Parameters:
| string element_id |
| the guid of the meter, that you want to link to a hardware input |
| integer hwinput_index |
| 1 and higher for the hardware-input |
^
Meter_LinkToTrack
Lua: reagirl.Meter_LinkToTrack(string element_id, integer tracknumber)
Links a meter to a certain track. This will automatically draw multiple channels, if the track is multichannel.
If the track is removed, it will automatically unlink from the track.
Use reagirl.Meter_GetLink() to get, if the meter is still linked to a track.
Parameters:
| string element_id |
| the guid of the meter, that you want to link to a track |
| integer tracknumber |
| 0, main track; 1 and higher, track 1 and higher |
^
Meter_SetMode
Lua: boolean retval = reagirl.Meter_SetMode(string element_id, integer mode)
Sets the draw-mode of the meter.
Returnvalues:
| boolean retval |
| true, setting was succesful; false, setting was unsuccessful |
Parameters:
| string element_id |
| the guid of the meter, whose draw-mode you want to set |
| integer mode |
the draw mode
1, meter is a color-changing rectangle
2, meter goes from left to right
3, meter goes from bottom to top |
^
Meter_SetOptions
Lua: boolean retval = reagirl.Meter_SetOptions(string element_id, optional boolean show_peak_value, optional boolean show_peak_hold, optional boolean show_peak_indicators)
Sets the various draw-options of the meter.
Returnvalues:
| boolean retval |
| true, setting was succesful; false, setting was unsuccessful |
Parameters:
| string element_id |
| the guid of the meter, whose draw-options you want to set |
| optional boolean show_peak_value |
| true, show the peak-value in the meter; false, don't show |
| optional boolean show_peak_hold |
| true, show the peak hold-line in the meter; false, don't show |
| optional boolean show_peak_indicators |
| true, show the peak-indicator-lines; false, don't show |
^
Meter_SetPeak
Lua: boolean retval = reagirl.Meter_SetPeak(string element_id, number peak1, number peak2, ...)
Sets the peak-values that shall be displayed in the meter.
You can set more than one peak-value for multichannel display.
Returnvalues:
| boolean retval |
| true, setting was succesful; false, setting was unsuccessful |
Parameters:
| string element_id |
| the guid of the button, whose radius you want to set |
| number peak1 |
| channel 1 in dB, -144 to +12 |
| number peak2 |
| channel 2 in dB, -144 to +12 |
^
Meter_SetScreenreaderOptions
Lua: reagirl.Meter_SetScreenreaderOptions(string element_id, integer report_clippings)
Sets options for usage of a meter with screen reader.
This will override the preferences in the ReaGirl-settings, so be careful when using them.
You should be fine when doing a script for yourself, but when you do a script that shall be shared with others, communicate openly, that you override the preferences.
Otherwise people may have unexpected experiences and report this as bug.
Use reagirl.Settings_Global_GetSet() to get/set the various current screen reader options.
Parameters:
| string element_id |
| the guid of the meter, whose screen reader options you want to set |
| integer report_clippings |
0, use global preferences
1, when gui has focus
2, also when gui has no focus
3, never |
see also:
^
Meter_Unlink
Lua: reagirl.Meter_Unlink(string element_id)
Unlinks a metre from hardware input or track.
Parameters:
| string element_id |
| the guid of the meter, that you want to link to a hardware input |
| integer hwinput_index |
| 1 and higher for the hardware-input |
^
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) |
^
Menu_GetEntryName
Lua: string menu_entry_name, boolean checked = reagirl.Menu_GetEntryName(string menu, integer entry_nr)
Gets the name of a specific menu-entry by its index.
Returnvalues:
| string menu_entry_name |
| the name of the menu-entry |
| boolean checked |
| true, item is checked; false, item is not checked |
Parameters:
| string menu |
| the menu, whose menu-entry-name you want to get |
| integer entry_nr |
| the index of the menu, whose name you want to get |
^
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 |
^
Settings_Global_GetSet
Lua: number value = reagirl.Settings_Global_GetSet(string setting, boolean is_set, number value)
Sets the global settings, as set in the ReaGirl-settings dialog. The changes will have immediate effect on
all ReaGirl-gui-instances.
The following settings are valid:
Show_Tooltips - 0, don't show tooltips; 1, show tooltips
Scroll_Via_Keyboard - 0, don't scroll via keyboard; 1, enable scroll via keyboard(default)
FocusRectangle_Always_On - 0, only show focus rectangle, when tabbing; 1, always show focus rectangle(default)
FocusRectangle_BlinkSpeed - the speed of the blinking of the focus rectangle; 0-3(default 1)
FocusRectangle_BlinkTime - the length of the blinking in seconds; 0-10 seconds(default: 0)
Inputbox_Blinkspeed - the blinkspeed of the inputbox-cursor; 0.4-5 seconds(default: 1)
Scaling_Override - the default scaling of the guis; 0-8(default: 0=auto-scaling)
Highlight_UI_Element_Intensity - the intensity of highlighting when hovering above ui-elements; 0-3(default 0.75)
Drag_Highlight_Destinations - 0, don't highlight drag destinations; 1, highlight drag destinations(default)
Drag_Highlight_Destinations_Blink - the speed of blinking of the highlighted drag-destinations; 0-5 seconds(default: 0)
Osara_Enabled - 0, osara-screen reader support is disabled; 1, osara-screen reader support is enabled(default)
Osara_Hover_Mouse - 0, don't report hovered ui-elements to screen reader; 1, report hovered ui-elements to screen reader(default)
Osara_Move_Mouse - 0, don't move mouse when tabbing; 1, move mouse when tabbing to tabbed ui-element(default)
Osara_Enable_AccessibilityMessages - 0, only report caption+state to screen reader; 1, also report help-messages for ui-element to screen reader(default)
Osara_Report_Meter_Clippings - 1, report clippings to screen reader when gui has focus; 2, report clippings also when gui has no focus; 3, never report clippings
Osara_Debug - 0, don't show screen reader messages in ReaScript console(default); 1, show screen reader messages in ReaScript console
Debug_Message_Destination - the destination of error-messages; 1, IDE; 2, a messagebox; 3, ReaScript console window
Returnvalues:
| string value |
| the current value set for a specific setting |
Parameters:
| string setting |
| the name of the setting, that you want to get/set |
| boolean is_set |
| true, set a new value; false, only get the current value |
| number value |
| the new value set for a setting(when is_set=true) |
^
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, optional string unique_identifier)
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 |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
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_LinkToDoubleConfigVar
Lua: reagirl.Slider_LinkToDoubleConfigVar(string element_id, string configvar_name, boolean persist, optional number factor)
Links a slider to a configvar.
All changes to the configvar will be immediately visible for this slider.
Draggint the slider also updates the configvar-bit immediately.
Note: this will only allow double-float config-variables. All others could cause malfunction of Reaper!
Use reagirl.Slider_LinkToIntConfigVar() for integer-config-variables.
Read the Reaper Internals-docs for all available config-variables(run the action ultraschall_Help_Reaper_ConfigVars_Documentation.lua for more details)
If the slider was already linked to extstate or ini-file, the linked-state will be replaced by this new one.
Use reagirl.Slider_Unlink() to unlink the slider from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the slider that shall set a config-var |
| string configvar_name |
| the config-variable, whose value you want to update using the slider |
| boolean persist |
| true, make this setting persist; false, make this setting only temporary until Reaper restart |
| optional number factor |
| a factor, by which the value shall be multiplied |
^
Slider_LinkToExtstate
Lua: reagirl.Slider_LinkToExtstate(string element_id, string section, string key, number default, boolean persist, optional number factor)
Links a slider to an extstate.
All changes to the extstate will be immediately visible for this slider.
Dragging the slider also updates the extstate immediately.
If the slider was already linked to a config-var or ini-file, the linked-state will be replaced by this new one.
Use reagirl.Slider_UnLink() to unlink the slider from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the slider, that you want to link to an extstate |
| string section |
| the section of the linked extstate |
| number key |
| the key of the linked extstate |
| string default |
| the default value, if the extstate hasn't been set yet |
| boolean persist |
| true, the extstate shall be stored persistantly; false, the extstate shall not be stored persistantly |
| optional number factor |
| a factor, by which the value shall be multiplied |
^
Slider_LinkToIniValue
Lua: reagirl.Slider_LinkToIniValue(string element_id, string ini_file, string section, string key, string default, boolean persist, optional number factor)
Links a slider to an ini-file-entry.
All changes to the ini-file-entry will be immediately visible for this slider.
Dragging the slider also updates the ini-file-entry immediately.
If the slider was already linked to a config-var or extstate, the linked-state will be replaced by this new one.
Use reagirl.Slider_UnLink() to unlink the slider from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the slider, that you want to link to an extstate |
| string ini_file |
| the filename of the ini-file, whose value you want to link to this slider |
| string section |
| the section of the linked ini-file |
| string key |
| the key of the linked ini-file |
| string default |
| the default value, if the ini-file hasn't been set yet |
| boolean persist |
| true, the ini-file shall be stored persistantly; false, the ini-file shall not be stored persistantly |
| optional number factor |
| a factor, by which the value shall be multiplied |
^
Slider_LinkToIntConfigVar
Lua: reagirl.Slider_LinkToIntConfigVar(string element_id, string configvar_name, boolean persist, optional number factor)
Links a slider to a configvar.
All changes to the configvar will be immediately visible for this slider.
Dragging the slider also updates the configvar-bit immediately.
Note: this will only allow integer-config-variables. All others could cause malfunction of Reaper!
Use reagirl.Slider_LinkToDoubleConfigVar() for integer-config-variables.
Read the Reaper Internals-docs for all available config-variables(run the action ultraschall_Help_Reaper_ConfigVars_Documentation.lua for more details)
If the slider was already linked to extstate or ini-file, the linked-state will be replaced by this new one.
Use reagirl.Slider_Unlink() to unlink the slider from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the slider that shall set a config-var |
| string configvar_name |
| the config-variable, whose value you want to update using the slider |
| boolean persist |
| true, make this setting persist; false, make this setting only temporary until Reaper restart |
| optional number factor |
| a factor, by which the value shall be multiplied |
^
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 |
^
Slider_Unlink
Lua: reagirl.Slider_Unlink(string element_id)
Unlinks a slider from extstate/ini-file/configvar.
Parameters:
| string element_id |
| the guid of the slider, that you want to unlink from an extstate/inifile-entry/configvar |
^
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, optional string unique_identifier)
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 |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
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 |
^
ToolbarButton_Add
Lua: string toolbarbutton_guid = reagirl.ToolbarButton_Add(optional integer x, optional integer y, string toolbaricon, integer num_states, integer default_state, table state_names, integer mode, string caption, string meaningOfUI_Element, optional function run_function, optional string unique_identifier)
Adds a toolbar-button to a gui.
You can autoposition the toolbar-button by setting x and/or y to nil, which will position the new toolbar-button after the last ui-element.
To autoposition into the next line, use reagirl.NextLine()
Toolbarbuttons have the same size as Reaper's own toolbar-buttons: 30x30 pixels(in 1x scaling)
They also can have up to 32 states.
The individual states are numbered 0-based, means: the first state is state 0, the second one state 1, etc.
You can have max 1000 toolbarbuttons and/or images in your gui.
The run-function gets as parameter:
- string element_id - the element_id as string of the pressed toolbar-button that uses this run-function
- integer cur_state - the current state of the toolbar-button, 0 or higher. Will stay 0 if the button allows only 1 state!
- string cur_state_name - the name of the new state
Note for the toolbarimages:
For toolbar-button-images, you create a toolbar-image, which is 30 pixels in height and 30*number of states. So if you have 5 states, you create an image with
30+150 pixels. In the images, you put the number of states as individual images. So for our 5-state image, the first 30 pixels are for the image of state 1, the second 30 pixels
are for the image of state 2, the third 30 pixels for the image of state 3, etc.
Important: if you set mode=5, the image will behave as Reaper's own toolbar-buttons. With that, the image is 30*90 pixels with the first 30 pixels being the image for button is turned off,
the second 30 pixels for the mouse is hovering above the button and the third 30 pixels for when the button is turned on.
For scaling, you create upscaled images for 1x(30*num_states x 30 pixels), 2x(60*num_states x 60 pixels, 3x(90*num_states x 60 pixels), etc.
The filenames are either in the same folder like the unscaled image, like:
toolbaricon-image.png
toolbaricon-image-2x.png
toolbaricon-image-3x.png
etc
Or you place them in subfolders, where the scaling is written in 100 steps(Reaper's behavior):
toolbar-image.png
200/toolbar-image.png
300/toolbar-image.png
400/toolbar-image.png
etc
Returnvalues:
| string toolbarbutton_guid |
| a guid that can be used for altering the toolbar-button-attributes |
Parameters:
| optional integer x |
| the x position of the toolbar-button in pixels; negative anchors the toolbar-button to the right window-side; nil, autoposition after the last ui-element(see description) |
| optional integer y |
| the y position of the toolbar-button in pixels; negative anchors the toolbar-button to the bottom window-side; nil, autoposition after the last ui-element(see description) |
| string toolbaricon |
| filename+path to the toolbar-icon-image; will be ignored for text-toolbar-icons |
| integer num_states |
| number of states when clicked; 1, 1-state; 2, 2-states; 3, 3-states, etc |
| integer default_state |
| default-state(1 or higher); can't be higher than maximum states! |
| table state_names |
a table with all state-names. These will be shown in the tooltip/screen reader message when a certain state has been set.
Each entry must be a string! |
| integer mode |
1, toolbar-icon only
2, toolbar-icon+caption right
3, text-toolbar-icon
4, text-toolbar-icon double width
5, Reaper's toolbar behavior, means, the toolbar-image will be seen as: left side, state 0; right side, state 1 and the middle part is used for when the mouse hovers above the toolbar button
&128==128; places the toolbarbutton directly after the previous ui-element when using autopositioning, so no gaps inbetween(just add 128 to mode)
&256==256; supresses drawing of the actual button, will only draw the image itself(good for when you want to draw the entire button including borders in the toolbar image) |
| string caption |
| the caption of the toolbar-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 toolbar-button is clicked; will get the toolbar-button-element_id passed over as first parameter; nil, no run-function for this toolbar-button |
| optional unique_identifier |
| a unique identifier for this ui-element; make this unique among all ui-elements in this gui, as this can be used for scripters to externally control your ReaGirl-gui |
^
ToolbarButton_GetColor
Lua: boolean default_color, integer r, integer g, integer b = reagirl.ToolbarButton_GetColor(string element_id)
Gets a toolbar-button's color.
Returnvalues:
| boolean default_color |
| true, the toolbar-button has default color; false, the toolbar-button has its own color |
| integer r |
| the red-value of the color; 0-255 |
| integer g |
| the green-value of the color; 0-255 |
| integer b |
| the blue-value of the color; 0-255 |
Parameters:
| string element_id |
| the guid of the toolbar-button, whose color you want to get |
^
ToolbarButton_GetDropShadow
Lua: reagirl.ToolbarButton_GetDropShadow(string element_id)
Gets, if the image is drawn with a drop-shadow. This is helpful for images, that might not be correctly visible in either light or dark-theme or if conflicting colors are chosen by the user or the script.
Returnvalues:
| boolean has_drop_shadow |
| true, drop-shadow is enabled for this image; false, drop-shadow is not enabled for this image |
Parameters:
| string element_id |
| the image-element, whose drop-shadow-state you want to get |
^
ToolbarButton_GetEdgeStyle
Lua: boolean top_left, boolean top_right, boolean bottom_left, boolean bottom_right = reagirl.ToolbarButton_GetEdgeStyle(string element_id)
Gets, if the individual edges of a toolbar-button are rounded or square.
Returnvalues:
| boolean top_left |
| true, edge is square; false, edge is rounded |
| boolean top_right |
| true, edge is square; false, edge is rounded |
| boolean bottom_left |
| true, edge is square; false, edge is rounded |
| boolean bottom_right |
| true, edge is square; false, edge is rounded |
Parameters:
| string element_id |
| the guid of the toolbar-button, whose state you want to get |
^
ToolbarButton_GetRadius
Lua: integer radius = reagirl.ToolbarButton_GetRadius(string element_id)
Gets a toolbar-button's radius of the edges.
Returnvalues:
| integer radius |
| the radius of the edges of the toolbar-button; between 0 and 10 |
Parameters:
| string element_id |
| the guid of the toolbar-button, whose radius you want to get |
^
ToolbarButton_GetState
Lua: integer state = reagirl.ToolbarButton_GetState(string element_id)
Gets a toolbar-button's current state.
The state is incremented, when the user clicks the button.
Returnvalues:
| integer state |
| the current state of the toolbar-button |
| integer num_states |
| the number of available states |
Parameters:
| string element_id |
| the guid of the toolbar-button, whose state you want to get |
^
ToolbarButton_LinkToExtstate
Lua: reagirl.ToolbarButton_LinkToExtstate(string element_id, string section, string key, string default, boolean persist)
Links a toolbar-button to an extstate.
All changes to the extstate will be immediately visible for this toolbar-button.
Clicking the toolbarbutton also updates the extstate immediately.
If the toolbarbutton was already linked to a config-var or ini-file, the linked-state will be replaced by this new one.
Use reagirl.ToolbarButton_Unlink() to unlink the toolbarbutton from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the toolbarbutton, that you want to link to an extstate |
| string section |
| the section of the linked extstate |
| string key |
| the key of the linked extstate |
| string default |
| the default value, if the extstate hasn't been set yet |
| boolean persist |
| true, the extstate shall be stored persistantly; false, the extstate shall not be stored persistantly |
^
ToolbarButton_LinkToIniValue
Lua: reagirl.ToolbarButton_LinkToIniValue(string element_id, string ini_file, string section, string key, string default, boolean persist)
Links a toolbar-button to an ini-value.
All changes to the ini-value will be immediately visible for this toolbar-button.
Clicking the toolbar-button also updates the inivalue immediately.
If the toolbar-button was already linked to extstate or config-variable, the linked-state will be replaced by this new one.
Use reagirl.ToolbarButton_Unlink() to unlink the toolbar-button from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the toolbar-button that you want to link to an ini-value |
| string ini_file |
| the filename of the ini-file |
| string section |
| the section of the ini-file |
| string key |
| the key of the ini-file |
| string default |
| the default value, if the ini-file hasn't been set yet |
^
ToolbarButton_LinkToIntConfigVar
Lua: reagirl.ToolbarButton_LinkToIntConfigVar(string element_id, string configvar_name, boolean persist)
Links a toolbar-button to an integer configvar.
All changes to the configvar will be immediately visible for this toolbar-button.
Clicking the toolbar-button also updates the configvar-bit immediately.
Note: this will only allow integer config-vars. All others could cause malfunction of Reaper!
Read the Reaper Internals-docs for all available config-variables(run the action ultraschall_Help_Reaper_ConfigVars_Documentation.lua for more details)
If the toolbar-button was already linked to extstate or ini-file, the linked-state will be replaced by this new one.
Use reagirl.ToolbarButton_Unlink() to unlink the toolbarbutton from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the toolbar-button that shall toggle a config-var |
| string configvar_name |
| the config-variable, whose value you want to use |
| boolean persist |
| true, make this setting persist; false, make this setting only temporary until Reaper restart |
^
ToolbarButton_LinkToIntConfigVarBit
Lua: reagirl.ToolbarButton_LinkToIntConfigVarBit(string element_id, string configvar_name, integer bit, boolean persist)
Links a toolbar-button to a configvar-bit.
All changes to the configvar-bit will be immediately visible for this toolbar-button.
Clicking the toolbar-button also updates the configvar-bit immediately.
Note: this will only allow bitfield-integer config-vars. All others could cause malfunction of Reaper!
Read the Reaper Internals-docs for all available config-variables(run the action ultraschall_Help_Reaper_ConfigVars_Documentation.lua for more details)
If the toolbar-button was already linked to extstate or ini-file, the linked-state will be replaced by this new one.
Use reagirl.ToolbarButton_Unlink() to unlink the toolbarbutton from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the toolbar-button that shall toggle a config-var-bit |
| string configvar_name |
| the config-variable, whose bit you want to toggle |
| integer bit |
| the bit that shall be toggled; &1, &2, &4, &8, &16, etc |
| boolean persist |
| true, make this setting persist; false, make this setting only temporary until Reaper restart |
^
ToolbarButton_LinkToToggleState
Lua: reagirl.ToolbarButton_LinkToToggleState(string element_id, integer section, string command_id, boolean run_command)
Links a toolbar-button to a toggle-command-state of an action.
All changes to the toggle-state will be immediately visible for this toolbar-button.
Clicking the toolbar-button also updates the toggle-state immediately, which also updates existing toolbar-button-states.
You can set run_command=true, which will run the action everytime the toolbar-button is toggled.
This might be important to use, if the action behind the toggle-state needs to be run to change states in Reaper AND toggle the toggle-state as well.
Keep it at run_command=false, if you only want to change the toggle-state of the action without running it.
Note: some actions only change toggle-action, when they are run(like "Transport: Toggle repeat"). In these cases, the action will be run as well.
This shouldn't affect regular actions.
If the toolbar-button was already linked to a config-var or ini-file, the linked-state will be replaced by this new one.
Use reagirl.ToolbarButton_Unlink() to unlink the toolbar-button from extstate/ini-file/config var.
Parameters:
| string element_id |
| the guid of the toolbar-button, that you want to link to an extstate |
| integer section |
the section of the command, whose toggle state you want to link
0, Main
100, Main (alt recording)
32060, MIDI Editor
32061, MIDI Event List Editor
32062, MIDI Inline Editor
32063, Media Explorer |
| string command_id |
| the action command id of the command |
| boolean run_command |
| true, run the action to change the toggle-state; false, only change toggle-state(see note above!) |
^
ToolbarButton_SetColor
Lua: reagirl.ToolbarButton_SetColor(string element_id, integer r, integer g, integer b)
Sets the color of a toolbar-button.
Set r=nil to use default color.
Parameters:
| string element_id |
| the guid of the toolbar-button, whose color you want to set |
| optional integer r |
| the red-value of the color; 0-255; nil to use default |
| optional integer g |
| the green-value of the color; 0-255; will be ignored, if r=nil |
| optional integer b |
| the blue-value of the color; 0-255; will be ignored, if r=nil |
^
ToolbarButton_SetDropShadow
Lua: reagirl.ToolbarButton_SetDropShadow(string element_id, boolean has_drop_shadow)
Sets, if the image of the toolbar-button shall be drawn with a drop-shadow. This is helpful for images, that might not be correctly visible in either light or dark-theme or if conflicting colors are chosen by the user or the script.
Parameters:
| string element_id |
| the toolbarbutton-element, whose drop-shadow-state you want to set |
| boolean has_drop_shadow |
| true, drop-shadow is enabled for this toolbarbutton; false, drop-shadow is not enabled for this toolbarbutton |
^
ToolbarButton_SetEdgeStyle
Lua: reagirl.ToolbarButton_SetEdgeStyle(string element_id, boolean top_left_square, boolean top_right_square, boolean bottom_left_square, boolean bottom_right_square)
Sets, if the individual edges of a toolbar-button are rounded or square.
Parameters:
| string element_id |
| the guid of the toolbar-button, whose edge-styles you want to set |
| boolean top_left_square |
| true, edge is square; false, edge is rounded |
| boolean top_right_square |
| true, edge is square; false, edge is rounded |
| boolean bottom_left_square |
| true, edge is square; false, edge is rounded |
| boolean bottom_right_square |
| true, edge is square; false, edge is rounded |
^
ToolbarButton_SetRadius
Lua: reagirl.ToolbarButton_SetRadius(string element_id, integer radius)
Sets the radius of the edges of a toolbar-button.
Parameters:
| string element_id |
| the guid of the toolbar-button, whose radius you want to set |
| integer radius |
| the radius of the toolbar-button; between 0-14 |
^
ToolbarButton_SetState
Lua: boolean retval = reagirl.ToolbarButton_SetState(string element_id, integer state)
Sets the current state of the toolbar-button
Returnvalues:
| boolean retval |
| true, setting the state was successful; false, setting the state was not successful(i.e. state does not exist) |
Parameters:
| string element_id |
| the toolbarbutton-element, whose drop-shadow-state you want to set |
| integer state |
| 0 and higher, the state to set |
^
ToolbarButton_Unlink
Lua: reagirl.ToolbarButton_Unlink(string element_id)
Unlinks a toolbar-button from extstate/ini-file/configvar/toggle-state.
Parameters:
| string element_id |
| the guid of the toolbar-button that you want to unlink from extstates/ini-files/configvars |
^
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_GetSetSticky
Lua: boolean sticky_x, boolean sticky_y = reagirl.UI_Element_GetSetSticky(string element_id, boolean is_set, boolean sticky_x, boolean sticky_y)
gets/sets the stickiness of the ui-element.
Sticky-elements will not be moved by the global scrollbar-scrolling.
IMPORTANT:
Make sure that sticky elements are always visible by forcing a minimum width/height of the window
using reagirl.Window_ForceSize_Minimum().
Otherwise a ui-element might not be clickable, since it can't be scrolled to.
This would also affect blind users, as tabbing through ui-elements moves the mouse to the ui-element(so they can right-click context-menus),
which might be outside of the window and therefore the mouse would move to nowhere.
Also important: to prevent ui-element getting stuck behind sticky-ui-elements via scrolling/tabbing, use reagirl.Gui_GetSetStickyOffset() to
set offset that will move the ui-elements down/up accordingly
Returnvalues:
| boolean sticky_x |
| true, x-movement is sticky; false, x-movement isn't sticky |
| boolean sticky_y |
| true, y-movement is sticky; false, y-movement isn't sticky |
Parameters:
| string element_id |
| the id of the element, whose stickiness you want to get/set |
| boolean is_set |
| true, set the stickiness; false, only retrieve current stickiness of the ui-element |
| boolean sticky_x |
| true, x-movement is sticky; false, x-movement isn't sticky |
| boolean sticky_y |
| true, y-movement is sticky; false, y-movement isn't sticky |
^
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
string menu_selection_name - the name of the selected menu_entry
boolean menu_selection_checked - true, if the menu-selection-entry is checked; false, if not
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_DragOnEmptyArea
Lua: reagirl.Window_DragOnEmptyArea(boolean toggle)
Sets, if it's possible to drag around the window by clicking in empty areay, means inbetween ui-elements.
Helpful, when you have set the window to borderless.
Note: this can be overridden by the user in the ReaGirl-settings.
Parameters:
| boolean toggle |
| true, dragging the window is possible; false, dragging is only possible on the title-bar |
see also:
^
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_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_GetHWND
Lua: reagirl.Window_GetHWND()
Returns the hwnd-window-handler of the opened gui-window.
Returns nil if no window is opened.
^
Window_GetScrollOffset
Lua: integer horizontal_scrolloffs, integer vertical_scrolloffs = reagirl.Window_GetScrollOffset()
Gets the current scroll-offset of the window's gui.
Note: it is the unscaled value, which you can rely on on all scalings. But if you need to draw stuff yourself, you should multiply it with reagirl.Window_GetCurrentScale().
0,0 means, that the gui is scrolled to the top-left corner.
Returnvalues:
| integer horizontal_scrolloffs |
| the current horizontal scrolling-offset in pixels*scale |
| integer vertical_scrolloffs |
| the current vertival scrolling-offset in pixels*scale |
^
Window_ResizedFunc
Lua: reagirl.Window_ResizedFunc()
Adds a run-function that is always executed, when the window gets resized.
^
Window_SetBorderless
Lua: reagirl.Window_SetBorderless()
Sets the style of the window to borderless.
When applied, use reagirl.Window_DragOnEmptyArea() to make the window draggable by clicking into an empty area.
see also:
^
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 |
^
Window_SetFocus
Lua: reagirl.Window_SetFocus()
Sets window focus back to the ReaGirl-gui-window.
| | | Automatically generated by Ultraschall-API 5.3 - 216 elements available
|