]> git.tdb.fi Git - libs/gltk.git/blob - source/grid.h
Replace the derived layout classes with a more flexible design
[libs/gltk.git] / source / grid.h
1 #ifndef MSP_GLTK_GRID_H_
2 #define MSP_GLTK_GRID_H_
3
4 #include "arrangement.h"
5
6 namespace Msp {
7 namespace GLtk {
8
9 class Grid: public Arrangement
10 {
11 private:
12         struct Column
13         {
14                 Edge left;
15                 Edge right;
16         };
17
18         std::vector<Column> columns;
19         Edge row_top;
20         Edge row_bottom;
21         bool first_row;
22         unsigned column;
23
24 public:
25         Grid(Layout &, unsigned);
26
27         void skip();
28         void next_row();
29
30 private:
31         virtual void process_widget(Widget &, Side, bool);
32         virtual void finish_widget(Widget &);
33         virtual void finish_slot();
34         void finish_row();
35 };
36
37 } // namespace GLtk
38 } // namespace Msp
39
40 #endif