Mercurial > projects > dwt-win
comparison dwt/layout/RowLayout.d @ 48:9a64a7781bab
Added override and alias, first chunk. Thanks torhu for doing this patch.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 03 Feb 2008 01:14:54 +0100 |
parents | 5406a8f6526d |
children | ab60f3309436 |
comparison
equal
deleted
inserted
replaced
47:6940f8be58ba | 48:9a64a7781bab |
---|---|
192 */ | 192 */ |
193 public this (int type) { | 193 public this (int type) { |
194 this.type = type; | 194 this.type = type; |
195 } | 195 } |
196 | 196 |
197 protected Point computeSize (Composite composite, int wHint, int hHint, bool flushCache_) { | 197 override protected Point computeSize (Composite composite, int wHint, int hHint, bool flushCache_) { |
198 Point extent; | 198 Point extent; |
199 if (type is DWT.HORIZONTAL) { | 199 if (type is DWT.HORIZONTAL) { |
200 extent = layoutHorizontal (composite, false, (wHint !is DWT.DEFAULT) && wrap, wHint, flushCache_); | 200 extent = layoutHorizontal (composite, false, (wHint !is DWT.DEFAULT) && wrap, wHint, flushCache_); |
201 } else { | 201 } else { |
202 extent = layoutVertical (composite, false, (hHint !is DWT.DEFAULT) && wrap, hHint, flushCache_); | 202 extent = layoutVertical (composite, false, (hHint !is DWT.DEFAULT) && wrap, hHint, flushCache_); |
214 hHint = data.height; | 214 hHint = data.height; |
215 } | 215 } |
216 return control.computeSize (wHint, hHint, flushCache_); | 216 return control.computeSize (wHint, hHint, flushCache_); |
217 } | 217 } |
218 | 218 |
219 protected bool flushCache (Control control) { | 219 override protected bool flushCache (Control control) { |
220 return true; | 220 return true; |
221 } | 221 } |
222 | 222 |
223 char[] getName () { | 223 char[] getName () { |
224 char[] string = this.classinfo.name; | 224 char[] string = this.classinfo.name; |
225 int index = locatePrior( string, '.'); | 225 int index = locatePrior( string, '.'); |
226 if (index is string.length ) return string; | 226 if (index is string.length ) return string; |
227 return string[ index + 1 .. string.length ]; | 227 return string[ index + 1 .. string.length ]; |
228 } | 228 } |
229 | 229 |
230 protected void layout (Composite composite, bool flushCache_) { | 230 override protected void layout (Composite composite, bool flushCache_) { |
231 Rectangle clientArea = composite.getClientArea (); | 231 Rectangle clientArea = composite.getClientArea (); |
232 if (type is DWT.HORIZONTAL) { | 232 if (type is DWT.HORIZONTAL) { |
233 layoutHorizontal (composite, true, wrap, clientArea.width, flushCache_); | 233 layoutHorizontal (composite, true, wrap, clientArea.width, flushCache_); |
234 } else { | 234 } else { |
235 layoutVertical (composite, true, wrap, clientArea.height, flushCache_); | 235 layoutVertical (composite, true, wrap, clientArea.height, flushCache_); |
454 * Returns a string containing a concise, human-readable | 454 * Returns a string containing a concise, human-readable |
455 * description of the receiver. | 455 * description of the receiver. |
456 * | 456 * |
457 * @return a string representation of the layout | 457 * @return a string representation of the layout |
458 */ | 458 */ |
459 public char[] toString () { | 459 override public char[] toString () { |
460 char[] string = getName ()~" {"; | 460 char[] string = getName ()~" {"; |
461 string ~= "type="~((type !is DWT.HORIZONTAL) ? "DWT.VERTICAL" : "DWT.HORIZONTAL")~" "; | 461 string ~= "type="~((type !is DWT.HORIZONTAL) ? "DWT.VERTICAL" : "DWT.HORIZONTAL")~" "; |
462 if (marginWidth !is 0) string ~= "marginWidth="~to!(char[])(marginWidth)~" "; | 462 if (marginWidth !is 0) string ~= "marginWidth="~to!(char[])(marginWidth)~" "; |
463 if (marginHeight !is 0) string ~= "marginHeight="~to!(char[])(marginHeight)~" "; | 463 if (marginHeight !is 0) string ~= "marginHeight="~to!(char[])(marginHeight)~" "; |
464 if (marginLeft !is 0) string ~= "marginLeft="~to!(char[])(marginLeft)~" "; | 464 if (marginLeft !is 0) string ~= "marginLeft="~to!(char[])(marginLeft)~" "; |