GUIElement class, available in: Framsticks TheaterGUI elementThis class has 63 members:
sdleiF
Rectangle absolute_rectRect in screen coordinates
int alignAlignmentlabels: -1/0/1 means left/center/right, buttons and lists: 0/1 means horizontal/vertical
int autorepeat0 .. 1 (false/true)Autorepeat
int bgcolorBackground color
float border_marginImage border margin
untyped dataData
int enabledEnabledFor most elements: 0=readonly, 1=interaction/editing enabled
int feedbackFeedback
int fgcolorForeground color
int focus0 .. 1 (false/true)Has focus
int font0 .. 5
  • 0 = Small
  • 1 = Small bold
  • 2 = Standard
  • 3 = Big
  • 4 = Outline
  • 5 = Bold
  • Font
    untyped gui ROGUI contextGUIContext of this GUIElement
    GUIElement gui_owner ROGUI 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 ROGUI owner indexIndex of the list item element owning this GUIElement's GUIContext. Valid when gui_owner is a list.
    float heightHeight
    untyped imageImage
    int item_countNumber 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_displayList 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_layoutList 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 itemsList 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 maxMax value
    float minMin value
    Rectangle minimal_rect ROMinimal size
    int modeModeDrawing: 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 nameName
    Orient orient ROModel viewer orientation
    float page_hScroll page height
    float page_wScroll page width
    Rectangle rectPosition and dimensions
    float row_heightRow height
    float scroll_hScroll area height
    float scroll_wScroll area width
    float scroll_xScroll offset X
    float scroll_yScroll offset Y
    int selectedSelection state
    int styleStyleButton: 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_marginImage texture margin
    string textText
    string tooltipTooltip
    Transform transformTransformation
    untyped userdataUser data
    int valignVertical alignment-1/0/1 means top/center/bottom
    int visible0 .. 1 (false/true)Visible
    float widthWidth
    float xX coordinate
    float yY coordinate
    snoitcnuF
    function addItem(untyped data)returns intAdd list item
    function addTo(GUIElement parent)doesn't return a valueAdd as a child of another element
    function animSetBegin()doesn't return a valueSet animation starting configuration
    function animSetEnd()doesn't return a valueSet animation final configuration
    function edit(string characters)doesn't return a valueEdit textview
    function getItem(int index)returns untypedGet list item data
    function getItemGUI(int index)returns untypedGet list item GUIContextReturns null if the requested item is scrolled out of view.
    function getItemRect(int index)returns RectGet list item geometryReturns null if the requested item is scrolled out of view.
    function insertItem(int position, untyped data)returns intInsert list item
    function removeAllItems()doesn't return a valueRemove all list items
    function removeItem(int index)doesn't return a valueRemove list item
    function scrollIntoView(int index)doesn't return a valueMake 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 valueDefine automatic layoutrel_* values refer to the parent element's dimensions
    function setItem(int index, untyped data)doesn't return a valueModify list item
    function setPos(float x, float y)doesn't return a valueSet position
    function setRect(float x, float y, float width, float height)doesn't return a valueSet rectangle
    function startAnimation(float duration)doesn't return a valueStart animation
    Global context>>Experiment definition>>Command line interface>>Framsticks Theater