comparison mde/gui/widget/Popup.d @ 111:1655693702fc

Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run. Removed prefinalize and finalize and added setup as the new second initialization phase, which can be re-run.
author Diggory Hardy <diggory.hardy@gmail.com>
date Sat, 06 Dec 2008 17:41:42 +0000
parents c9fc2d303178
children fe061009029d
comparison
equal deleted inserted replaced
110:6acd96f8685f 111:1655693702fc
24 { 24 {
25 this (IWidgetManager mgr, widgetID id, WidgetData data, IContent content) { 25 this (IWidgetManager mgr, widgetID id, WidgetData data, IContent content) {
26 WDCheck (data, 1,2); 26 WDCheck (data, 1,2);
27 subWidget = mgr.makeWidget (data.strings[0], content); 27 subWidget = mgr.makeWidget (data.strings[0], content);
28 28
29 adapter = mgr.renderer.getAdapter (data.strings[1]); 29 adapter = mgr.renderer.getAdapter;
30 adapter.text = data.strings[1];
30 adapter.getDimensions (mw, mh); 31 adapter.getDimensions (mw, mh);
31 w = mw; 32 w = mw;
32 h = mh; 33 h = mh;
33 super (mgr, id, data); 34 super (mgr, id, data);
35 }
36
37 bool setup (uint n, uint flags) {
38 return subWidget.setup (n,flags);
39 }
40
41 bool saveChanges () {
42 return subWidget.saveChanges;
34 } 43 }
35 44
36 void activated () { 45 void activated () {
37 mgr.addPopup (x,y, subWidget); 46 mgr.addPopup (x,y, subWidget);
38 } 47 }