Mercurial > projects > mde
diff mde/gui/widget/ParentContent.d @ 170:e45226d3deae
Context menu services not applicable to the current type can now be hidden.
Added files missing from previous commits.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Mon, 29 Jun 2009 21:20:16 +0200 |
parents | da8d3091fdaf |
children | 0dd49f333189 |
line wrap: on
line diff
--- a/mde/gui/widget/ParentContent.d Mon Jun 29 18:55:50 2009 +0200 +++ b/mde/gui/widget/ParentContent.d Mon Jun 29 21:20:16 2009 +0200 @@ -124,7 +124,7 @@ } protected: - void updateVal (Content) { // callback + void updateVal (IContent) { // callback adapter.text = content_.toString(cIndex); wdim omw = mw, omh = mh; adapter.getDimensions (mw, mh); @@ -186,6 +186,12 @@ return r; } + override void recursionCheck (widgetID wID, IContent c) { + if (wID is id && c is content_) + throw new WidgetRecursionException (wID); + parent.recursionCheck (wID, c); + } + override void minWChange (IChildWidget widget, wdim nmw) { if (widget !is currentW) return; mw = nmw; @@ -229,7 +235,7 @@ protected: // callback on content_ - void switchWidget (Content) { + void switchWidget (IContent) { currentW = subWidgets[content_()]; mw = currentW.minWidth; mh = currentW.minHeight; @@ -249,7 +255,7 @@ bool isWS, isHS; // no infrastructure for changing sizability, so need to fix it. } -/** A collapsible widget: shows/hides a child dependant on a BoolContent. +/** A collapsible widget: shows/hides a child dependant on an IBoolContent. * * Sizability is set once. Min-size is changed (but cannot force size to 0). * @@ -259,7 +265,7 @@ { this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data, IContent c) { super (mgr, parent, id); - content_ = cast(BoolContent) c; + content_ = cast(IBoolContent) c; WDCCheck (data, 1, 1, content_); subWidgets = [mgr.makeWidget (this, data.strings[0], c)]; @@ -281,6 +287,12 @@ return r; } + override void recursionCheck (widgetID wID, IContent c) { + if (wID is id && c is content_) + throw new WidgetRecursionException (wID); + parent.recursionCheck (wID, c); + } + override IContent content () { return content_; } @@ -331,7 +343,7 @@ protected: // callback on content_ - void collapse (Content) { + void collapse (IContent) { collapsed = content_(); if (collapsed) { mw = mh = 0; @@ -349,7 +361,7 @@ } bool collapsed = false; - BoolContent content_; + IBoolContent content_; } /** Puts a border around its child widget.