changeset 58:712ea1ea845a

Add some comments
author Jordan Miner <jminer7@gmail.com>
date Sat, 08 Aug 2009 17:16:11 -0500
parents 1db4cb3abbb0
children d3ba5d4a3a27
files dynamin/gui/container.d
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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);
 	}
 }