Mercurial > projects > mde
diff mde/gui/widget/Ifaces.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 | 3dfd934100f7 |
line wrap: on
line diff
--- a/mde/gui/widget/Ifaces.d Mon Jul 28 18:17:48 2008 +0100 +++ b/mde/gui/widget/Ifaces.d Mon Jul 28 18:49:18 2008 +0100 @@ -108,7 +108,10 @@ // User input: - /** Add a mouse click callback: delegate will be called for all mouse click events recieved. + /** Add a mouse click callback. + * + * This is a delegate this will be called for all mouse click events recieved by the gui, not + * simply all click events on the widget (as clickEvent recieves). * * The delegate should return true if it accepts the event and no further processing is * required (i.e. the event should not be handled by anything else), false otherwise. @@ -117,13 +120,15 @@ * may be removed (so event handling cannot be cut short). */ void addClickCallback (bool delegate (wdabs cx, wdabs cy, ubyte b, bool state) dg); - /** Add a mouse motion callback: delegate will be called for all motion events recieved. */ + /** Add a mouse motion callback: delegate will be called for all motion events recieved by the + * gui. */ void addMotionCallback (void delegate (wdabs cx, wdabs cy) dg); // FIXME: keyboard callback (letter only, for text input? Also used for setting keybindings though...) /** Remove all event callbacks on this widget (according to the delegate's .ptr). */ - void removeCallbacks (IChildWidget frame); + // Note: don't try to pass a reference and cast to void* in the function; it's a different address. + void removeCallbacks (void* frame); } @@ -236,7 +241,7 @@ * (x,y). * * Note: use global coordinates (x,y) not coordinates relative to the widget. */ - IWidget getWidget (wdim x, wdim y); + IChildWidget getWidget (wdim x, wdim y); /** Receive a mouse click event. *