egra: splitted widgets to package with separate submodules
[iv.d.git] / egra / gui / widgets / spacers.d
blob2ca44dd35359c43e23f541dc786a56ccfa776382
1 /*
2 * Simple Framebuffer Gfx/GUI lib
4 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
5 * Understanding is not required. Only obedience.
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, version 3 of the License ONLY.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 module iv.egra.gui.widgets.spacers /*is aliced*/;
20 private:
22 import arsd.simpledisplay;
24 import iv.egra.gfx;
26 import iv.alice;
27 import iv.cmdcon;
28 import iv.dynstring;
29 import iv.strex;
30 import iv.utfutil;
32 import iv.egra.gui.subwindows;
33 import iv.egra.gui.widgets.base;
36 // ////////////////////////////////////////////////////////////////////////// //
37 public class SpacerWidget : Widget {
38 this (Widget aparent, in int asize) {
39 assert(aparent !is null);
40 super(aparent);
41 tabStop = false;
42 nonVisual = true;
43 if (aparent.childDir == GxDir.Horiz) rect.size.w = asize; else rect.size.h = asize;
46 this (in int asize) {
47 assert(creatorCurrentParent !is null);
48 this(creatorCurrentParent, asize);
52 public class SpringWidget : SpacerWidget {
53 this (Widget aparent, in int aflex) {
54 super(aparent, 0);
55 flex = aflex;
58 this (in int aflex) {
59 assert(creatorCurrentParent !is null);
60 this(creatorCurrentParent, aflex);
65 // ////////////////////////////////////////////////////////////////////////// //
66 public class BoxWidget : Widget {
67 this (Widget aparent) {
68 super(aparent);
69 tabStop = false;
72 this () {
73 assert(creatorCurrentParent !is null);
74 this(creatorCurrentParent);
78 public class HBoxWidget : BoxWidget {
79 this (Widget aparent) {
80 super(aparent);
81 childDir = GxDir.Horiz;
84 this () {
85 assert(creatorCurrentParent !is null);
86 this(creatorCurrentParent);
90 public class VBoxWidget : BoxWidget {
91 this (Widget aparent) {
92 super(aparent);
93 childDir = GxDir.Vert;
96 this () {
97 assert(creatorCurrentParent !is null);
98 this(creatorCurrentParent);