comparison mde/gui/widget/layout.d @ 65:891211f034f2

Changes to widgets: widgets may now get strings as creation data. Strings for TextWidgets can be set in files (in a temporary mannor).
author Diggory Hardy <diggory.hardy@gmail.com>
date Sun, 29 Jun 2008 15:40:37 +0100
parents d43523ed4b62
children f54ae4fc2b2f
comparison
equal deleted inserted replaced
64:cc3763817b8a 65:891211f034f2
36 * 36 *
37 * The grid has no border but has spacing between widgets. */ 37 * The grid has no border but has spacing between widgets. */
38 class GridLayoutWidget : Widget 38 class GridLayoutWidget : Widget
39 { 39 {
40 //BEGIN Creation & saving 40 //BEGIN Creation & saving
41 /** Constructor for a grid layout widget.
42 *
43 * Widget uses the initialisation data:
44 * [widgetID, r, c, w11, w12, ..., w1c, ..., wr1, ..., wrc]
45 * where r and c are the number of rows and columns, and wij is the ID (from parent Window's
46 * list) for the widget in row i and column j. The number of parameters must be r*c + 3. */
41 this (IWindow wind, int[] data) { 47 this (IWindow wind, int[] data) {
42 // Get grid size and check data 48 // Get grid size and check data
43 // Check sufficient data for rows, cols, and at least one widget: 49 // Check sufficient data for rows, cols, and at least one widget:
44 if (data.length < 4) throw new WidgetDataException; 50 if (data.length < 4) throw new WidgetDataException;
45 super (wind, data); 51 super (wind, data);