]> git.tdb.fi Git - libs/gltk.git/blob - source/grid.h
9324f95fac937b1bb53c1d1167a861da338109d8
[libs/gltk.git] / source / grid.h
1 #ifndef MSP_GLTK_GRID_H_
2 #define MSP_GLTK_GRID_H_
3
4 #include <msp/datafile/objectloader.h>
5 #include "arrangement.h"
6 #include "mspgltk_api.h"
7
8 namespace Msp {
9 namespace GLtk {
10
11 class MSPGLTK_API Grid: public Arrangement
12 {
13 public:
14         class Loader: public DataFile::ObjectLoader<Grid>
15         {
16         public:
17                 Loader(Grid &);
18         private:
19                 void next_row();
20                 void skip();
21         };
22
23 private:
24         struct Column
25         {
26                 Edge left;
27                 Edge right;
28         };
29
30         std::vector<Column> columns;
31         Edge row_top;
32         Edge row_bottom;
33         bool first_row = true;
34         unsigned column = 0;
35
36 public:
37         Grid(Layout &, unsigned);
38
39         void skip();
40         void next_row();
41
42 private:
43         virtual void process_widget(Widget &, Side, bool);
44         virtual void finish_widget(Widget &);
45         virtual void finish_slot();
46         void finish_row();
47 };
48
49 } // namespace GLtk
50 } // namespace Msp
51
52 #endif