Mercurial > projects > mde
diff mde/gui/widget/Widget.d @ 41:b3a6ca4516b4
The renderer now controls which parts of the window border allow resizing.
committer: Diggory Hardy <diggory.hardy@gmail.com>
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Tue, 13 May 2008 12:02:36 +0100 |
parents | 5132301e9ed7 |
children | 1530d9c04d4d |
line wrap: on
line diff
--- a/mde/gui/widget/Widget.d Thu May 08 16:05:51 2008 +0100 +++ b/mde/gui/widget/Widget.d Tue May 13 12:02:36 2008 +0100 @@ -17,8 +17,8 @@ module mde.gui.widget.Widget; public import mde.gui.widget.Ifaces; -import mde.gui.IGui; import mde.gui.exception; +import mde.gui.renderer.IRenderer; import tango.io.Stdout; @@ -168,26 +168,29 @@ void clickEvent (ushort, ushort, ubyte b, bool state) { if (b == 1 && state == true) { pushed = true; - window.gui.requestRedraw; + window.requestRedraw; window.gui.addClickCallback (&clickWhileHeld); window.gui.addMotionCallback (&motionWhileHeld); } } // Called when a mouse motion/click event occurs while (held == true) - void clickWhileHeld (ushort cx, ushort cy, ubyte b, bool state) { + bool clickWhileHeld (ushort cx, ushort cy, ubyte b, bool state) { + //NOTE: which button? test if (cx >= x && cx < x+w && cy >= y && cy < y+h) // button event Stdout ("Button clicked!").newline; pushed = false; - window.gui.requestRedraw; + window.requestRedraw; window.gui.removeCallbacks (cast(void*) this); + + return false; } void motionWhileHeld (ushort cx, ushort cy) { bool oldPushed = pushed; if (cx >= x && cx < x+w && cy >= y && cy < y+h) pushed = true; else pushed = false; if (oldPushed != pushed) - window.gui.requestRedraw; + window.requestRedraw; } } //END Widgets