Mercurial > projects > mde
changeset 148:17438f17bfb5
Hooked redraws in for BoolContentWidget and SliderContentWidget.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 14 Mar 2009 11:05:31 +0100 |
parents | 075705ad664a |
children | 1125ba603af6 |
files | mde/gui/widget/AChildWidget.d mde/gui/widget/miscContent.d |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mde/gui/widget/AChildWidget.d Wed Feb 11 13:02:30 2009 +0000 +++ b/mde/gui/widget/AChildWidget.d Sat Mar 14 11:05:31 2009 +0100 @@ -22,7 +22,7 @@ module mde.gui.widget.AChildWidget; public import mde.gui.widget.Ifaces; -import mde.content.IContent; +import mde.content.Content; import mde.gui.exception; debug { @@ -193,6 +193,13 @@ throw new ContentException (this); } + /** Hook this function to a Content callback to cause redraws. + * + * mgr.requestRedraw could be hooked in directly if the prototype changed. */ + void contentRedraw (Content) { + mgr.requestRedraw; + } + IWidgetManager mgr; // the enclosing window IParentWidget parent; // the parent widget wdim x, y; // position
--- a/mde/gui/widget/miscContent.d Wed Feb 11 13:02:30 2009 +0000 +++ b/mde/gui/widget/miscContent.d Sat Mar 14 11:05:31 2009 +0100 @@ -43,6 +43,7 @@ wdimPair s = mgr.renderer.getToggleSize; w = mw = s.x; h = mh = s.y; + content_.addCallback (&contentRedraw); } override IContent content () { @@ -111,6 +112,7 @@ wdimPair s = mgr.renderer.getSliderSize; w = mw = s.x; h = mh = s.y; + content_.addCallback (&contentRedraw); } override IContent content () {