changeset 11:df1c8e659b75

Change layout language to use * for filler and ~ for spacing. Ticket #24
author Jordan Miner <jminer7@gmail.com>
date Thu, 16 Jul 2009 18:18:22 -0500
parents ccc108b25a0a
children 7a7e5f9bd1ae
files dynamin/gui/layout.d
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dynamin/gui/layout.d	Wed Jul 15 21:22:20 2009 -0500
+++ b/dynamin/gui/layout.d	Thu Jul 16 18:18:22 2009 -0500
@@ -410,7 +410,7 @@
 
 	// TODO: // for line comments?
 	skipWS(str);
-	if("()~[]-".contains(str[0])) {
+	if("()[]*~".contains(str[0])) {
 		return str[0..1];
 	} else if(idChars.contains(str[0])) {
 		int i = 1;
@@ -477,9 +477,9 @@
 	uint count = 0;
 	assert(nextToken(layout) == "(", "open parenthesis expected");
 	while(nextToken(layout) != ")") {
-		if(getToken(layout) == "~")
+		if(getToken(layout) == "*")
 			bcode = bcode ~ "panel.addFiller();\n";
-		else if(getToken(layout) == "-")
+		else if(getToken(layout) == "~")
 			bcode = bcode ~ "panel.addSpacer();\n";
 		else
 			bcode = bcode ~ parseLayout(layout);
@@ -530,7 +530,7 @@
 panel.endLayout();
 return panel;
 }()`);
-static assert(createLayout("V(c1 ~ c2 H(c3 -) c4)") ==
+static assert(createLayout("V(c1 * c2 H(c3 ~) c4)") ==
 `delegate LayoutPanel() {
 auto panel = new LayoutPanel;
 panel.startLayout(1);