]> git.tdb.fi Git - libs/gltk.git/blob - source/lineararrangement.h
Allow overriding the spacing between two widgets in LinearArrangement
[libs/gltk.git] / source / lineararrangement.h
1 #ifndef MSP_GLTK_LINEARARRANGEMENT_H_
2 #define MSP_GLTK_LINEARARRANGEMENT_H_
3
4 #include <msp/datafile/objectloader.h>
5 #include "arrangement.h"
6
7 namespace Msp {
8 namespace GLtk {
9
10 class LinearArrangement: public Arrangement
11 {
12 public:
13         class Loader: public DataFile::ObjectLoader<LinearArrangement>
14         {
15         public:
16                 Loader(LinearArrangement &);
17         private:
18                 void expand();
19                 void spacing(unsigned);
20                 void split();
21         };
22
23 protected:
24         Side primary;
25         Side opposite;
26         Edge next;
27         bool first;
28         bool split_here;
29         Side gravity;
30         bool internal_aligned;
31         int next_spacing;
32
33         LinearArrangement(Layout &, Side);
34
35 public:
36         void split();
37         void expand();
38         void spacing(unsigned);
39
40 protected:
41         virtual void process_widget(Widget &, Side, bool);
42         virtual void finish_slot();
43 };
44
45 } // namespace GLtk
46 } // namespace Msp
47
48 #endif