11#include <unordered_map>
40 static constexpr int32_t ANCHOR_NOT_ENABLED = -1;
44 int32_t topAnchor = ANCHOR_NOT_ENABLED;
45 int32_t rightAnchor = ANCHOR_NOT_ENABLED;
46 int32_t bottomAnchor = ANCHOR_NOT_ENABLED;
47 int32_t leftAnchor = ANCHOR_NOT_ENABLED;
53 bool isHorizontalRelative =
false;
54 bool isVerticalRelative =
false;
61 bool hasConstraints(
Component* child)
const;
63 void setHorizontalRelativePositioning(
Component* child,
bool enabled);
64 void setVerticalRelativePositioning(
Component* child,
bool enabled);
66 bool isHorizontalRelativePositioning(
Component* child)
const;
67 bool isVerticalRelativePositioning(
Component* child)
const;
69 void setTopAnchor(
Component* child, int32_t anchor);
70 void setRightAnchor(
Component* child, int32_t anchor);
71 void setBottomAnchor(
Component* child, int32_t anchor);
72 void setLeftAnchor(
Component* child, int32_t anchor);
74 int32_t getTopAnchor(
Component* child)
const;
75 int32_t getRightAnchor(
Component* child)
const;
76 int32_t getBottomAnchor(
Component* child)
const;
77 int32_t getLeftAnchor(
Component* child)
const;
80 std::unordered_map<Component*, Constraints> m_Constraints;
83 virtual void layoutChildren()
override;
85 virtual int32_t computeCustomPrefWidth(int32_t height = -1)
const override;
86 virtual int32_t computeCustomPrefHeight(int32_t width = -1)
const override;
88 virtual int32_t computeCustomMinWidth(int32_t height = -1)
const override;
89 virtual int32_t computeCustomMinHeight(int32_t width = -1)
const override;
Allows the edges of components to be anchored to anchor pane's edges.