sdleiF | ||
Rectangle absolute_rect | Rect in screen coordinates | |
int align | Alignmentlabels: -1/0/1 means left/center/right, buttons and lists: 0/1 means horizontal/vertical | |
int autorepeat0 .. 1 (false/true) | Autorepeat | |
int bgcolor | Background color | |
float border_margin | Image border margin | |
untyped data | Data | |
int enabled | EnabledFor most elements: 0=readonly, 1=interaction/editing enabled | |
int feedback | Feedback | |
int fgcolor | Foreground color | |
int focus0 .. 1 (false/true) | Has focus | |
int font0 .. 5 | Font | |
untyped gui RO | GUI contextGUIContext of this GUIElement | |
GUIElement gui_owner RO | GUI ownerGUIElement that owns this GUIElement's GUIContext. Multiple GUI context are currently only used for list items, with each item creating independent GUI namespace. Example: function onGUIEvent(elem, arg) { Simulator.print("clicked "+elem.name); Simulator.print("inside item #"+elem.gui_owner_item+" in the list "+elem.gui_owner.name); } | |
int gui_owner_item RO | GUI owner indexIndex of the list item element owning this GUIElement's GUIContext. Valid when gui_owner is a list. | |
float height | Height | |
untyped image | Image | |
int item_count | Number of itemsNumber of items is readonly for Vector lists (reflects the current Vector size). The number of items in the Callback list must be set explicitly. Setting the item_count must be the last stage of setting up a callback list because it triggers the refresh (and is the only list property that does so). Example: GUI->list.items=function listfun; GUI->list.item_count=1000; function listfun(i) {return "Item #"+i;} | |
untyped item_display | List item display functionCalled when the list item is constructed or updated. Use GUI.newXXX() to add the desired GUI elements for the item. List items are reused, check if the element already exists before adding. Example: function myDisplay(list_element,list_index) { if (!GUI->mylabel) GUI.newLabel("mylabel",); GUI->mylabel.text=list_element.getItem(list_index); } | |
untyped item_layout | List item layout functionCalled when the list item is resized (this happens after item_display). Place your elements inside the area defined by GUI.rect Example: function myLayout(list_element,list_index) { GUI->mylabel.rect=GUI.rect; } | |
untyped items | List itemsList items can be defined by a Vector object or callback function (returning item for index). Item can be any object. Built-in display function supports string and Vector items. Example: GUI->list.addItem("string item"); GUI->list.addItem(["item text","picture"]); | |
float max | Max value | |
float min | Min value | |
Rectangle minimal_rect RO | Minimal size | |
int mode | ModeDrawing: 0..6 = GL modes (GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_POINTS) Image: 0=Normal, 1=Border, 2=EmptyBorder, 3=HorizBorder, 4=VertBorder, 5=Tile Textview: 0=plain text, 1=HTML, 2=plain text displaying cursor even when readonly Model: (bitfield) 1=display grid, 2=display neural network | |
string name | Name | |
Orient orient RO | Model viewer orientation | |
float page_h | Scroll page height | |
float page_w | Scroll page width | |
Rectangle rect | Position and dimensions | |
float row_height | Row height | |
float scroll_h | Scroll area height | |
float scroll_w | Scroll area width | |
float scroll_x | Scroll offset X | |
float scroll_y | Scroll offset Y | |
int selected | Selection state | |
int style | StyleButton: 0=regular, 1=borderless List: 0=regular, 1=invisible selection Textfield: 0=dark border, 1=bright borderModel: 0=no shadow, 1=with shadow | |
float tex_margin | Image texture margin | |
string text | Text | |
string tooltip | Tooltip | |
Transform transform | Transformation | |
untyped userdata | User data | |
int valign | Vertical alignment-1/0/1 means top/center/bottom | |
int visible0 .. 1 (false/true) | Visible | |
float width | Width | |
float x | X coordinate | |
float y | Y coordinate | |
snoitcnuF | ||
function addItem(untyped data)returns int | Add list item | |
function addTo(GUIElement parent)doesn't return a value | Add as a child of another element | |
function animSetBegin()doesn't return a value | Set animation starting configuration | |
function animSetEnd()doesn't return a value | Set animation final configuration | |
function edit(string characters)doesn't return a value | Edit textview | |
function getItem(int index)returns untyped | Get list item data | |
function getItemGUI(int index)returns untyped | Get list item GUIContextReturns null if the requested item is scrolled out of view. | |
function getItemRect(int index)returns Rect | Get list item geometryReturns null if the requested item is scrolled out of view. | |
function insertItem(int position, untyped data)returns int | Insert list item | |
function removeAllItems()doesn't return a value | Remove all list items | |
function removeItem(int index)doesn't return a value | Remove list item | |
function scrollIntoView(int index)doesn't return a value | Make list item visible | |
function setAutolayout(float x, float y, float width, float height, float rel_x, float rel_y, float rel_width, float)doesn't return a value | Define automatic layoutrel_* values refer to the parent element's dimensions | |
function setItem(int index, untyped data)doesn't return a value | Modify list item | |
function setPos(float x, float y)doesn't return a value | Set position | |
function setRect(float x, float y, float width, float height)doesn't return a value | Set rectangle | |
function startAnimation(float duration)doesn't return a value | Start animation |
Global context | >> | Experiment definition | >> | Command line interface | >> | Framsticks Theater |