# HG changeset patch # User Frank Benoit # Date 1205165302 -3600 # Node ID bcdc37794717bfdb77ed4e8355242753993f822c # Parent ee3ee677f5fcfbbaf0d99021f7237134d744581a Reverted changes from previous wrong reverting changes: See: -r026ce3b05f57, -r4d06074bb1af, -rc4643827733c diff -r ee3ee677f5fc -r bcdc37794717 dwt/dwthelper/utils.d --- a/dwt/dwthelper/utils.d Mon Mar 10 17:00:00 2008 +0100 +++ b/dwt/dwthelper/utils.d Mon Mar 10 17:08:22 2008 +0100 @@ -45,6 +45,7 @@ alias ValueWrapperT!(bool) ValueWrapperBool; alias ValueWrapperT!(int) ValueWrapperInt; +alias ValueWrapperT!(long) ValueWrapperLong; alias ArrayWrapperT!(byte) ArrayWrapperByte; alias ArrayWrapperT!(int) ArrayWrapperInt; alias ArrayWrapperT!(Object) ArrayWrapperObject; @@ -320,6 +321,16 @@ return typeid(char[]).getHash(&src); } +public char* toStringzValidPtr( char[] src ){ + if( src ){ + return src.toStringz(); + } + else{ + static const char[] nullPtr = "\0"; + return nullPtr.ptr; + } +} + static char[] toHex(uint value, bool prefix = true, int radix = 8){ return tango.text.convert.Integer.toString( value, diff -r ee3ee677f5fc -r bcdc37794717 dwt/layout/FormAttachment.d --- a/dwt/layout/FormAttachment.d Mon Mar 10 17:00:00 2008 +0100 +++ b/dwt/layout/FormAttachment.d Mon Mar 10 17:08:22 2008 +0100 @@ -185,7 +185,7 @@ * @param offset the offset of the side from the position */ public this (int numerator, int denominator, int offset) { - if (denominator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); + if (denominator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); this.numerator = numerator; this.denominator = denominator; this.offset = offset; @@ -244,7 +244,7 @@ m = n; n = temp; } - while (n != 0){ + while (n !is 0){ temp = m; m = n; n = temp % n; @@ -283,12 +283,12 @@ } int solveX (int value) { - if (denominator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); + if (denominator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); return ((numerator * value) / denominator) + offset; } int solveY (int value) { - if (numerator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); + if (numerator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); return (value - offset) * denominator / numerator; } @@ -298,8 +298,8 @@ * * @return a string representation of the FormAttachment */ -override public char[] toString () { - char[] string = control != null ? control.toString () : Format( "{}/{}", numerator, denominator ); +public override char[] toString () { + char[] string = control !is null ? control.toString () : Format( "{}/{}", numerator, denominator ); return Format("{{y = ({})x + {}}", string, ( offset >= 0 ? Format(")x + {}", offset ) : Format( ")x - {}", -offset))); } diff -r ee3ee677f5fc -r bcdc37794717 dwt/widgets/Label.d --- a/dwt/widgets/Label.d Mon Mar 10 17:00:00 2008 +0100 +++ b/dwt/widgets/Label.d Mon Mar 10 17:08:22 2008 +0100 @@ -395,7 +395,8 @@ public void setText (char[] string) { checkWidget (); if (string is null) error (DWT.ERROR_NULL_ARGUMENT); - if ((style & DWT.SEPARATOR) !is 0) return; + // DWT extensions allow null argument + //if ((style & DWT.SEPARATOR) !is 0) return; /* * Feature in Windows. For some reason, SetWindowText() for * static controls redraws the control, even when the text has