#include "panel.h"
#include "part.h"
#include "row.h"
+#include "stack.h"
#include "toggle.h"
#include "vslider.h"
add("list", &Loader::child<List>);
add("panel", &Loader::panel);
add("row", &Loader::arrangement<Row>);
+ add("stack", &Loader::arrangement<Stack>);
add("toggle", &Loader::child<Toggle>);
add("vslider", &Loader::child<VSlider>);
}
--- /dev/null
+#include "stack.h"
+
+namespace Msp {
+namespace GLtk {
+
+Stack::Stack(Layout &l):
+ Arrangement(l)
+{ }
+
+void Stack::process_widget(Widget &wdg, Side side, bool aligned)
+{
+ if(edges[side].aligned && aligned)
+ add_constraint(wdg, get_align_constraint(side), side);
+ edges[side].add(wdg, aligned);
+}
+
+void Stack::finish_widget(Widget &wdg)
+{
+ layout.set_ghost(wdg, true);
+}
+
+
+Stack::Loader::Loader(Stack &s):
+ DataFile::ObjectLoader<Stack>(s)
+{ }
+
+} // namespace GLtk
+} // namespace Msp
--- /dev/null
+#ifndef MSP_GLTK_STACK_H_
+#define MSP_GLTK_STACK_H_
+
+#include <msp/datafile/objectloader.h>
+#include "arrangement.h"
+
+namespace Msp {
+namespace GLtk {
+
+/**
+Arranges widgets on top of one another. This can be useful in implementing a
+tabbed view where only one tab is visible at a time.
+*/
+class Stack: public Arrangement
+{
+public:
+ class Loader: public DataFile::ObjectLoader<Stack>
+ {
+ public:
+ Loader(Stack &);
+ };
+
+ Stack(Layout &);
+
+private:
+ virtual void process_widget(Widget &, Side, bool);
+ virtual void finish_widget(Widget &);
+ virtual void finish_slot() { }
+};
+
+} // namespace GLtk
+} // namespace Msp
+
+#endif