Mercurial > projects > dwt-linux
diff dwt/widgets/MessageBox.d @ 238:380bad9f6852
reverted char[] to String
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:42:55 +0200 |
parents | e3472c527a14 |
children | ce446666f5a2 |
line wrap: on
line diff
--- a/dwt/widgets/MessageBox.d Sat Apr 26 10:01:30 2008 +0200 +++ b/dwt/widgets/MessageBox.d Mon May 05 00:42:55 2008 +0200 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.widgets.MessageBox; +import dwt.dwthelper.utils; + import dwt.DWT; @@ -45,7 +47,7 @@ */ public class MessageBox : Dialog { - char[] message = ""; + String message = ""; GtkWidget* handle; private bool allowNullParent = false; /** @@ -116,7 +118,7 @@ * * @return the message */ -public char[] getMessage () { +public String getMessage () { return message; } @@ -131,7 +133,7 @@ * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> */ -public void setMessage (char[] string) { +public void setMessage (String string) { if (string is null) error (DWT.ERROR_NULL_ARGUMENT); message = string; } @@ -200,9 +202,9 @@ return style; } -char[] fixPercent (char[] string) { +char[] fixPercent (String string) { int i = 0, j = 0; - char [] result = new char[]( string.length * 2 ); + char [] result = new String( string.length * 2 ); while (i < string.length) { switch (string [i]) { case '%': @@ -219,7 +221,7 @@ /++ + DWT extension +/ -public static int showMessageBox(char[] str, char[] title, Shell shell, int style) { +public static int showMessageBox(String str, String title, Shell shell, int style) { MessageBox msgBox = (shell is null ) ? new MessageBox( style ) : new MessageBox(shell, style); msgBox.setMessage(str); if(title !is null){ @@ -229,18 +231,18 @@ } /// DWT extension -public static int showInfo(char[] str, char[] title = null, Shell shell = null) { +public static int showInfo(String str, String title = null, Shell shell = null) { return showMessageBox( str, title, shell, DWT.OK | DWT.ICON_INFORMATION ); } /// DWT extension alias showInfo showInformation; /// DWT extension -public static int showWarning(char[] str, char[] title = null, Shell shell = null) { +public static int showWarning(String str, String title = null, Shell shell = null) { return showMessageBox( str, title, shell, DWT.OK | DWT.ICON_WARNING ); } /// DWT extension -public static int showError(char[] str, char[] title = null, Shell shell = null) { +public static int showError(String str, String title = null, Shell shell = null) { return showMessageBox( str, title, shell, DWT.OK | DWT.ICON_ERROR ); }