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