75 lines
1.8 KiB
Markdown
75 lines
1.8 KiB
Markdown
# UIComponent.y
|
|
|
|
[← UIComponent](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 2/7 · [önceki](y.md) · [sonraki](y-3.md)
|
|
|
|
Set a tooltip that will be displayed at specified side of component's frame.
|
|
|
|
// Assuming that uiContext is a IMappetUIContext
|
|
uiContext.get("component").tooltip("Enter your full name", 1);
|
|
|
|
|
|
Parameters:
|
|
direction - 0 is bottom. 1 is top. 2 is right. 3 is left.
|
|
|
|
visible
|
|
|
|
public UIComponent visible(boolean visible)
|
|
|
|
Set component's visibility. Hiding components also disables any user input, i.e. despite button being
|
|
invisible, it can't be clicked.
|
|
|
|
// Assuming that uiContext is a IMappetUIContext
|
|
uiContext.get("button").visible(false);
|
|
|
|
|
|
enabled
|
|
|
|
public UIComponent enabled(boolean enabled)
|
|
|
|
Toggle component's user input. When the component is disabled, it can't receive any user input: no
|
|
inputting text into or focusing textbox and textareas, no clicking on click area, icon button, or button, etc.
|
|
|
|
// Assuming that uiContext is a IMappetUIContext
|
|
uiContext.get("button").enabled(false);
|
|
|
|
|
|
margin
|
|
|
|
public UIComponent margin(int margin)
|
|
|
|
Set margin to all sides.
|
|
|
|
IMPORTANT: margins affect positioning only within layout component. They do absolutely nothing
|
|
outside of column, row and grid layout components.
|
|
|
|
// Assuming that uiContext is a IMappetUIContext
|
|
uiContext.get("button").margin(10);
|
|
|
|
|
|
marginTop
|
|
|
|
public UIComponent marginTop(int margin)
|
|
|
|
Set top margin. See margin(int) method for more information about restrictions.
|
|
|
|
marginBottom
|
|
|
|
public UIComponent marginBottom(int margin)
|
|
|
|
Set bottom margin. See margin(int) method for more information about restrictions.
|
|
|
|
|
|
|
|
marginLeft
|
|
|
|
public UIComponent marginLeft(int margin)
|
|
|
|
Set left margin. See margin(int) method for more information about restrictions.
|
|
|
|
marginRight
|
|
|
|
public UIComponent marginRight(int margin)
|
|
|