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