Mercurial > projects > mde
diff mde/gui/widget/AParentWidget.d @ 173:a1ba9157510e
Enabled ServiceContentList to call its callbacks when its value changes. Tried to fix some other bugs, but this is not a very clean commit, due to wanting to make some big changes to enable better use of invariants next.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 08 Aug 2009 15:53:10 +0200 |
parents | 0dd49f333189 |
children | 3d58adc17d20 |
line wrap: on
line diff
--- a/mde/gui/widget/AParentWidget.d Wed Jul 29 20:28:22 2009 +0200 +++ b/mde/gui/widget/AParentWidget.d Sat Aug 08 15:53:10 2009 +0200 @@ -87,8 +87,15 @@ } // Most parent widgets need to implement these, although not all - void minWChange (IChildWidget widget, wdim mw) {} - void minHChange (IChildWidget widget, wdim mh) {} + // They must at a minimum make sure widget's size is at least nmw by nmh. + override void minWChange (IChildWidget widget, wdim nmw) { + if (widget.width < nmw) + widget.setWidth (nmw, -1); + } + override void minHChange (IChildWidget widget, wdim nmh) { + if (widget.height < nmh) + widget.setHeight (nmh, -1); + } debug override void logWidgetSize () { super.logWidgetSize; @@ -237,7 +244,8 @@ /// Open a context menu void openMenu (IChildWidget underMouse, Content contextContent) { if (mAIPPW != MenuPosition.INACTIVE) return; // already in use - subWidgets[0].setContent = contextContent; + //NOTE: Disabled since it doesn't work correctly atm: + //subWidgets[0].setContent = contextContent; parentIPPW.addChildIPPW (this); // For context menus, don't set parentIPPW.menuActive like for clicked menus: menuActive = mgr.positionPopup (underMouse, popup);