Mercurial > projects > dwt-mac
diff dwt/graphics/Color.d @ 36:db5a898b2119
Fixed a lot of compile errors
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 07 Oct 2008 12:56:18 +0200 |
parents | 5123b17c98ef |
children | d8635bb48c7c |
line wrap: on
line diff
--- a/dwt/graphics/Color.d Sun Sep 14 23:32:29 2008 +0200 +++ b/dwt/graphics/Color.d Tue Oct 07 12:56:18 2008 +0200 @@ -17,6 +17,8 @@ import dwt.DWT; import dwt.DWTException; +import tango.text.convert.Format; + import dwt.dwthelper.utils; import dwt.graphics.Device; import dwt.graphics.Resource; @@ -38,6 +40,9 @@ * @see Device#getSystemColor */ public final class Color : Resource { + + alias Resource.init_ init_; + /** * the handle to the OS color resource * (Warning: This field is platform dependent) @@ -80,8 +85,8 @@ */ public this(Device device, int red, int green, int blue) { super(device); - init(red, green, blue); - init(); + init_(red, green, blue); + init_(); } /** @@ -109,8 +114,8 @@ public this(Device device, RGB rgb) { super(device); if (rgb is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); - init(rgb.red, rgb.green, rgb.blue); - init(); + init_(rgb.red, rgb.green, rgb.blue); + init_(); } void destroy() { @@ -235,7 +240,7 @@ return color; } -void init(int red, int green, int blue) { +void init_(int red, int green, int blue) { if ((red > 255) || (red < 0) || (green > 255) || (green < 0) || (blue > 255) || (blue < 0)) { @@ -271,7 +276,7 @@ */ public String toString () { if (isDisposed()) return "Color {*DISPOSED*}"; - return "Color {" ~ getRed() ~ ", " ~ getGreen() ~ ", " ~ getBlue() + "}"; + return Format("Color {{}{}{}{}{}{}" , getRed() , ", " , getGreen() , ", " , getBlue() , "}"); } }