# HG changeset patch # User Frank Benoit # Date 1202862809 -3600 # Node ID 2ea6488981d8dfea67ac24d81210512427669c62 # Parent 8e3ca45497b08f1ee00235bc78ff8e88806b97cd Add convinience methods to show MessageBox as info,warning,error diff -r 8e3ca45497b0 -r 2ea6488981d8 dwt/widgets/MessageBox.d --- a/dwt/widgets/MessageBox.d Wed Feb 13 01:13:08 2008 +0100 +++ b/dwt/widgets/MessageBox.d Wed Feb 13 01:33:29 2008 +0100 @@ -272,7 +272,7 @@ /** * DWT extension */ -public static int showMessage(char[] str, char[] title = null, Shell shell = null, int style = DWT.OK | DWT.ICON_WARNING) { +public static int showMessageBox(char[] str, char[] title = null, Shell shell = null, int style = DWT.OK | DWT.ICON_WARNING) { MessageBox msgBox = (shell is null ) ? new MessageBox( style ) : new MessageBox(shell, style); msgBox.setMessage(str); if(title !is null){ @@ -282,8 +282,17 @@ } /// DWT extension -alias showMessage showMsg; - +public static int showInfo(char[] str, char[] title = null, Shell shell = null) { + return showMessageBox( str, title, shell, DWT.OK | DWT.ICON_INFORMATION ); +} +/// DWT extension +public static int showWarning(char[] str, char[] 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) { + return showMessageBox( str, title, shell, DWT.OK | DWT.ICON_ERROR ); +} }