comparison dwt/layout/FormData.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 8d7572b6f3f6
children fd9c62a2998e
comparison
equal deleted inserted replaced
211:ff59aeb96cac 212:ab60f3309436
16 import dwt.DWT; 16 import dwt.DWT;
17 import dwt.graphics.Point; 17 import dwt.graphics.Point;
18 import dwt.widgets.Control; 18 import dwt.widgets.Control;
19 import dwt.layout.FormAttachment; 19 import dwt.layout.FormAttachment;
20 20
21 import tango.text.Util;
22 import tango.util.Convert; 21 import tango.util.Convert;
22 import dwt.dwthelper.utils;
23 23
24 /** 24 /**
25 * Instances of this class are used to define the attachments 25 * Instances of this class are used to define the attachments
26 * of a control in a <code>FormLayout</code>. 26 * of a control in a <code>FormLayout</code>.
27 * <p> 27 * <p>
236 } 236 }
237 isVisited = false; 237 isVisited = false;
238 return cacheLeft; 238 return cacheLeft;
239 } 239 }
240 240
241 char[] getName () { 241 String getName () {
242 char[] string = this.classinfo.name; 242 String string = this.classinfo.name;
243 int index = locatePrior( string, '.'); 243 int index = string.lastIndexOf( '.');
244 if (index is string.length ) return string; 244 if (index is -1 ) return string;
245 return string[ index + 1 .. string.length ]; 245 return string[ index + 1 .. string.length ];
246 } 246 }
247 247
248 FormAttachment getRightAttachment (Control control, int spacing, bool flushCache) { 248 FormAttachment getRightAttachment (Control control, int spacing, bool flushCache) {
249 if (cacheRight !is null) return cacheRight; 249 if (cacheRight !is null) return cacheRight;
331 * Returns a string containing a concise, human-readable 331 * Returns a string containing a concise, human-readable
332 * description of the receiver. 332 * description of the receiver.
333 * 333 *
334 * @return a string representation of the FormData object 334 * @return a string representation of the FormData object
335 */ 335 */
336 override public char[] toString () { 336 override public String toString () {
337 char[] string = getName()~" {"; 337 String string = getName()~" {";
338 if (width !is DWT.DEFAULT) string ~= "width="~to!(char[])(width)~" "; 338 if (width !is DWT.DEFAULT) string ~= "width="~to!(String)(width)~" ";
339 if (height !is DWT.DEFAULT) string ~= "height="~to!(char[])(height)~" "; 339 if (height !is DWT.DEFAULT) string ~= "height="~to!(String)(height)~" ";
340 if (left !is null) string ~= "left="~to!(char[])(left)~" "; 340 if (left !is null) string ~= "left="~to!(String)(left)~" ";
341 if (right !is null) string ~= "right="~to!(char[])(right)~" "; 341 if (right !is null) string ~= "right="~to!(String)(right)~" ";
342 if (top !is null) string ~= "top="~to!(char[])(top)~" "; 342 if (top !is null) string ~= "top="~to!(String)(top)~" ";
343 if (bottom !is null) string ~= "bottom="~to!(char[])(bottom)~" "; 343 if (bottom !is null) string ~= "bottom="~to!(String)(bottom)~" ";
344 string = trim( string ); 344 string = string.trim();
345 string ~= "}"; 345 string ~= "}";
346 return string; 346 return string;
347 } 347 }
348 348
349 } 349 }