# HG changeset patch # User Jordan Miner # Date 1249769771 18000 # Node ID 712ea1ea845a9694031a9bd39fbef4b9db9c75df # Parent 1db4cb3abbb03ec712292735d532666e98f70110 Add some comments diff -r 1db4cb3abbb0 -r 712ea1ea845a dynamin/gui/container.d --- a/dynamin/gui/container.d Sat Aug 08 17:15:31 2009 -0500 +++ b/dynamin/gui/container.d Sat Aug 08 17:16:11 2009 -0500 @@ -338,7 +338,11 @@ _children.remove(child); } - int opApply(int delegate(inout Control item) dg) { + /** + * Calls the specified delegate with each child of this container, for + * use with foreach. + */ + int opApply(int delegate(ref Control item) dg) { for(uint i = 0; i < _children.count; ++i) { auto tmp = _children[i]; if(int result = dg(tmp)) @@ -346,7 +350,8 @@ } return 0; } - int opApply(int delegate(inout uint index, inout Control item) dg) { + /// ditto + int opApply(int delegate(ref uint index, ref Control item) dg) { for(uint i = 0; i < _children.count; ++i) { auto tmp = _children[i]; if(int result = dg(i, tmp)) @@ -421,14 +426,20 @@ control2, control3]); } +/// class Panel : Container { + /// ControlList children() { return _children; } + /// void add(Control child) { super.add(child); }; + /// void remove(Control child) { super.remove(child); }; - int opApply(int delegate(inout Control item) dg) { + /// + int opApply(int delegate(ref Control item) dg) { return super.opApply(dg); } - int opApply(int delegate(inout uint index, inout Control item) dg) { + /// + int opApply(int delegate(ref uint index, ref Control item) dg) { return super.opApply(dg); } }