ソースを参照

More UI layouts and controls.

Adam Blake 14 年 前
コミット
53e4ffc82b
3 ファイル変更88 行追加0 行削除
  1. 33 0
      gameplay/src/AbsoluteLayout.cpp
  2. 26 0
      gameplay/src/AbsoluteLayout.h
  3. 29 0
      gameplay/src/RadioGroup.h

+ 33 - 0
gameplay/src/AbsoluteLayout.cpp

@@ -0,0 +1,33 @@
+#include "Base.h"
+#include "AbsoluteLayout.h"
+
+namespace gameplay
+{
+    AbsoluteLayout::AbsoluteLayout()
+    {
+    }
+
+    AbsoluteLayout::AbsoluteLayout(const AbsoluteLayout& copy)
+    {
+    }
+
+    AbsoluteLayout::~AbsoluteLayout()
+    {
+    }
+
+    AbsoluteLayout* AbsoluteLayout::create()
+    {
+        AbsoluteLayout* al = new AbsoluteLayout();
+        return al;
+    }
+
+    Layout::Type AbsoluteLayout::getType()
+    {
+        return Layout::LAYOUT_ABSOLUTE;
+    }
+
+    void AbsoluteLayout::update(std::vector<Control*> controls, const Vector2& size)
+    {
+        // An AbsoluteLayout does nothing to modify the layout of Controls.
+    }
+}

+ 26 - 0
gameplay/src/AbsoluteLayout.h

@@ -0,0 +1,26 @@
+#ifndef ABSOLUTELAYOUT_H_
+#define ABSOLUTELAYOUT_H_
+
+#include "Layout.h"
+
+namespace gameplay
+{
+
+class AbsoluteLayout : public Layout
+{
+public:
+    static AbsoluteLayout* create();
+
+    Layout::Type getType();
+
+    void update(std::vector<Control*> controls, const Vector2& size);
+
+private:
+    AbsoluteLayout();
+    AbsoluteLayout(const AbsoluteLayout& copy);
+    virtual ~AbsoluteLayout();
+};
+
+}
+
+#endif

+ 29 - 0
gameplay/src/RadioGroup.h

@@ -0,0 +1,29 @@
+#ifndef RADIOGROUP_H_
+#define RADIOGROUP_H_
+
+#include "Container.h"
+#include "Theme.h"
+#include "Properties.h"
+
+namespace gameplay
+{
+
+class RadioGroup : public Container
+{
+public:
+    RadioGroup();
+    virtual ~RadioGroup();
+
+    static RadioGroup* create(Theme::Style* style, Properties* properties);
+    static RadioGroup* getRadioGroup(const char* id);
+
+private:
+    RadioGroup(const RadioGroup& copy);
+
+    unsigned int _selectedIndex;
+    std::vector<RadioButton*> _choices;
+}
+
+}
+
+#endif