Mercurial > projects > mde
diff mde/gui/WMScreen.d @ 128:41582439a42b
Added support for dynamic EnumContent loading and saving, with translation loading.
WMScreen.init removed; code moved to this() since class is now created by main() instead of a static this().
Fix for SwitchWidget not passing events. Still some resizing bugs evident in SwitchWidget :-(
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Wed, 14 Jan 2009 20:24:14 +0000 |
parents | c9843fbaac88 |
children | 9cff74f68b84 |
line wrap: on
line diff
--- a/mde/gui/WMScreen.d Thu Jan 08 20:09:46 2009 +0000 +++ b/mde/gui/WMScreen.d Wed Jan 14 20:24:14 2009 +0000 @@ -26,8 +26,6 @@ import mde.gui.renderer.createRenderer; import mde.setup.Screen; -import Items = mde.content.Items; // loadTranslation -import mde.lookup.Options; // miscOpts.L10n callback import tango.util.log.Log : Log, Logger; @@ -50,29 +48,21 @@ scope class WMScreen : AWidgetManager, Screen.IDrawable { /** Construct a new widget manager. * + * Must be run after static this. + * * params: * fileName = Name of file specifying the gui, excluding path and extension. */ this (char[] file) { + // Doesn't need a lock - cannot conflict with other class functions. super(file); Screen.addDrawable (this); - clickCallbacks = new typeof(clickCallbacks); - motionCallbacks = new typeof(motionCallbacks); - } - - // this() runs during static this(), when imde.input doesn't exist. init() runs later. - void init () { - // Doesn't need a lock - cannot conflict with other class functions. // Events we want to know about: imde.input.addMouseClickCallback(&clickEvent); imde.input.addMouseMotionCallback(&motionEvent); - - Items.loadTranslation (); - miscOpts.L10n.addCallback (&reloadStrings); } - /** Draw the gui. */ void draw() { synchronized(mutex) {