Mercurial > projects > dwt-win
comparison dwt/layout/RowData.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 | fd9c62a2998e |
comparison
equal
deleted
inserted
replaced
211:ff59aeb96cac | 212:ab60f3309436 |
---|---|
14 | 14 |
15 import dwt.DWT; | 15 import dwt.DWT; |
16 import dwt.graphics.Point; | 16 import dwt.graphics.Point; |
17 import dwt.widgets.Control; | 17 import dwt.widgets.Control; |
18 | 18 |
19 import tango.text.Util; | |
20 import tango.util.Convert; | 19 import tango.util.Convert; |
20 import dwt.dwthelper.utils; | |
21 | 21 |
22 /** | 22 /** |
23 * Each control controlled by a <code>RowLayout</code> can have its initial | 23 * Each control controlled by a <code>RowLayout</code> can have its initial |
24 * width and height specified by setting a <code>RowData</code> object | 24 * width and height specified by setting a <code>RowData</code> object |
25 * into the control. | 25 * into the control. |
103 */ | 103 */ |
104 public this (Point point) { | 104 public this (Point point) { |
105 this (point.x, point.y); | 105 this (point.x, point.y); |
106 } | 106 } |
107 | 107 |
108 char[] getName () { | 108 String getName () { |
109 char[] string = this.classinfo.name; | 109 String string = this.classinfo.name; |
110 int index = locatePrior( string, '.'); | 110 int index = string.lastIndexOf('.'); |
111 if (index is string.length ) return string; | 111 if (index is -1 ) return string; |
112 return string[ index + 1 .. string.length ]; | 112 return string[ index + 1 .. string.length ]; |
113 } | 113 } |
114 | 114 |
115 /** | 115 /** |
116 * Returns a string containing a concise, human-readable | 116 * Returns a string containing a concise, human-readable |
117 * description of the receiver. | 117 * description of the receiver. |
118 * | 118 * |
119 * @return a string representation of the RowData object | 119 * @return a string representation of the RowData object |
120 */ | 120 */ |
121 override public char[] toString () { | 121 override public String toString () { |
122 char[] string = getName ()~" {"; | 122 String string = getName ()~" {"; |
123 if (width !is DWT.DEFAULT) string ~= "width="~to!(char[])(width)~" "; | 123 if (width !is DWT.DEFAULT) string ~= "width="~to!(String)(width)~" "; |
124 if (height !is DWT.DEFAULT) string ~= "height="~to!(char[])(height)~" "; | 124 if (height !is DWT.DEFAULT) string ~= "height="~to!(String)(height)~" "; |
125 if (exclude) string ~= "exclude="~to!(char[])(exclude)~" "; | 125 if (exclude) string ~= "exclude="~to!(String)(exclude)~" "; |
126 string = trim( string ); | 126 string = string.trim(); |
127 string ~= "}"; | 127 string ~= "}"; |
128 return string; | 128 return string; |
129 } | 129 } |
130 } | 130 } |