|
@@ -8,6 +8,13 @@
|
|
|
namespace Atomic
|
|
namespace Atomic
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
+enum UI_AXIS {
|
|
|
|
|
+ ///< Horizontal layout
|
|
|
|
|
+ UI_AXIS_X = tb::AXIS_X,
|
|
|
|
|
+ ///< Vertical layout
|
|
|
|
|
+ UI_AXIS_Y = tb::AXIS_Y,
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
/// Specifies which height widgets in a AXIS_X layout should have,
|
|
/// Specifies which height widgets in a AXIS_X layout should have,
|
|
|
/// or which width widgets in a AXIS_Y layout should have.
|
|
/// or which width widgets in a AXIS_Y layout should have.
|
|
|
/// No matter what, it will still prioritize minimum and maximum for each widget.
|
|
/// No matter what, it will still prioritize minimum and maximum for each widget.
|
|
@@ -24,6 +31,46 @@ enum UI_LAYOUT_SIZE
|
|
|
UI_LAYOUT_SIZE_AVAILABLE = tb::LAYOUT_SIZE_AVAILABLE
|
|
UI_LAYOUT_SIZE_AVAILABLE = tb::LAYOUT_SIZE_AVAILABLE
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/// Specifies which width widgets in a AXIS_X layout should have,
|
|
|
|
|
+/// or which height widgets in a AXIS_Y layout should have. */
|
|
|
|
|
+///
|
|
|
|
|
+enum UI_LAYOUT_DISTRIBUTION
|
|
|
|
|
+{
|
|
|
|
|
+ ///< Size will be the preferred so each widget may be sized differently.
|
|
|
|
|
+ UI_LAYOUT_DISTRIBUTION_PREFERRED = tb::LAYOUT_DISTRIBUTION_PREFERRED,
|
|
|
|
|
+ ///< Size should grow to all available space
|
|
|
|
|
+ UI_LAYOUT_DISTRIBUTION_AVAILABLE = tb::LAYOUT_DISTRIBUTION_AVAILABLE,
|
|
|
|
|
+ ///< Sizes depend on the gravity for each widget. (If the widget pulls
|
|
|
|
|
+ /// ///< towards both directions, it should grow to all available space)
|
|
|
|
|
+ UI_LAYOUT_DISTRIBUTION_GRAVITY = tb::LAYOUT_DISTRIBUTION_GRAVITY
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/// Specifies which y position widgets in a AXIS_X layout should have,
|
|
|
|
|
+/// or which x position widgets in a AXIS_Y layout should have. */
|
|
|
|
|
+enum UI_LAYOUT_POSITION
|
|
|
|
|
+{
|
|
|
|
|
+ ///< Position is centered
|
|
|
|
|
+ UI_LAYOUT_POSITION_CENTER = tb::LAYOUT_POSITION_CENTER,
|
|
|
|
|
+ ///< Position is to the left for AXIS_Y layout and top for AXIS_X layout.
|
|
|
|
|
+ UI_LAYOUT_POSITION_LEFT_TOP = tb::LAYOUT_POSITION_LEFT_TOP,
|
|
|
|
|
+ ///< Position is to the right for AXIS_Y layout and bottom for AXIS_X layout.
|
|
|
|
|
+ UI_LAYOUT_POSITION_RIGHT_BOTTOM = tb::LAYOUT_POSITION_RIGHT_BOTTOM,
|
|
|
|
|
+ ///< Position depend on the gravity for each widget. (If the widget pulls
|
|
|
|
|
+ /// ///< towards both directions, it will be centered)
|
|
|
|
|
+ UI_LAYOUT_POSITION_GRAVITY= tb::LAYOUT_POSITION_GRAVITY
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/** Specifies how widgets should be moved horizontally in a AXIS_X
|
|
|
|
|
+ layout (or vertically in a AXIS_Y layout) if there is extra space
|
|
|
|
|
+ available. */
|
|
|
|
|
+enum UI_LAYOUT_DISTRIBUTION_POSITION
|
|
|
|
|
+{
|
|
|
|
|
+ UI_LAYOUT_DISTRIBUTION_POSITION_CENTER = tb::LAYOUT_DISTRIBUTION_POSITION_CENTER,
|
|
|
|
|
+ UI_LAYOUT_DISTRIBUTION_POSITION_LEFT_TOP = tb::LAYOUT_DISTRIBUTION_POSITION_LEFT_TOP,
|
|
|
|
|
+ UI_LAYOUT_DISTRIBUTION_POSITION_RIGHT_BOTTOM = tb::LAYOUT_DISTRIBUTION_POSITION_RIGHT_BOTTOM
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
class UILayoutParams : public Object
|
|
class UILayoutParams : public Object
|
|
|
{
|
|
{
|
|
@@ -34,6 +81,7 @@ public:
|
|
|
UILayoutParams(Context* context);
|
|
UILayoutParams(Context* context);
|
|
|
virtual ~UILayoutParams();
|
|
virtual ~UILayoutParams();
|
|
|
|
|
|
|
|
|
|
+ void SetWidth(int width) { params_.SetWidth(width); }
|
|
|
void SetHeight(int height) { params_.SetHeight(height); }
|
|
void SetHeight(int height) { params_.SetHeight(height); }
|
|
|
|
|
|
|
|
tb::LayoutParams* GetTBLayoutParams() { return ¶ms_; }
|
|
tb::LayoutParams* GetTBLayoutParams() { return ¶ms_; }
|
|
@@ -56,12 +104,12 @@ public:
|
|
|
|
|
|
|
|
void SetSpacing(int spacing);
|
|
void SetSpacing(int spacing);
|
|
|
|
|
|
|
|
- void SetAxis(/* AXIS */ unsigned axis);
|
|
|
|
|
|
|
+ void SetAxis(UI_AXIS axis);
|
|
|
void SetLayoutSize(UI_LAYOUT_SIZE size);
|
|
void SetLayoutSize(UI_LAYOUT_SIZE size);
|
|
|
|
|
|
|
|
- void SetLayoutPosition(/*LAYOUT_POSITION*/ unsigned position);
|
|
|
|
|
- void SetLayoutDistribution(/* LAYOUT_DISTRIBUTION */ unsigned distribution);
|
|
|
|
|
- void SetLayoutDistributionPosition(/*LAYOUT_DISTRIBUTION_POSITION*/ unsigned distribution_pos);
|
|
|
|
|
|
|
+ void SetLayoutPosition(UI_LAYOUT_POSITION position);
|
|
|
|
|
+ void SetLayoutDistribution(UI_LAYOUT_DISTRIBUTION distribution);
|
|
|
|
|
+ void SetLayoutDistributionPosition(UI_LAYOUT_DISTRIBUTION_POSITION distribution_pos);
|
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
protected:
|