comparison mde/gui/WidgetManager.d @ 93:08a4ae11454b

Widgets now save dimensions without preventing structural changes in the base config file from applying. Widget dimensional data separated from other data in files, hence above change. Moved TextAdapter from TextWidget to IRenderer.
author Diggory Hardy <diggory.hardy@gmail.com>
date Tue, 21 Oct 2008 11:35:15 +0100
parents 085f2ca31914
children dbf332403c6e
comparison
equal deleted inserted replaced
92:085f2ca31914 93:08a4ae11454b
331 void save () { 331 void save () {
332 mutex.lock; 332 mutex.lock;
333 scope(exit) mutex.unlock; 333 scope(exit) mutex.unlock;
334 334
335 // Make all widgets save any changed data; return if no changes: 335 // Make all widgets save any changed data; return if no changes:
336 if (!child.saveChanges ("root")) 336 if (!child.saveChanges)
337 return; 337 return;
338 338
339 if (loadUserFile) { // merge entries from user file into current changes 339 if (loadUserFile) { // merge entries from user file into current changes
340 try { 340 try {
341 scope IReader reader = confDir.makeMTReader ( 341 scope IReader reader = confDir.makeMTReader (
423 foreach (widget; generation) 423 foreach (widget; generation)
424 widget.finalize; 424 widget.finalize;
425 } 425 }
426 } 426 }
427 427
428 /** For making changes. */ 428 /** Get dimension data for a widget. */
429 wdims dimData (widgetID id) {
430 return curData.dims (id);
431 }
432
433 /** For making changes to widget structure. */
429 void setData (widgetID id, WidgetData d) { 434 void setData (widgetID id, WidgetData d) {
430 changes[id] = d; // also updates WidgetDataSet in data. 435 changes[id] = d; // also updates WidgetDataSet in data.
436 }
437
438 /** For making changes to widget dimensions. */
439 void setDimData (widgetID id, wdims d) {
440 changes.setDims(id, d); // also updates WidgetDataSet in data.
431 } 441 }
432 442
433 /** Second stage of loading the widgets. 443 /** Second stage of loading the widgets.
434 * 444 *
435 * loadDesign handles the data; this method needs to: 445 * loadDesign handles the data; this method needs to: