GGDocument class
#include <GGUI/Public/UIDocument.h>
The document inside a ui.Document, kept by whoever shows it. Used on the parent's UI update thread only. Not shown, it keeps what it built; destroyed, it leaves the parent.
Constructors, destructors, conversion operators
- GGDocument()
- Nothing inside until it is first shown.
- ~GGDocument()
- Leaves the parent showing it, if one does.
- GGDocument(const GGDocument&) deleted
Public functions
- auto operator=(const GGDocument&) -> GGDocument& deleted
- auto Inside() const -> UIContext*
- The document inside. Null until it is first shown.
- auto IsShown() const -> bool
- True while a ui.Document shows it.
- auto Hit(float x, float y) const -> NodeHandle
- The node of the document inside at (
x,y), in units from its box's top left corner (PointerEvent::LocalX, LocalY on the box). Null if nothing of it is there. - auto Bounds(NodeHandle node) const -> GGRect
- Where
nodeof the document inside is drawn, in units from its box's top left corner. - auto Dispatch(const InputEvent& event) -> bool
- Give the document inside an input, as its own window would: a pointer at (X, Y) in units from its box's top left corner.
- void FromInside(float x, float y, float& boxX, float& boxY) const
- Where its box draws a point of the document inside, given in the inside's units. Transforms of the document's own elements aside.
- void ToInside(float boxX, float boxY, float& x, float& y) const
- A point of the box, in the inside's units: the inverse of FromInside.
- auto ScreenWidth() const -> float
- The width of the screen it is laid out on, in its own UI units.
- auto ScreenHeight() const -> float
- The height of the screen it is laid out on, in its own UI units.
- auto Zoom() const -> float
- How much smaller (below 1) or bigger it is drawn than it is laid out.
- auto Shown() const -> const GGRevision&
- Moves when what it shows changes, or where it is drawn: what is drawn over it follows it.
Function documentation
bool GGUI:: GGDocument:: Dispatch(const InputEvent& event)
Give the document inside an input, as its own window would: a pointer at (X, Y) in units from its box's top left corner.
Its document doesn't pass input in by itself, so a tool decides when the inside is used (a designer's preview, played). False if it isn't shown.