Changeset 60:6423053f6d3e

Show
Ignore:
Timestamp:
02/04/08 08:12:19 (1 year ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

MessageBox?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/widgets/MessageBox.d

    r31 r60  
    1313module dwt.widgets.MessageBox; 
    1414 
    15 import dwt.widgets.Dialog; 
    16 import dwt.widgets.Shell; 
    17  
    18 class MessageBox : Dialog { 
    19     public this (Shell parent, int style) { 
    20         super (parent, style); 
    21     } 
    22 } 
    23 /++ 
    2415import dwt.DWT; 
    2516import dwt.DWTException; 
    2617import dwt.internal.win32.OS; 
    27 import dwt.internal.win32.TCHAR; 
     18 
     19import dwt.widgets.Dialog; 
     20import dwt.widgets.Shell; 
     21import dwt.widgets.Display; 
    2822 
    2923/** 
     
    4741 * </p> 
    4842 */ 
    49 public  class MessageBox extends Dialog { 
    50     String message = ""; 
     43public  class MessageBox : Dialog { 
     44    char[] message = ""; 
    5145 
    5246/** 
     
    6357 * </ul> 
    6458 */ 
    65 public MessageBox (Shell parent) { 
     59public this (Shell parent) { 
    6660    this (parent, DWT.OK | DWT.ICON_INFORMATION | DWT.APPLICATION_MODAL); 
    6761} 
     
    9084 * </ul> 
    9185 */ 
    92 public MessageBox (Shell parent, int style) { 
     86public this (Shell parent, int style) { 
    9387    super (parent, checkStyle (style)); 
    9488    checkSubclass (); 
     
    113107 * @return the message 
    114108 */ 
    115 public String getMessage () { 
     109public char[] getMessage () { 
    116110    return message; 
    117111} 
     
    188182    * parent be temporarily modal. 
    189183    */ 
    190     int hwndOwner = parent !is null ? parent.handle : 0
     184    HWND hwndOwner = parent !is null ? parent.handle : null
    191185    Shell oldModal = null; 
    192186    Display display = null; 
     
    199193    /* Open the message box */ 
    200194    /* Use the character encoding for the default locale */ 
    201     TCHAR buffer1 = new TCHAR (0, message, true); 
    202     TCHAR buffer2 = new TCHAR (0, title, true); 
    203     int code = OS.MessageBox (hwndOwner, buffer1, buffer2, bits); 
     195    TCHAR[] buffer1 = StrToTCHARs (0, message, true); 
     196    TCHAR[] buffer2 = StrToTCHARs (0, title, true); 
     197    int code = OS.MessageBox (hwndOwner, buffer1.ptr, buffer2.ptr, bits); 
    204198 
    205199    /* Clear the temporarily dialog modal parent */ 
     
    254248 * </ul> 
    255249 */ 
    256 public void setMessage (String string) { 
     250public void setMessage (char[] string) { 
    257251    if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    258252    message = string; 
     
    260254 
    261255} 
    262 ++/ 
     256