-
Notifications
You must be signed in to change notification settings - Fork 4
Elements
Elements are defined inside xml files like ".xeyegui" for Layouts or ".beyegui" for Bricks. All elements can have following attributes:
| Attribute | Type | Description |
|---|---|---|
| id | string | Unique id to fetch element from C++ side |
| style | string | Name of style used for this element and its children |
| relativescale | percent | Relative scaling of element |
| border | percent | Space between this element and border of provided space |
| dimming | bool | true if element should dim or false if not |
| adaptivescaling | bool | true if element should use adaptive scaling or false if not |
Additional attributes are listed for each element below. Another way to create elements is to call a replacement by id function of the interface. Those calls are straightforward and are not described here in more detail.
Placeholder element which is created when a grid cell is undefined or could be used by one if it should be replaced by another element or brick at runtime.
Example:
<blank id="placeholder"></blank>Simple element to display images in the layout.
| Attribute | Type | Description |
|---|---|---|
| src | string | Relative path to displayed image (png, tga, bmp, jpg or svg) like "Images/Lena.png" |
| alignment | string | original, stretched or zoomed |
Example:
<picture id="portrait" alignment="stretched" src="Images/Lena.png"></picture>Block of solid color. Using background color from chosen style, please take a look at Styling for more details. With default styling, a block is invisible.
| Attribute | Type | Description |
|---|---|---|
| consumeinput | bool | true if block should consume input or false if not |
| backgroundsrc | string | Relative path to displayed image (png, tga, bmp, jpg or svg) like "Images/Lena.png". If empty, no background image is used |
| backgroundalignment | string | original, stretched or zoomed |
Example:
<block style="blocky"></block>Block to display text. Content can be directly defined in an attribute or a key is used, that maps to a localization entry in the used localization file. Take a look at Localization.
| Attribute | Type | Description |
|---|---|---|
| consumeinput | bool | true if block should consume input or false if not |
| innerborder | percent | Space between text block border and the text |
| fontsize | string | medium, tall and small are available |
| alignment | string | left, right, center or justify |
| verticalalignment | string | top, center or bottom |
| textscale | percent | Scale of text |
| backgroundsrc | string | Relative path to displayed image (png, tga, bmp, jpg or svg) like "Images/Lena.png". If empty, no background image is used |
| backgroundalignment | string | original, stretched or zoomed |
| content | string | UTF-8 string as fallback content when key does not help |
| key | string | Key searched in localization file to replace fallback content with its entry |
Example:
<textblock alignment="center" verticalalignment="center" fontsize="small" content="Lorem ipsum"></textblock>Structure to place multiple elements inside a frame. Cells are defined by rows and columns sized using relative scales in percent of available space. Each row can have free count of columns. Size attributes per row and columns are mandatory and must sum to 100% for each row's columns and for the rows itself.
| Attribute | Type | Description |
|---|---|---|
| consumeinput | bool | true if grid background should consume input or false if not |
| innerborder | percent | Space between grid border and inner elements |
| showbackground | bool | true if background should be rendered or false if not |
| backgroundsrc | string | Relative path to displayed image (png, tga, bmp, jpg or svg) like "Images/Lena.png". If empty, no background image is used |
| backgroundalignment | string | original, stretched or zoomed |
Example:
<grid>
<row size="40%">
<column size="100%">
<block style="red"></block>
</column>
</row>
<row size="60%">
<column size="100%">
<block style="blue"></block>
</column>
</row>
</grid>Structure to stack free number of elements in one row. Orientation of stack is determined automatically to make use of most available space.
| Attribute | Type | Description |
|---|---|---|
| consumeinput | bool | true if stack background should consume input or false if not |
| innerborder | percent | Space between stack border and stacked elements |
| showbackground | bool | true if background should be rendered or false if not |
| relativescaling | string | mainaxis limits influence of relative scaling only to the main axis of the stack, bothaxes let it impact both dimensions |
| alignment | string | fill, center, head or tail are available |
| padding | percent | Usage of available space as padding between stacked elements |
| separator | percent | Usage of available space as visible separator between stacked elements |
| backgroundsrc | string | Relative path to displayed image (png, tga, bmp, jpg or svg) like "Images/Lena.png". If empty, no background image is used |
| backgroundalignment | string | original, stretched or zoomed |
Example:
<stack alignment="center">
<circlebutton></circlebutton>
<circlebutton></circlebutton>
<picture src="Images/Dog.png"></picture>
</stack>Elements which react to input and which can notify listeners are called interactive elements. For more detail about notifications, take a look at Notifications.
Interactive element which is penetrated when the mouse or the gaze is upon it.
| Attribute | Type | Description |
|---|---|---|
| icon | string | Relative path to displayed icon (png or svg) like "Icons/Arrow.svg" |
Example:
<sensor id="scroll_up"></sensor>Button in shape of a circle.
| Attribute | Type | Description |
|---|---|---|
| icon | string | Relative path to displayed icon (png or svg) like "Icons/Arrow.svg" |
| switch | bool | true if button should be a switch or false if button should go up by itself |
Example:
<circlebutton id="settings"></circlebutton >Button in shape of a box.
| Attribute | Type | Description |
|---|---|---|
| icon | string | Relative path to displayed icon (png or svg) like "Icons/Arrow.svg" |
| switch | bool | true if button should be a switch or false if button should go up by itself |
Example:
<boxbutton id="mode" switch="true"></boxbutton >Box button which summons drop down menu when pressed. Drop down menu is defined by single inner element.
| Attribute | Type | Description |
|---|---|---|
| icon | string | Relative path to displayed icon (png or svg) like "Icons/Arrow.svg" |
| space | percent | Usage of available space for inner element in frame |
Example:
<dropbutton space="50%">
<circlebutton></circlebutton>
</dropbutton>Since the keyboard is a more complex element, one can found the documentation on an extra page Keyboard. Although it is an interactive element, it does not support selection and simple interaction, yet.