Mercurial > projects > mde
diff mde/gui/WidgetManager.d @ 76:65780e0e48e6
Re-enabled click event passing in the gui to make ButtonWidget work.
Bugfix (pass void* not class reference).
Change to allow compilation with dmd 1.027 (don't use DefaultData's Arg!() template).
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Mon, 28 Jul 2008 18:49:18 +0100 |
parents | 25cb7420dc91 |
children | ea58f277f487 |
line wrap: on
line diff
--- a/mde/gui/WidgetManager.d Mon Jul 28 18:17:48 2008 +0100 +++ b/mde/gui/WidgetManager.d Mon Jul 28 18:49:18 2008 +0100 @@ -90,7 +90,11 @@ // See IWidgetManager.addClickCallback's documentation: if (dg (cast(wdabs)cx, cast(wdabs)cy, b, state)) return; - /+ + // NOTE: do we need to test if the click was on the gui (and thus child)? + IChildWidget widg = child.getWidget (cast(wdabs)cx,cast(wdabs)cy); + if (widg !is null) + widg.clickEvent (cast(wdabs)cx,cast(wdabs)cy,b,state); + /+ FIXME: remove foreach (i,w; windows) { IWidget widg = w.getWidget (cast(wdabs)cx,cast(wdabs)cy); if (widg !is null) { @@ -150,9 +154,9 @@ void addMotionCallback (void delegate(wdabs, wdabs) dg) { motionCallbacks[dg.ptr] = dg; } - void removeCallbacks (IChildWidget frame) { - clickCallbacks.remove(cast(void*) frame); - motionCallbacks.remove(cast(void*) frame); + void removeCallbacks (void* frame) { + clickCallbacks.remove(frame); + motionCallbacks.remove(frame); } //END IWidgetManager methods