Mercurial > projects > dwt-win
changeset 131:2ea6488981d8
Add convinience methods to show MessageBox as info,warning,error
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 13 Feb 2008 01:33:29 +0100 |
parents | 8e3ca45497b0 |
children | 14df61b39bee |
files | dwt/widgets/MessageBox.d |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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 ); +} }