poison.ui.component
Source
Module for a component.
Authors:
Jacob Jensen
License:
https://github.com/PoisonEngine/poison-ui/blob/master/LICENSE
Imports
std.algorithm : filter
std.array : array
std.concurrency : thisTid
poison.ui.space
poison.core : ActionArgs, Point, Size, EventArgs, ChangeEventArgs, executeUI, isUIThread, CrossThreadingExeption
poison.ui.window
poison.ui.graphics
poison.ui.paint
poison.ui.picture
poison.ui.container
public dsfml.graphics : RenderWindow
poison.ui.styles
public:
protected:
public:
public class Component : Space
protected:
public:
A component, which is the base for all controls and elements.
protected this(string name, Size initialSize);
Creates a new component.
Parameters:
name The name of the component.
initialSize The initial size of the component.
protected this(string name);
Creates a new component.
Parameters:
name The name of the component.
protected void render();
Renders the component. Override this!
protected void draw(RenderWindow window);
Draws the component. Override this!
Parameters:
window The window to draw the component to.
protected void process(RenderWindow window);
Processes the component during application cycles.
Parameters:
window The render window to process.
public @property string name();
Gets the name of the component.
public @property bool enabled();
Gets a boolean determining whether the component is enabled or not.
public @property void enabled(bool isEnabled);
Sets a boolean determining whether the component is enabled or not.
public @property bool disabled();
Gets a boolean determining whether the component is disabled or not.
public @property void disabled(bool isDisabled);
Sets a boolean determining whether the component is disabled.
public @property bool visible();
Gets a boolean determining whether the component is visible or not.
public @property void visible(bool isVisible);
Sets a boolean determining whether the component is visible or not.
public @property bool hidden();
Gets a boolean determining whether the component is hidden or not.
public @property void hidden(bool isHidden);
Sets a boolean determining whether the component is hidden or not.
public @property dstring innerText();
Gets the inner text of the component.
public @property void innerText(dstring newInnerText);
Sets the inner text of the component.
public @property dstring outerText();
Gets the outer text of the component.
public @property void outerText(dstring newOuterText);
Sets the outer text of the component.
public @property ptrdiff_t layer();
Gets the layer of the component.
public void show();
Shows the component.
public void hide();
Hides the component.
public void enable();
Enables the component.
public void disable();
Disables the component.
public void addSelector(string selector);
Adds a style selector.
Parameters:
selector The selector to add.
public void removeSelector(string selector);
Removes a style selector.
public override bool intersect(Point p);
Checks whether the component intersects with a point.
Parameters:
p The point to check for intersection with.
Returns:
True if the component intersects with a point.
public override bool intersect(Space target);
Checks whether the component intersects with another space.
Parameters:
target The space to check for intersection with.
Returns:
True if the component intersects with a space.
Generated by venom - Poison Engine's Documentation Generator
Module for a component.
Authors:
Jacob JensenLicense:
https://github.com/PoisonEngine/poison-ui/blob/master/LICENSEImports
std.algorithm : filterstd.array : array
std.concurrency : thisTid
poison.ui.space
poison.core : ActionArgs, Point, Size, EventArgs, ChangeEventArgs, executeUI, isUIThread, CrossThreadingExeption
poison.ui.window
poison.ui.graphics
poison.ui.paint
poison.ui.picture
poison.ui.container
public dsfml.graphics : RenderWindow
poison.ui.styles
public class Component : Space
protected:
public:
A component, which is the base for all controls and elements.
protected this(string name, Size initialSize);
Creates a new component.
Parameters:
name | The name of the component. |
initialSize | The initial size of the component. |
protected this(string name);
Creates a new component.
Parameters:
name | The name of the component. |
protected void render();
Renders the component. Override this!
protected void draw(RenderWindow window);
Draws the component. Override this!
Parameters:
window | The window to draw the component to. |
protected void process(RenderWindow window);
Processes the component during application cycles.
Parameters:
window | The render window to process. |
public @property string name();
Gets the name of the component.
public @property bool enabled();
Gets a boolean determining whether the component is enabled or not.
public @property void enabled(bool isEnabled);
Sets a boolean determining whether the component is enabled or not.
public @property bool disabled();
Gets a boolean determining whether the component is disabled or not.
public @property void disabled(bool isDisabled);
Sets a boolean determining whether the component is disabled.
public @property bool visible();
Gets a boolean determining whether the component is visible or not.
public @property void visible(bool isVisible);
Sets a boolean determining whether the component is visible or not.
public @property bool hidden();
Gets a boolean determining whether the component is hidden or not.
public @property void hidden(bool isHidden);
Sets a boolean determining whether the component is hidden or not.
public @property dstring innerText();
Gets the inner text of the component.
public @property void innerText(dstring newInnerText);
Sets the inner text of the component.
public @property dstring outerText();
Gets the outer text of the component.
public @property void outerText(dstring newOuterText);
Sets the outer text of the component.
public @property ptrdiff_t layer();
Gets the layer of the component.
public void show();
Shows the component.
public void hide();
Hides the component.
public void enable();
Enables the component.
public void disable();
Disables the component.
public void addSelector(string selector);
Adds a style selector.
Parameters:
selector | The selector to add. |
public void removeSelector(string selector);
Removes a style selector.
public override bool intersect(Point p);
Checks whether the component intersects with a point.
Parameters:
p | The point to check for intersection with. |
Returns:
True if the component intersects with a point.public override bool intersect(Space target);
Checks whether the component intersects with another space.
Parameters:
target | The space to check for intersection with. |