]> git.tdb.fi Git - libs/gltk.git/blob - source/grid.h
Return a reference from Style::get_font
[libs/gltk.git] / source / grid.h
1 #ifndef MSP_GLTK_GRID_H_
2 #define MSP_GLTK_GRID_H_
3
4 #include "layout.h"
5
6 namespace Msp {
7 namespace GLtk {
8
9 /**
10 Arranges widgets in a grid.
11
12 This layout class places widgets in a grid, lining up their edges in rows and
13 columns.  Widgets are placed on rows left-to-right and rows are placed top-to-
14 bottom.
15
16 The start of each row must be indicated manually.  Individual cells can be
17 skipped to leave them empty.
18 */
19 class Grid: public Layout
20 {
21 private:
22         bool uniform;
23         std::vector<Slot *> columns;
24         unsigned cur_column;
25         bool first;
26         bool skipped;
27
28 public:
29         Grid(bool = false);
30
31         void start_row();
32         void skip_cell();
33
34 private:
35         Slot *create_slot(Widget &);
36 };
37
38 } // namespace GLtk
39 } // namespace Msp
40
41 #endif