83 void draw(NVGcontext* vg,
float x,
float y,
float width,
float height,
Style style,
FrameContext* ctx)
override;
139 virtual void setPadding(
float top,
float right,
float bottom,
float left);
296 std::vector<View*> children;
298 size_t defaultFocusedIndex = 0;
299 View* lastFocusedView =
nullptr;
301 std::unordered_map<std::string, std::pair<std::string, View*>> forwardedAttributes;
Generic FlexBox layout.
Definition box.hpp:74
void onParentFocusLost(View *focusedView) override
virtual void onChildFocusGained(View *directChild, View *focusedView)
void setDirection(Direction direction)
void setColumnGap(float gap)
void inflateFromXMLElement(tinyxml2::XMLElement *element)
virtual void setPadding(float padding)
void handleXMLElement(tinyxml2::XMLElement *element) override
View * getLastFocusedView() const
See setLastFocusedView().
void willDisappear(bool resetState) override
View * getNextFocus(FocusDirection direction, View *currentView) override
void onParentFocusGained(View *focusedView) override
virtual void setPaddingRight(float right)
void setDefaultFocusedIndex(int index)
The child that takes the focus first (negative values are ignored).
void setJustifyContent(JustifyContent justify)
void forwardXMLAttribute(std::string attributeName, View *target, std::string targetAttributeName)
void onFocusGained() override
virtual void removeView(View *view, bool free=true)
void onWindowSizeChanged() override
void setAlignItems(AlignItems alignment)
virtual void addView(View *view)
std::vector< View * > & getChildren()
The children, in order. The box owns them: it deletes them with itself.
virtual void clearViews(bool free=true)
bool applyXMLAttribute(std::string name, std::string value) override
virtual View * getParentNavigationDecision(View *from, View *newFocus, FocusDirection direction)
virtual void onChildFocusLost(View *directChild, View *focusedView)
virtual void setPaddingLeft(float left)
Box(Axis flexDirection)
An empty box laying its children out along flexDirection.
void setAxis(Axis axis)
The axis the children are laid out along.
virtual void setGap(float gap)
void onFocusLost() override
virtual void setPaddingTop(float top)
void setRowGap(float gap)
size_t getDefaultFocusedIndex() const
void inflateFromXMLString(std::string_view xml)
virtual void getCullingBounds(float *top, float *right, float *bottom, float *left)
~Box()
Deletes the children (those a ptrLock() holds go to the deletion pool).
void inflateFromXMLRes(const std::string &res)
void willAppear(bool resetState) override
void inflateFromXMLFile(const std::string &path)
virtual bool isChildFocused()
Whether the focus is on one of the children, at any depth.
virtual void addView(View *view, size_t position)
virtual void setPadding(float top, float right, float bottom, float left)
View * getView(std::string id) override
virtual void setPaddingBottom(float bottom)
std::string getDefaultAccessibilityLabel() override
A focusable box says the texts shown in it (getAccessibilityText).
void setLastFocusedView(View *view)
The child the focus goes back to when the box gets it again.
View * getDefaultFocus() override
void draw(NVGcontext *vg, float x, float y, float width, float height, Style style, FrameContext *ctx) override
void forwardXMLAttribute(std::string attributeName, View *target)
View * hitTest(Point point) override
void onThemeChanged() override
Definition frame_context.hpp:30
void draw(NVGcontext *vg, float x, float y, float width, float height, Style style, FrameContext *ctx) override
Simple wrapper around StyleValues for the array operator.
Definition style.hpp:115
Definition actions.hpp:25
Direction
The writing direction a box lays its children out in.
Definition box.hpp:66
JustifyContent
How a box spreads its children along its axis (justifyContent in XML).
Definition box.hpp:27
FocusDirection
Focus direction when navigating.
Definition view.hpp:96
Wrap
Whether a box's children go on to new lines when they do not fit (flexWrap).
Definition box.hpp:58
AlignItems
How a box places its children across its axis (alignItems in XML).
Definition box.hpp:38
Axis
The direction a box lays its children out in (axis in XML).
Definition box.hpp:51
Definition geometry.hpp:26