Mercurial > projects > dwt-win
diff dwt/layout/RowLayout.d @ 212:ab60f3309436
reverted the char[] to String and use the an alias.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:12:38 +0200 |
parents | 9a64a7781bab |
children | 36f5cb12e1a2 |
line wrap: on
line diff
--- a/dwt/layout/RowLayout.d Sat Apr 26 10:01:48 2008 +0200 +++ b/dwt/layout/RowLayout.d Mon May 05 00:12:38 2008 +0200 @@ -19,9 +19,9 @@ import dwt.widgets.Layout; import dwt.widgets.Composite; import dwt.layout.RowData; -import tango.text.Util; import tango.util.Convert; import Math = tango.math.Math; +import dwt.dwthelper.utils; /** @@ -220,10 +220,10 @@ return true; } -char[] getName () { - char[] string = this.classinfo.name; - int index = locatePrior( string, '.'); - if (index is string.length ) return string; +String getName () { + String string = this.classinfo.name; + int index = string.lastIndexOf('.'); + if (index is -1 ) return string; return string[ index + 1 .. string.length ]; } @@ -456,21 +456,21 @@ * * @return a string representation of the layout */ -override public char[] toString () { - char[] string = getName ()~" {"; +override public String toString () { + String string = getName ()~" {"; string ~= "type="~((type !is DWT.HORIZONTAL) ? "DWT.VERTICAL" : "DWT.HORIZONTAL")~" "; - if (marginWidth !is 0) string ~= "marginWidth="~to!(char[])(marginWidth)~" "; - if (marginHeight !is 0) string ~= "marginHeight="~to!(char[])(marginHeight)~" "; - if (marginLeft !is 0) string ~= "marginLeft="~to!(char[])(marginLeft)~" "; - if (marginTop !is 0) string ~= "marginTop="~to!(char[])(marginTop)~" "; - if (marginRight !is 0) string ~= "marginRight="~to!(char[])(marginRight)~" "; - if (marginBottom !is 0) string ~= "marginBottom="~to!(char[])(marginBottom)~" "; - if (spacing !is 0) string ~= "spacing="~to!(char[])(spacing)~" "; - string ~= "wrap="~to!(char[])(wrap)~" "; - string ~= "pack="~to!(char[])(pack)~" "; - string ~= "fill="~to!(char[])(fill)~" "; - string ~= "justify="~to!(char[])(justify)~" "; - string = trim( string ); + if (marginWidth !is 0) string ~= "marginWidth="~to!(String)(marginWidth)~" "; + if (marginHeight !is 0) string ~= "marginHeight="~to!(String)(marginHeight)~" "; + if (marginLeft !is 0) string ~= "marginLeft="~to!(String)(marginLeft)~" "; + if (marginTop !is 0) string ~= "marginTop="~to!(String)(marginTop)~" "; + if (marginRight !is 0) string ~= "marginRight="~to!(String)(marginRight)~" "; + if (marginBottom !is 0) string ~= "marginBottom="~to!(String)(marginBottom)~" "; + if (spacing !is 0) string ~= "spacing="~to!(String)(spacing)~" "; + string ~= "wrap="~to!(String)(wrap)~" "; + string ~= "pack="~to!(String)(pack)~" "; + string ~= "fill="~to!(String)(fill)~" "; + string ~= "justify="~to!(String)(justify)~" "; + string = string.trim(); string ~= "}"; return string; }