Mercurial > projects > dynamin
diff dynamin/gui/control.d @ 23:d55b5b998412
Implement built-in mouse cursors with X.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Sat, 25 Jul 2009 14:58:43 -0500 |
parents | 96b29f2efa4d |
children | 41b76c218851 |
line wrap: on
line diff
--- a/dynamin/gui/control.d Sat Jul 25 14:47:45 2009 -0500 +++ b/dynamin/gui/control.d Sat Jul 25 14:58:43 2009 -0500 @@ -74,7 +74,7 @@ bool _elasticX, _elasticY; public: protected void dispatchMouseEntered(EventArgs e) { - Cursor.setCurrent(this, _cursor); + setCurrentCursor(_cursor); mouseEntered.callHandlers(e); mouseEntered.callMainHandler(e); } @@ -503,15 +503,24 @@ repaint(); } + void setCurrentCursor(Cursor cur) { + if(parent) + parent.setCurrentCursor(cur); + } + /** + * Gets or sets the mouse cursor that will be shown when the mouse + * is over this control. + */ Cursor cursor() { return _cursor; } + /// ditto void cursor(Cursor cur) { if(_cursor is cur) return; _cursor = cur; if(getHotControl() is this) - Cursor.setCurrent(this, _cursor); + setCurrentCursor(_cursor); } /**