Mercurial > projects > mde
diff mde/gui/widget/Widget.d @ 117:aba2dd815a1f
Some tweaks to popup events and widgets.
Moved gui.mtt to guiDemo.mtt
Changed handling of clicks with popups.
Made some of the popup widgets use usual from widget data construction.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Fri, 26 Dec 2008 12:07:38 +0000 |
parents | 1b1e2297e2fc |
children | 5b37d0400732 |
line wrap: on
line diff
--- a/mde/gui/widget/Widget.d Sun Dec 21 12:03:50 2008 +0000 +++ b/mde/gui/widget/Widget.d Fri Dec 26 12:07:38 2008 +0000 @@ -116,6 +116,11 @@ return this; } + // Should be valid for any widget. + override bool onSelf (wdabs cx, wdabs cy) { + return cx >= x && cx < x + w && cy >= y && cy < y + h; + } + /* Dummy event method (suitable for all widgets which don't respond to events). */ override int clickEvent (wdabs cx, wdabs cy, ubyte b, bool state) { return 0; @@ -129,7 +134,10 @@ override void highlight (bool state) {} // Only useful to widgets creating popups. - override void popupRemoved () {} + override void popupClose () {} + override bool popupParentClick () { + return true; + } //END Events /* Basic draw method: draw the background (all widgets should do this). */