# HG changeset patch # User Diggory Hardy # Date 1242936940 -7200 # Node ID e3fe6acc16fb50ca614ed2733862f64eef1a1721 # Parent ccd01fde535e4963f9f9675f677cfa5bda8a44d2 Replaced WidgetManager's click and motion callbacks with a drag event system. This is less flexible, but much closer to what is required (and is simpler and less open to bugs through unintended use). The widget under the mouse is now passed (although could just as easily have been before). diff -r ccd01fde535e -r e3fe6acc16fb mde/gui/widget/AChildWidget.d --- a/mde/gui/widget/AChildWidget.d Thu May 21 22:15:32 2009 +0200 +++ b/mde/gui/widget/AChildWidget.d Thu May 21 22:15:40 2009 +0200 @@ -283,7 +283,7 @@ } /// Called when a mouse click event occurs while held; handles up-click - override bool dragRelease (wdabs cx, wdabs cy, IChildWidget target) { + override bool dragRelease (wdabs cx, wdabs cy, IChildWidget) { if (pushed) { // on button parentIPPW.menuDone; activated(); @@ -295,8 +295,9 @@ return true; } /// Called when a mouse motion event occurs while held; handles pushing in/out on hover - override void dragMotion (wdabs cx, wdabs cy, IChildWidget) { + override void dragMotion (wdabs cx, wdabs cy, IChildWidget target) { bool oldPushed = pushed; + // test against dimensions and not target to include sub-widgets if (cx >= x && cx < x+w && cy >= y && cy < y+h) pushed = true; else pushed = false; if (oldPushed != pushed)