]> git.tdb.fi Git - libs/gltk.git/blob - source/mixedrows.h
721b8771d43efd356466a54486c992fffa4b6dc7
[libs/gltk.git] / source / mixedrows.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_MIXEDROWS_H_
9 #define MSP_GLTK_MIXEDROWS_H_
10
11 #include "layout.h"
12
13 namespace Msp {
14 namespace GLtk {
15
16 /**
17 Places widgets on multiple heterogeneous rows.
18
19 This layout class creates rows of widgets, with no horizontal constraints
20 between rows.  Widgets are placed on rows left-to-right and rows are placed
21 top-to-bottom.
22
23 The start of each new row must be indicated manually.  The widgets on a row
24 can be specified to have a uniform width, and similarly all rows can be set to
25 have a uniform height.
26
27 By default widgets have a top-left gravity.  It's possible to specify a "split"
28 to align remaining widgets on a row to the right, or remaining rows to the
29 bottom.  This does not change the placement order of widgets.
30 */
31 class MixedRows: public Layout
32 {
33 private:
34         bool uniform_rows;
35         bool uniform_cols;
36         int hgravity;
37         bool hsplit;
38         int vgravity;
39         bool vsplit;
40         bool first;
41
42 public:
43         MixedRows(bool = false);
44
45         void start_row(bool = false);
46         void split_rows();
47         void split_columns();
48
49 private:
50         virtual Slot *create_slot(Widget &);
51 };
52
53 } // namespace GLtk
54 } // namespace Msp
55
56 #endif