Mercurial > projects > dwt2
comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/StackLayout.d @ 9:950d84783eac
Removing direct tango deps.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 09 Mar 2009 14:26:40 +0100 |
parents | 6dd524f61e62 |
children | 536e43f63c81 |
comparison
equal
deleted
inserted
replaced
8:2847134a5fc0 | 9:950d84783eac |
---|---|
12 *******************************************************************************/ | 12 *******************************************************************************/ |
13 module org.eclipse.swt.custom.StackLayout; | 13 module org.eclipse.swt.custom.StackLayout; |
14 | 14 |
15 import java.lang.all; | 15 import java.lang.all; |
16 | 16 |
17 | |
18 | |
19 import org.eclipse.swt.SWT; | 17 import org.eclipse.swt.SWT; |
20 import org.eclipse.swt.graphics.Point; | 18 import org.eclipse.swt.graphics.Point; |
21 import org.eclipse.swt.graphics.Rectangle; | 19 import org.eclipse.swt.graphics.Rectangle; |
22 import org.eclipse.swt.widgets.Composite; | 20 import org.eclipse.swt.widgets.Composite; |
23 import org.eclipse.swt.widgets.Control; | 21 import org.eclipse.swt.widgets.Control; |
24 import org.eclipse.swt.widgets.Layout; | 22 import org.eclipse.swt.widgets.Layout; |
25 | |
26 import tango.util.Convert; | |
27 static import tango.text.Util; | |
28 | 23 |
29 /** | 24 /** |
30 * This Layout stacks all the controls one on top of the other and resizes all controls | 25 * This Layout stacks all the controls one on top of the other and resizes all controls |
31 * to have the same size and location. | 26 * to have the same size and location. |
32 * The control specified in topControl is visible and all other controls are not visible. | 27 * The control specified in topControl is visible and all other controls are not visible. |
134 } | 129 } |
135 } | 130 } |
136 | 131 |
137 String getName () { | 132 String getName () { |
138 String string = this.classinfo.name; | 133 String string = this.classinfo.name; |
139 int index = tango.text.Util.locatePrior( string ,'.'); | 134 int index = string.lastIndexOf ('.'); |
140 if (index is string.length ) return string; | 135 if (index is -1 ) return string; |
141 return string[ index + 1 .. $ ]; | 136 return string.substring (index + 1, string.length ); |
142 } | 137 } |
143 | 138 |
144 /** | 139 /** |
145 * Returns a string containing a concise, human-readable | 140 * Returns a string containing a concise, human-readable |
146 * description of the receiver. | 141 * description of the receiver. |
147 * | 142 * |
148 * @return a string representation of the layout | 143 * @return a string representation of the layout |
149 */ | 144 */ |
150 public override String toString () { | 145 public override String toString () { |
151 String string = getName ()~" {"; | 146 String string = getName ()~" {"; |
152 if (marginWidth !is 0) string ~= "marginWidth="~to!(String)(marginWidth)~" "; | 147 if (marginWidth !is 0) string ~= "marginWidth="~String_valueOf(marginWidth)~" "; |
153 if (marginHeight !is 0) string ~= "marginHeight="~to!(String)(marginHeight)~" "; | 148 if (marginHeight !is 0) string ~= "marginHeight="~String_valueOf(marginHeight)~" "; |
154 if (topControl !is null) string ~= "topControl="~to!(String)(topControl)~" "; | 149 if (topControl !is null) string ~= "topControl="~String_valueOf(topControl)~" "; |
155 string = tango.text.Util.trim(string); | 150 string = string.trim(); |
156 string ~= "}"; | 151 string ~= "}"; |
157 return string; | 152 return string; |
158 } | 153 } |
159 } | 154 } |