Mercurial > projects > mde
comparison mde/events.d @ 113:9824bee909fd
Popup menu; works for simple menus except that clicking an item doesn't close it.
Revised popup support a bit; EnumContentWidget is broken and due to be replaced.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Fri, 19 Dec 2008 10:32:28 +0000 |
parents | 56c0ddd90193 |
children | 264028f4115a |
comparison
equal
deleted
inserted
replaced
112:fe061009029d | 113:9824bee909fd |
---|---|
19 * input system. */ | 19 * input system. */ |
20 module mde.events; | 20 module mde.events; |
21 | 21 |
22 import imde = mde.imde; | 22 import imde = mde.imde; |
23 import mde.setup.Screen; | 23 import mde.setup.Screen; |
24 | |
25 import mde.input.Input; | 24 import mde.input.Input; |
26 | 25 |
27 import derelict.sdl.events; | 26 import derelict.sdl.events; |
28 | |
29 import tango.time.Time; | 27 import tango.time.Time; |
30 import tango.util.log.Log : Log, Logger; | 28 import tango.util.log.Log : Log, Logger; |
31 import tango.io.Stdout; | |
32 | 29 |
33 private Logger logger; | 30 private Logger logger; |
34 static this() { | 31 static this() { |
35 logger = Log.getLogger ("mde.events"); | 32 logger = Log.getLogger ("mde.events"); |
36 } | 33 } |
52 imde.mainSchedule.request(imde.SCHEDULE.DRAW); | 49 imde.mainSchedule.request(imde.SCHEDULE.DRAW); |
53 break; | 50 break; |
54 default: | 51 default: |
55 try { | 52 try { |
56 if (!imde.input (event)) | 53 if (!imde.input (event)) |
57 debug Stdout ("Unrecognised event with code ")(event.type).newline; | 54 logger.warn ("Unrecognised event with code {}", event.type); |
58 } catch (Exception e) { | 55 } catch (Exception e) { |
59 logger.error ("Caught input exception; event will be ignored. Exception was:"); | 56 logger.error ("Caught input exception; event will be ignored. Exception was:"); |
60 logger.error (e.msg); | 57 logger.error (e.msg); |
61 } | 58 } |
62 } | 59 } |