Mercurial > projects > mde
comparison mde/gui/widget/Floating.d @ 90:b525ff28774b
Widgets generated dynamically from a list can now be standard widgets selected from data files.
Started on allowing alignment to be shared between instances of a layout widget in a dynamic list (to allow column alignment of list's rows).
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Wed, 01 Oct 2008 23:37:51 +0100 |
parents | ac1e3fd07275 |
children | 4d5d53e4f881 |
comparison
equal
deleted
inserted
replaced
89:97e6dce08037 | 90:b525ff28774b |
---|---|
51 * | 51 * |
52 * Data: Each string item is interpreted as a subwidget widgetID. | 52 * Data: Each string item is interpreted as a subwidget widgetID. |
53 * Ints supplied may consist of just the widget type or | 53 * Ints supplied may consist of just the widget type or |
54 * additionally an (x,y) coordinate for each subwidget (all x coords first, then all y coords). | 54 * additionally an (x,y) coordinate for each subwidget (all x coords first, then all y coords). |
55 */ | 55 */ |
56 class FloatingAreaWidget : SizableWidget, IParentWidget | 56 class FloatingAreaWidget : SizableWidget |
57 { | 57 { |
58 this (IWidgetManager mgr, WidgetData data) { | 58 this (IWidgetManager mgr, WidgetData data) { |
59 subWidgets.length = data.strings.length; | 59 subWidgets.length = data.strings.length; |
60 foreach (i,s; data.strings) | 60 foreach (i,s; data.strings) |
61 subWidgets[i] = mgr.makeWidget (s, this); | 61 subWidgets[i] = mgr.makeWidget (s); |
62 sWCoords.length = subWidgets.length; | 62 sWCoords.length = subWidgets.length; |
63 | 63 |
64 if (data.ints.length != 1) { | 64 if (data.ints.length != 1) { |
65 if (data.ints.length != 2*subWidgets.length + 1) { | 65 if (data.ints.length != 2*subWidgets.length + 1) { |
66 throw new WidgetDataException; | 66 throw new WidgetDataException; |