]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/stack.h
Add a Stack arrangement
[libs/gltk.git] / source / stack.h
diff --git a/source/stack.h b/source/stack.h
new file mode 100644 (file)
index 0000000..fa4a442
--- /dev/null
@@ -0,0 +1,34 @@
+#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