Changeset 129:18ca5d3c6dfc

Show
Ignore:
Timestamp:
02/12/08 18:56:11 (10 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Chg to SWT: Allow MessageBox? without parent, when instantiated over special ctor.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • README.txt

    r102 r129  
    4343 
    4444 
     45Changes/Additions to SWT 
     46======================== 
     47  o MessageBox can be instantiated without parent. Use the Ctor "this( int style )", 
     48    calling the other ctors will still force a non-null parent. 
    4549 
    4650 
  • dwt/widgets/MessageBox.d

    r117 r129  
    4343public  class MessageBox : Dialog { 
    4444    char[] message = ""; 
     45    private bool allowNullParent = false; 
    4546 
    4647/** 
     
    8788    super (parent, checkStyle (style)); 
    8889    checkSubclass (); 
     90} 
     91 
     92/** 
     93 * DWT extension, a MessageBox with no parent 
     94 */ 
     95public this (int style) { 
     96    allowNullParent = true; 
     97    super (parent, checkStyle (style)); 
     98    checkSubclass (); 
     99} 
     100// PORT 
     101// actually, the parent can be null 
     102override void checkParent (Shell parent){ 
     103    if( !allowNullParent ){ 
     104        super.checkParent( parent ); 
     105    } 
    89106} 
    90107 
     
    186203    Display display = null; 
    187204    if ((bits & OS.MB_TASKMODAL) !is 0) { 
    188         display = parent.getDisplay (); 
     205        display = ( allowNullParent && parent is null ) ? Display.getCurrent() : parent.getDisplay (); 
    189206        oldModal = display.getModalDialogShell (); 
    190207        display.setModalDialogShell (parent);