diff mde/events.d @ 31:baa87e68d7dc

GUI now supports basic interactible widgets, widget colour and border are more unified, and some code cleanup. Removed some circular dependencies which slipped in. As a result, the OpenGL code got separated into different files. Enabled widgets to recieve events. New IParentWidget interface allowing widgets to interact with their parents. New Widget base class. New WidgetDecoration class. New ButtonWidget class responding to events (in a basic way). committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Tue, 29 Apr 2008 18:10:58 +0100
parents 467c74d4804d
children 316b0230a849
line wrap: on
line diff
--- a/mde/events.d	Mon Apr 28 10:59:47 2008 +0100
+++ b/mde/events.d	Tue Apr 29 18:10:58 2008 +0100
@@ -20,9 +20,6 @@
 import sdl = mde.SDL;           // resizeWindow
 
 import mde.input.input;
-import mde.input.exception;
-
-import mde.scheduler.InitFunctions;
 
 import derelict.sdl.events;
 
@@ -32,24 +29,6 @@
 private Logger logger;
 static this() {
     logger = Log.getLogger ("mde.events");
-    
-    init.addFunc (&initInput, "initInput");
-}
-
-void initInput () { // init func
-    try {
-        global.input = new Input();
-        global.input.loadConfig ();         // (may also create instance)
-    
-        global.input.addButtonCallback (cast(Input.inputID) 0x0u, delegate void(Input.inputID i, bool b) {
-            if (b) {
-                logger.info ("Quiting...");
-                global.run = false;
-            }
-        } );
-    } catch (Exception) {
-        setInitFailure;
-    }
 }
 
 void pollEvents (TimeSpan) {
@@ -71,7 +50,7 @@
             default:
                 try {
                     global.input (event);
-                } catch (InputClassException e) {
+                } catch (Exception e) {
                     logger.error ("Caught input exception; event will be ignored. Exception was:");
                     logger.error (e.msg);
                 }