Automatically generated documentation for GR2 SVS wrapper, follows markdown syntax.
Constant | Value | Meaning |
---|---|---|
EV_PRESSED | 1 | Event: pressed |
EV_RELEASED | 3 | Event: released |
EV_HOLD | 2 | Event: hold |
EV_NONE | 0 | Event: none |
Constant | Value | Meaning |
---|---|---|
COL_BORDER | 1 | Color: Border |
COL_TEXT | 2 | Color: Text |
COL_BACKGROUND | 3 | Color: Background |
COL_FILL | 4 | Color: Fill |
COL_ACTIVE | 5 | Color: active |
Constant | Value | Meaning |
---|---|---|
ALIGN_LEFT | 5 | Text align: Left |
ALIGN_RIGHT | 5 | Text align: Right |
ALIGN_CENTER | 5 | Text align: Center |
sys.gui.addScreen();
or also sys.gui.addScreen([num]x1, [num]y1, [num]x2, [num]y2, [num]scrId); Creates new screen.
Return: [num]scrId
sys.gui.addFrame([num]x1, [num]y1, [num]x2, [num]y2, [num]value, [num]scrId);
Creates new pscg frame. Value contains id of screen inside frame.
Return: [num]elementId
sys.gui.addText([num]x1, [num]y1, [num]x2, [num]y2, [str]str, [num]scrId);
Adds a new text field.
Return: [num]id
sys.gui.addButton([num]x1, [num]y1, [num]x2, [num]y2, [str]str, [num]scrId);
Creates new button.
Return: [num]id
sys.gui.addCButton([num]x1, [num]y1, [num]x2, [num]y2, [str]str, [num]scrId);
Adds color button, color is stored in its value.
Return: [num]id
sys.gui.addCheckBox([num]x1, [num]y1, [num]x2, [num]y2, [str]str, [num]scrId);
Creates new checkbox. Checkbox state is stored in its value.
Return: [num]id
sys.gui.addIcon([num]x1, [num]y1, [num]x2, [num]y2, [str]description, [str]image, [num]scrId);
Adds icon. Image must be a file in current working directory. Optimal resolution is 64x64px. Icon will try to accomodate given space by scaling itself. use sys.gui.setTxtAlign to change position of the description box. When parameter of icon element is not zero, color of value param - 1 (16bit RGB565) is drawn as transparent.
Return: [num]id
sys.gui.setIcon([num]id, [str]image);
Sets image for given icon. Image must be a file in current working directory, with resolution 64x64px. When parameter of icon element is not zero, color of value param - 1 (16bit RGB565) is drawn as transparent.
Return: none
sys.gui.addImage([num]x1, [num]y1, [num]x2, [num]y2, [str]fname, [num]scrId);
Creates new image (ppm or p16) container. Name of image is stored in str_value Size attribute is stored in value, (one by default) Color of value param - 1 (16bit RGB565) is drawn as transparent.
Return: [num]id
sys.gui.addSliderV([num]x1, [num]y1, [num]x2, [num]y2, [num]howMuchOverall, [num]howMuch, [num]scrId);
Adds a new vertical slider.
Return: [num]id
sys.gui.addSliderH([num]x1, [num]y1, [num]x2, [num]y2, [num]howMuchOverall, [num]howMuch, [num]scrId);
Adds a new horizontal slider.
Return: [num]id
sys.gui.addBar([num]x1, [num]y1, [num]x2, [num]y2, [num]howMuchOverall, [num]howMuch, [num]scrId);
Adds progress bar. Orientation depends on its dimensions.
Return: [num]id
sys.gui.destroy([num]id);
Destroys element with given id.
Return: none
sys.gui.setModif([num]Id);
Sets modified flag of an element. Return: None
sys.gui.getValue([num]Id);
Gets value of gr2 element.
Return: [num]value
sys.gui.setValue([num]Id, [num]value);
Sets value of pscg item.
Return: None
sys.gui.getParam([num]Id);
Gets elements parameter value.
Return: [num]param
sys.gui.setParam([num]Id, [num]value);
Sets elements parameter value. Return: None
sys.gui.getEvent([num]Id);
Gets event from an element.
Return: [num] event value, one of EV_ defines.
sys.gui.getEventC([num]Id);
Gets event from an element and clears the event.
Return: [num] event value, one of EV_ defines.
sys.gui.setEvent([num]Id, [num] event);
Sets event of an element.
Return: None
sys.gui.clrScrEv([num]Id);
Clears event for whole screen and its sub-screens.
Return: None
sys.gui.setScreen([num]Id, [num]screenId);
Sets element screen parameter.
Return: None
sys.gui.getGrayout([num]Id);
Gets element grayout.
Return: [num] grayout, 1 if element is grey, 0 if it is normal
sys.gui.setGrayout([num]Id, [num]grayout);
Sets element grayout.
Return: None
sys.gui.getVisible([num]Id);
Gets element visibility.
Return: [num] visibility
sys.gui.setVisible([num]Id, [num]visibility);
Sets element visibility.
Return: None
When ghost i s enabled, only button text and its outline is drawn.
sys.gui.getGhost([num]Id);
Gets element ghost parameter.
Return: [num] isGhost
sys.gui.setGhost([num]Id, [num]ghost);
Sets element ghost parameter.
Return: None
sys.gui.getSelect([num]Id);
Gets element selected parameter.
Return: [num] isSelected
sys.gui.setSelect([num]Id, [num]select);
Sets element select parameter.
Return: None
sys.gui.setSliderSize([num]Id, [num]val);
Sets size of slider in pixels.
Return: None
sys.gui.setRounded([num]Id, [num]rounded);
Sets element rounded parameter.
Return: None
sys.gui.getStr([num]Id);
Gets element value_str parameter.
Return: [str]str
sys.gui.setStr([num]Id, [str]str);
Sets element value_str parameter.
Return: None
sys.gui.getBtnSel([num]screenId);
Gets element selected by the keypad input method from the given screen.
Return: [num] Id if something is selected, otherwise 0
sys.gui.setRelInit([num]val);
Sets aplication gr2 context to relative init mode. In relative init mode the x2 parameter is used as element width and the y2 as element height.
Return: None
sys.gui.setRndInit([num]val);
Sets aplication gr2 context rounded init mode. In rounded init mode all elements are initialized as rounded type.
Return: None
sys.gui.setXYXY([num]Id, [num] x1, [num] y1, [num] x2, [num] y2);
Sets position of element inside screen.
Return: None
sys.gui.setX1([num]Id, [num] x1);
Sets position of element inside screen.
Return: None
sys.gui.setX2([num]Id, [num] x2);
Sets position of element inside screen.
Return: None
sys.gui.setY1([num]Id, [num] y1);
Sets position of element inside screen.
Return: None
sys.gui.setY2([num]Id, [num] y2);
Sets position of element inside screen.
Return: None
sys.gui.getX1([num]Id);
Gets element position.
Return: [num] x1
sys.gui.getX2([num]Id);
Gets element position.
Return: [num] x2
sys.gui.getY1([num]Id);
Gets element position.
Return: [num] y1
sys.gui.getY2([num]Id);
Gets element position.
Return: [num] y2
sys.gui.setSpacing([num]Id, [num] left, [num] right, [num] top, [num] bottom);
Sets element spacing atributes of given screen.
Return: None
sys.gui.setXcell([num]screenId, [num] Xcell);
Sets screen Xcell parameter. (32 by default)
Return: None
sys.gui.getXcell([num]screenId);
Gets screen Xcell parameter.
Return: [num] Xcell
sys.gui.setYcell([num]screenId, [num] Ycell);
Sets screen Ycell parameter. (32 by default)
Return: None
sys.gui.getYcell([num]screenId);
Gets screen Ycell parameter.
Return: [num] Ycell
sys.gui.setXscroll([num]screenId, [num]Xscroll);
Sets Xscroll parameter. Determines screen horizontal offset.
Return: None
sys.gui.getXscroll([num]screenId);
Gets screen Xscroll.
Return: [num] Xscroll
sys.gui.setYscroll([num]screenId, [num]Yscroll);
Sets Yscroll parameter. Determines screen vertical offset.
Return: None
sys.gui.getYscroll([num]screenId);
Gets Yscroll parameter.
Return: [num] Yscroll
sys.gui.setColor([num]Col, [num]val);
Sets given color to given value (16bit RGB565). Available system colors: COL_BORDER, COL_TEXT, COL_BACKGROUND, COL_FILL, COL_ACTIVE
Return: None
sys.gui.getColor([num]Col);
Gets value of given color define. Available system colors: COL_BORDER, COL_TEXT, COL_BACKGROUND, COL_FILL, COL_ACTIVE
Return: [num]val
Functions that works on all elements that display text.
sys.gui.setTxtSize([num]Id, [num]val);
Sets size of text inside buttons or text fields. Possible values are those used by LCD_Set_Sys_Font By default they are: 12, 18 (default), 32, 70, 87
Return: None
sys.gui.getTxtSize([num]Id);
Gets size of text inside buttons or text fields.
Return: [num] font_size
sys.gui.setTxtAlign([num]Id, [num]val);
sys.gui.setTexAlign([num]Id, [num]val); # TBR
Sets text alignment. (uses consts: ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER)
Return: None
sys.gui.getTxtAlign([num]Id);
sys.gui.getTexAlign([num]Id); # TBR
Gets text alignment.
Return: [num]alignment (uses consts: ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER)
sys.gui.defTxtSize([num]screenId, [num] val);
sys.gui.setDefFont([num]screenId, [num] val); # TBR
Sets defalt screen text size.
Return: None
Functions that work only on text element.
sys.gui.setTxtPwd([num]Id, [num]val);
sys.gui.setTexPwd([num]Id, [num]val); # TBR
Sets text field as password field. Draws stars instead of characters.
Return: None
sys.gui.getTxtPwd([num]Id);
sys.gui.getTexPwd([num]Id); # TBR
Gets if text field is a password field.
Return: [num]isPassword
sys.gui.setTxtFit([num]Id, [num]val);
sys.gui.setTexFit([num]Id, [num]val); # TBR
Sets automatic line-breaking. val: 1 - enabled, 0 - disabled Position of first line break is stored in the parameter.
Return: None
sys.gui.setTxtEd([num]Id, [num]val);
sys.gui.setTexEd([num]Id, [num]val); # TBR
Sets text field as editable.
Return: None
sys.gui.setTxtAct([num]Id);
sys.gui.setTexAct([num]Id); # TBR
Sets given editable text field as currently active.
Return: None
sys.gui.getTxtAct([num]Id);
sys.gui.getTexAct([num]Id);
Gets if given editable text field is currently active.
Return: [num]isActive
sys.gui.txtDeact();
sys.gui.texDeact(); # TBR
Deactivates currently active text field.
Return: None
sys.gui.setTxtBlk([num]Id, [num]val);
sys.gui.setTexBlk([num]Id, [num]val); # TBR
Enables block selection in a text field. This is enabled by default, so it's mainly for disabling block mode.
Return: None
sys.gui.setBlk([num] id, [num] start, [num] stop);
Sets start and stop of a block in active text field
Return: None
sys.gui.getBlkStart([num] id);
Gets text field block start.
Return: [num] block_start
sys.gui.getBlkEnd([num] id);
Gets text field block end.
Return: [num] block_end