comparison dwt/layout/FormLayout.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
20 import dwt.widgets.Control; 20 import dwt.widgets.Control;
21 import dwt.widgets.Layout; 21 import dwt.widgets.Layout;
22 import dwt.widgets.Composite; 22 import dwt.widgets.Composite;
23 import dwt.widgets.Scrollable; 23 import dwt.widgets.Scrollable;
24 24
25 import tango.text.Util;
26 import tango.util.Convert; 25 import tango.util.Convert;
27 import Math = tango.math.Math; 26 import Math = tango.math.Math;
27 import dwt.dwthelper.utils;
28 28
29 /** 29 /**
30 * Instances of this class control the position and size of the 30 * Instances of this class control the position and size of the
31 * children of a composite control by using <code>FormAttachments</code> 31 * children of a composite control by using <code>FormAttachments</code>
32 * to optionally configure the left, top, right and bottom edges of 32 * to optionally configure the left, top, right and bottom edges of
258 Object data = control.getLayoutData (); 258 Object data = control.getLayoutData ();
259 if (data !is null) (cast(FormData) data).flushCache (); 259 if (data !is null) (cast(FormData) data).flushCache ();
260 return true; 260 return true;
261 } 261 }
262 262
263 char[] getName () { 263 String getName () {
264 char[] string = this.classinfo.name; 264 String string = this.classinfo.name;
265 int index = locatePrior( string, '.'); 265 int index = string.lastIndexOf('.');
266 if (index is string.length ) return string; 266 if (index is -1 ) return string;
267 return string[ index + 1 .. string.length ]; 267 return string[ index + 1 .. string.length ];
268 } 268 }
269 269
270 /* 270 /*
271 * Computes the preferred height of the form with 271 * Computes the preferred height of the form with
377 * Returns a string containing a concise, human-readable 377 * Returns a string containing a concise, human-readable
378 * description of the receiver. 378 * description of the receiver.
379 * 379 *
380 * @return a string representation of the layout 380 * @return a string representation of the layout
381 */ 381 */
382 override public char[] toString () { 382 override public String toString () {
383 char[] string = getName ()~" {"; 383 String string = getName ()~" {";
384 if (marginWidth !is 0) string ~= "marginWidth="~to!(char[])(marginWidth)~" "; 384 if (marginWidth !is 0) string ~= "marginWidth="~to!(String)(marginWidth)~" ";
385 if (marginHeight !is 0) string ~= "marginHeight="~to!(char[])(marginHeight)~" "; 385 if (marginHeight !is 0) string ~= "marginHeight="~to!(String)(marginHeight)~" ";
386 if (marginLeft !is 0) string ~= "marginLeft="~to!(char[])(marginLeft)~" "; 386 if (marginLeft !is 0) string ~= "marginLeft="~to!(String)(marginLeft)~" ";
387 if (marginRight !is 0) string ~= "marginRight="~to!(char[])(marginRight)~" "; 387 if (marginRight !is 0) string ~= "marginRight="~to!(String)(marginRight)~" ";
388 if (marginTop !is 0) string ~= "marginTop="~to!(char[])(marginTop)~" "; 388 if (marginTop !is 0) string ~= "marginTop="~to!(String)(marginTop)~" ";
389 if (marginBottom !is 0) string ~= "marginBottom="~to!(char[])(marginBottom)~" "; 389 if (marginBottom !is 0) string ~= "marginBottom="~to!(String)(marginBottom)~" ";
390 if (spacing !is 0) string ~= "spacing="~to!(char[])(spacing)~" "; 390 if (spacing !is 0) string ~= "spacing="~to!(String)(spacing)~" ";
391 string = trim( string ); 391 string = string.trim();
392 string ~= "}"; 392 string ~= "}";
393 return string; 393 return string;
394 } 394 }
395 } 395 }