Changeset 18

Show
Ignore:
Timestamp:
05/25/04 12:16:20 (5 years ago)
Author:
andy
Message:

Fixed a few issues related to MoveMemory?. Compiling dwt.widgets.button couses a compiler crash now. eep.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.1/src/dwt/graphics/gc.d

    r17 r18  
    11/******************************************************************************* 
    22 * Copyright (c) 2000, 2003 IBM Corporation and others. 
    3  * All rights reserved. This program and the accompanying materials  
     3 * All rights reserved. This program and the accompanying materials 
    44 * are made available under the terms of the Common Public License v1.0 
    55 * which accompanies this distribution, and is available at 
    66 * http://www.eclipse.org/legal/cpl-v10.html 
    7  *  
     7 * 
    88 * Contributors: 
    99 *     IBM Corporation - initial API and implementation 
     
    1212/******************************************************************************* 
    1313 * DWT: SWT port for the D Language 
    14  *  
     14 * 
    1515 * Contributors: 
    1616 *  The DWT team at http://www.dsource.org/projects/dwt 
    17  *  
     17 * 
    1818 *******************************************************************************/ 
    1919 
     
    5050    import dwt.internal.win32.tchar; 
    5151    import dwt.internal.win32.types; 
    52      
     52 
    5353    import dwt.util.util; 
    5454 
     
    811811        } 
    812812    } 
    813    OS.MoveMemory(srcData, dibBM.bmBits, sizeInBytes)
     813        srcData[0 .. sizeInBytes] = dibBM.bmBits[0 .. sizeInBytes]
    814814 
    815815    /* Compose the pixels */ 
     
    828828 
    829829    /* Draw the composed pixels */ 
    830    OS.MoveMemory(dibBM.bmBits, destData, sizeInBytes)
     830        dibBM.bmBits[0 .. sizeInBytes] = destData[0 .. sizeInBytes]
    831831    OS.BitBlt(handle, destX, destY, destWidth, destHeight, memHdc, 0, 0, OS.SRCCOPY); 
    832832 
  • branches/0.1/src/dwt/graphics/image.d

    r17 r18  
    11/******************************************************************************* 
    22 * Copyright (c) 2000, 2003 IBM Corporation and others. 
    3  * All rights reserved. This program and the accompanying materials  
     3 * All rights reserved. This program and the accompanying materials 
    44 * are made available under the terms of the Common Public License v1.0 
    55 * which accompanies this distribution, and is available at 
    66 * http://www.eclipse.org/legal/cpl-v10.html 
    7  *  
     7 * 
    88 * Contributors: 
    99 *     IBM Corporation - initial API and implementation 
     
    1212/******************************************************************************* 
    1313 * DWT: SWT port for the D Language 
    14  *  
     14 * 
    1515 * Contributors: 
    1616 *  The DWT team at http://www.dsource.org/projects/dwt 
    17  *  
     17 * 
    1818 *******************************************************************************/ 
    1919 
     
    11051105            if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    11061106            OS.GetDIBits(hBitmapDC, hBitmap, 0, height, null, bmiHeader, OS.DIB_RGB_COLORS); 
    1107             OS.MoveMemory(bmiHeader, bmi, BITMAPINFOHEADER.sizeof); 
    11081107            imageSize = bmiHeader.biSizeImage; 
    11091108            auto byte[] data = new byte[imageSize]; 
  • branches/0.1/src/dwt/internal/win32/os.d

    r17 r18  
    11/******************************************************************************* 
    22 * Copyright (c) 2000, 2003 IBM Corporation and others. 
    3  * All rights reserved. This program and the accompanying materials  
     3 * All rights reserved. This program and the accompanying materials 
    44 * are made available under the terms of the Common Public License v1.0 
    55 * which accompanies this distribution, and is available at 
    66 * http://www.eclipse.org/legal/cpl-v10.html 
    7  *  
     7 * 
    88 * Contributors: 
    99 *     IBM Corporation - initial API and implementation 
     
    1212/******************************************************************************* 
    1313 * DWT: SWT port for the D Language 
    14  *  
     14 * 
    1515 * Contributors: 
    1616 *  The DWT team at http://www.dsource.org/projects/dwt 
    17  *  
     17 * 
    1818 *******************************************************************************/ 
    1919 
     
    18021802} 
    18031803 
    1804 static void MoveMemory (TCHAR Destination, int Source, int Length) { 
     1804static void MoveMemory (TCHAR Destination, void* Source, int Length) { 
    18051805    if (IsUnicode) { 
    18061806        wchar* Destination1 = w_str(Destination); 
     
    23972397     +  (Andy's work, maybe?) 
    23982398     +/ 
    2399       
     2399 
    24002400    // :P 
    24012401    //void MoveMemory(void* destination, void* source, int length); 
     
    24512451    void MoveMemory(int DestinationPtr, float[] Source, int Length); 
    24522452    void MoveMemory(int DestinationPtr, short[] Source, int Length); 
    2453      
    2454      
     2453 
     2454 
    24552455    bool MoveToEx (int hdc,int x1, int x2, int lPoint); 
    24562456    int MsgWaitForMultipleObjectsEx (int nCount, int pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags); 
  • branches/0.1/src/dwt/widgets/decorations.d

    r17 r18  
    11/******************************************************************************* 
    22 * Copyright (c) 2000, 2003 IBM Corporation and others. 
    3  * All rights reserved. This program and the accompanying materials  
     3 * All rights reserved. This program and the accompanying materials 
    44 * are made available under the terms of the Common Public License v1.0 
    55 * which accompanies this distribution, and is available at 
    66 * http://www.eclipse.org/legal/cpl-v10.html 
    7  *  
     7 * 
    88 * Contributors: 
    99 *     IBM Corporation - initial API and implementation 
     
    1212/******************************************************************************* 
    1313 * DWT: SWT port for the D Language 
    14  *  
     14 * 
    1515 * Contributors: 
    1616 *  The DWT team at http://www.dsource.org/projects/dwt 
    17  *  
     17 * 
    1818 *******************************************************************************/ 
    1919 
     
    3737 * and is a subclass. 
    3838 * <p> 
    39  * Instances are always displayed in one of the maximized,  
     39 * Instances are always displayed in one of the maximized, 
    4040 * minimized or normal states: 
    4141 * <ul> 
     
    4444 * window manager will typically resize it to fill the 
    4545 * entire visible area of the display, and the instance 
    46  * is usually put in a state where it can not be resized  
     46 * is usually put in a state where it can not be resized 
    4747 * (even if it has style <code>RESIZE</code>) until it is 
    4848 * no longer maximized. 
     
    8282 * <dd> 
    8383 * the result of combining the constants which are required 
    84  * to produce a typical application top level shell: (that  
     84 * to produce a typical application top level shell: (that 
    8585 * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>) 
    8686 * </dd> 
     
    8888 * <dd> 
    8989 * the result of combining the constants which are required 
    90  * to produce a typical application dialog shell: (that  
     90 * to produce a typical application dialog shell: (that 
    9191 * is, <code>TITLE | CLOSE | BORDER</code>) 
    9292 * </dd> 
     
    106106 
    107107    private import dwt.dwt; 
    108      
     108 
    109109    private import dwt.graphics.image; 
    110110    private import dwt.graphics.point; 
    111111    private import dwt.graphics.rectangle; 
    112      
     112 
    113113    private import dwt.internal.win32.os; 
    114114    private import dwt.internal.win32.types; 
    115      
     115 
    116116    private import dwt.util.util; 
    117      
     117 
    118118    private import dwt.widgets.menu; 
    119119    private import dwt.widgets.menuitem; 
     
    121121    private import dwt.widgets.button; 
    122122    private import dwt.widgets.shell; 
    123      
     123        private import dwt.widgets.composite; 
     124 
    124125    OS os; 
    125126    Image image, smallImage, largeImage; 
     
    131132    Button defaultButton, saveDefault; 
    132133    int swFlags, hAccel, nAccel; 
    133      
     134 
    134135    /* 
    135136    * The start value for WM_COMMAND id's. 
    136137    * Windows reserves the values 0..100. 
    137     *  
     138    * 
    138139    * The SmartPhone DWT resource file reserves 
    139140    * the values 101..107. 
     
    152153 * The style value is either one of the style constants defined in 
    153154 * class <code>DWT</code> which is applicable to instances of this 
    154  * class, or must be built by <em>bitwise OR</em>'ing together  
     155 * class, or must be built by <em>bitwise OR</em>'ing together 
    155156 * (that is, using the <code>int</code> "|" operator) two or more 
    156157 * of those <code>DWT</code> style constants. The class description 
     
    230231    */ 
    231232//  if ((style & DWT.ON_TOP) != 0) { 
    232 //      int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE;  
     233//      int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE; 
    233234//      OS.SetWindowPos (handle, OS.HWND_TOP, 0, 0, 0, 0, flags); 
    234235//  } else { 
     
    256257    */ 
    257258    if ((style & (DWT.MIN | DWT.MAX)) != 0) style |= DWT.CLOSE; 
    258      
     259 
    259260    /* 
    260261    * Both WS_SYSMENU and WS_CAPTION must be set in order 
     
    262263    */ 
    263264    if ((style & DWT.CLOSE) != 0) style |= DWT.TITLE; 
    264      
     265 
    265266    /* 
    266267    * Bug in Windows.  The WS_CAPTION style must be 
     
    277278    */ 
    278279//  if ((style & DWT.RESIZE) != 0) style |= DWT.TITLE; 
    279      
     280 
    280281    return style; 
    281282} 
     
    337338    int size = ACCEL.sizeof; 
    338339    ACCEL accel; 
    339     byte [] buffer1 = new byte [size];  
     340    byte [] buffer1 = new byte [size]; 
    340341    byte [] buffer2 = new byte [maxAccel * size]; 
    341342    if (menuBar != null && items != null) { 
     
    357358    } 
    358359    if (OS.IsPPC) { 
    359         /*  
     360        /* 
    360361        * Note on WinCE PPC.  Close the shell when user taps CTRL-Q. 
    361362        * IDOK represents the "Done Button" which also closes the shell. 
     
    366367        OS.MoveMemory (buffer1, accel, size); 
    367368        System.arraycopy (buffer1, 0, buffer2, nAccel * size, size); 
    368         nAccel++;           
     369        nAccel++; 
    369370    } 
    370371    if (nAccel != 0) hAccel = OS.CreateAcceleratorTable (buffer2, nAccel); 
     
    459460public Rectangle getClientArea () { 
    460461    checkWidget (); 
    461     /*  
     462    /* 
    462463    * Note: The CommandBar is part of the client area, 
    463464    * not the trim.  Applications don't expect this so 
     
    509510 
    510511/** 
    511  * Returns the receiver's image if it had previously been  
     512 * Returns the receiver's image if it had previously been 
    512513 * set using <code>setImage()</code>. The image is typically 
    513514 * displayed by the window manager when the instance is 
     
    521522 * even if one exists. 
    522523 * </p> 
    523  *  
     524 * 
    524525 * @return the image 
    525526 * 
     
    535536 
    536537/** 
    537  * Returns the receiver's images if they had previously been  
     538 * Returns the receiver's images if they had previously been 
    538539 * set using <code>setImages()</code>. Images are typically 
    539540 * displayed by the window manager when the instance is 
     
    544545 * the array will contain the same icon rendered at different 
    545546 * resolutions. 
    546  *  
     547 * 
    547548 * <p> 
    548549 * Note: This method will return an empty array if called before 
     
    551552 * even if one exists. 
    552553 * </p> 
    553  *  
     554 * 
    554555 * @return the images 
    555556 * 
     
    558559 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
    559560 * </ul> 
    560  *  
     561 * 
    561562 * @since 3.0 
    562563 */ 
     
    581582/** 
    582583 * Returns <code>true</code> if the receiver is currently 
    583  * maximized, and false otherwise.  
     584 * maximized, and false otherwise. 
    584585 * <p> 
    585586 * 
     
    618619/** 
    619620 * Returns <code>true</code> if the receiver is currently 
    620  * minimized, and false otherwise.  
     621 * minimized, and false otherwise. 
    621622 * <p> 
    622623 * 
     
    663664 * Returns the receiver's text, which is the string that the 
    664665 * window manager will typically display as the receiver's 
    665  * <em>title</em>. If the text has not previously been set,  
     666 * <em>title</em>. If the text has not previously been set, 
    666667 * returns an empty string. 
    667668 * 
     
    796797 * button to the argument, and if the argument is null, sets 
    797798 * the receiver's default button to the first button which 
    798  * was set as the receiver's default button (called the  
     799 * was set as the receiver's default button (called the 
    799800 * <em>saved default button</em>). If no default button had 
    800801 * previously been set, or the saved default button was 
    801802 * disposed, the receiver's default button will be set to 
    802  * null.  
     803 * null. 
    803804 * 
    804805 * @param the new default button 
    805806 * 
    806807 * @exception IllegalArgumentException <ul> 
    807  *    <li>ERROR_INVALID_ARGUMENT - if the button has been disposed</li>  
     808 *    <li>ERROR_INVALID_ARGUMENT - if the button has been disposed</li> 
    808809 * </ul> 
    809810 * @exception SWTException <ul> 
     
    845846 * may also be displayed somewhere in the trim when the 
    846847 * instance is in normal or maximized states. 
    847  *  
     848 * 
    848849 * @param image the new image (or null) 
    849850 * 
    850851 * @exception IllegalArgumentException <ul> 
    851  *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>  
     852 *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> 
    852853 * </ul> 
    853854 * @exception SWTException <ul> 
     
    870871    * later free the icon, thus freeing the icon for every window. 
    871872    * The fix is to avoid the API. 
    872     *  
     873    * 
    873874    * On WinCE PPC, icons in windows are not displayed anyways. 
    874875    */ 
     
    884885        smallWidth = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXSMICON)); 
    885886        smallIcon = image; 
    886         largeWidth = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON));  
     887        largeWidth = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON)); 
    887888        largeIcon = image; 
    888889    } 
     
    930931    } 
    931932    OS.SendMessage (handle, OS.WM_SETICON, OS.ICON_BIG, hLargeIcon); 
    932      
     933 
    933934    /* 
    934935    * Bug in Windows.  When WM_SETICON is used to remove an 
     
    955956 * the "best" size. It is expected that the array will contain 
    956957 * the same icon rendered at different resolutions. 
    957  *  
     958 * 
    958959 * @param images the new image array 
    959960 * 
     
    966967 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
    967968 * </ul> 
    968  *  
     969 * 
    969970 * @since 3.0 
    970971 */ 
     
    10341035            } 
    10351036            int flags = OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE; 
    1036             OS.SetWindowPos (handle, 0, rect.left, rect.top, width, height, flags);     
     1037            OS.SetWindowPos (handle, 0, rect.left, rect.top, width, height, flags); 
    10371038        } else { 
    10381039            if ((style & DWT.NO_TRIM) == 0) { 
     
    10601061 * 
    10611062 * @exception IllegalArgumentException <ul> 
    1062  *    <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li>  
     1063 *    <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li> 
    10631064 *    <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li> 
    10641065 * </ul> 
     
    10751076        if ((menu.style & DWT.BAR) == 0) error (DWT.ERROR_MENU_NOT_BAR); 
    10761077        if (menu.parent != this) error (DWT.ERROR_INVALID_PARENT); 
    1077     }   
     1078    } 
    10781079    if (OS.IsWinCE) { 
    10791080        if (OS.IsHPC) { 
     
    11041105                if (menuBar != null) OS.ShowWindow (menuBar.hwndCB, OS.SW_SHOW); 
    11051106            } 
    1106         }  
     1107        } 
    11071108    } else { 
    11081109        if (menu != null) display.removeBar (menu); 
     
    11701171    OS.SetWindowLong (handle, OS.GWL_STYLE, bits | OS.WS_POPUP); 
    11711172    OS.SetWindowLong (handle, OS.GWL_ID, 0); 
    1172     int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE;  
     1173    int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE; 
    11731174    OS.SetWindowPos (handle, OS.HWND_BOTTOM, 0, 0, 0, 0, flags); 
    11741175    display.lockActiveWindow = false; 
     
    12271228    } 
    12281229    int newCount = OS.GetMenuItemCount (hMenu); 
    1229     if ((style & DWT.CLOSE) == 0 || newCount != oldCount) {     
     1230    if ((style & DWT.CLOSE) == 0 || newCount != oldCount) { 
    12301231        OS.DeleteMenu (hMenu, OS.SC_TASKLIST, OS.MF_BYCOMMAND); 
    12311232        MENUITEMINFO info = new MENUITEMINFO (); 
     
    12511252 * Sets the receiver's text, which is the string that the 
    12521253 * window manager will typically display as the receiver's 
    1253  * <em>title</em>, to the argument, which may not be null.  
     1254 * <em>title</em>, to the argument, which may not be null. 
    12541255 * 
    12551256 * @param string the new text 
     
    14371438 
    14381439int widgetStyle () { 
    1439     /*  
     1440    /* 
    14401441    * Clear WS_VISIBLE and WS_TABSTOP.  NOTE: In Windows, WS_TABSTOP 
    14411442    * has the same value as WS_MAXIMIZEBOX so these bits cannot be 
     
    14431444    */ 
    14441445    int bits = super.widgetStyle () & ~(OS.WS_TABSTOP | OS.WS_VISIBLE); 
    1445      
     1446 
    14461447    /* Set the title bits and no-trim bits */ 
    14471448    bits &= ~OS.WS_BORDER; 
    14481449    if ((style & DWT.NO_TRIM) != 0) return bits; 
    14491450    if ((style & DWT.TITLE) != 0) bits |= OS.WS_CAPTION; 
    1450      
     1451 
    14511452    /* Set the min and max button bits */ 
    14521453    if ((style & DWT.MIN) != 0) bits |= OS.WS_MINIMIZEBOX; 
    14531454    if ((style & DWT.MAX) != 0) bits |= OS.WS_MAXIMIZEBOX; 
    1454      
     1455 
    14551456    /* Set the resize, dialog border or border bits */ 
    14561457    if ((style & DWT.RESIZE) != 0) { 
     
    14601461        * It does not set the WS_THICKFRAME style. 
    14611462        */ 
    1462         if (!OS.IsPPC) bits |= OS.WS_THICKFRAME;    
     1463        if (!OS.IsPPC) bits |= OS.WS_THICKFRAME; 
    14631464    } else { 
    14641465        if ((style & DWT.BORDER) == 0) bits |= OS.WS_BORDER; 
     
    14691470        if ((style & DWT.CLOSE) != 0) bits |= OS.WS_SYSMENU; 
    14701471    } 
    1471      
     1472 
    14721473    return bits; 
    14731474} 
     
    15111512+/ 
    15121513 
    1513         if (restoreFocus ()) return LRESULT.ZERO;   
     1514        if (restoreFocus ()) return LRESULT.ZERO; 
    15141515    } else { 
    15151516        /* 
     
    15541555        * Feature on WinCE SP.  The Back key is either used to close 
    15551556        * the foreground Dialog or used as a regular Back key in an EDIT 
    1556         * control. The article 'Back Key' in MSDN for Smartphone  
    1557         * describes how an application should handle it.  The  
     1557        * control. The article 'Back Key' in MSDN for Smartphone 
     1558        * describes how an application should handle it.  The 
    15581559        * workaround is to override the Back key when creating 
    15591560        * the menubar and handle it based on the style of the Shell. 
  • branches/0.1/src/dwt/widgets/shell.d

    r17 r18  
    11/******************************************************************************* 
    22 * Copyright (c) 2000, 2003 IBM Corporation and others. 
    3  * All rights reserved. This program and the accompanying materials  
     3 * All rights reserved. This program and the accompanying materials 
    44 * are made available under the terms of the Common Public License v1.0 
    55 * which accompanies this distribution, and is available at 
    66 * http://www.eclipse.org/legal/cpl-v10.html 
    7  *  
     7 * 
    88 * Contributors: 
    99 *     IBM Corporation - initial API and implementation 
     
    1212/******************************************************************************* 
    1313 * DWT: SWT port for the D Language 
    14  *  
     14 * 
    1515 * Contributors: 
    1616 *  The DWT team at http://www.dsource.org/projects/dwt 
    17  *  
     17 * 
    1818 *******************************************************************************/ 
    1919 
     
    2222module dwt.widgets.shell; 
    2323 
    24 /+  
     24/+ 
    2525import org.eclipse.swt.internal.win32.*; 
    2626import org.eclipse.swt.*; 
     
    3333private import dwt.internal.win32.os; 
    3434private import dwt.internal.win32.types; 
     35private import dwt.internal.win32.tchar; 
    3536 
    3637private import dwt.widgets.control; 
     
    4344 * which the desktop or "window manager" is managing. 
    4445 * Instances that do not have a parent (that is, they 
    45  * are built using the constructor, which takes a  
     46 * are built using the constructor, which takes a 
    4647 * <code>Display</code> as the argument) are described 
    4748 * as <em>top level</em> shells. Instances that do have 
     
    4950 * <em>dialog</em> shells. 
    5051 * <p> 
    51  * Instances are always displayed in one of the maximized,  
     52 * Instances are always displayed in one of the maximized, 
    5253 * minimized or normal states: 
    5354 * <ul> 
     
    5657 * window manager will typically resize it to fill the 
    5758 * entire visible area of the display, and the instance 
    58  * is usually put in a state where it can not be resized  
     59 * is usually put in a state where it can not be resized 
    5960 * (even if it has style <code>RESIZE</code>) until it is 
    6061 * no longer maximized. 
     
    100101 * <dd> 
    101102 * the result of combining the constants which are required 
    102  * to produce a typical application top level shell: (that  
     103 * to produce a typical application top level shell: (that 
    103104 * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>) 
    104105 * </dd> 
     
    106107 * <dd> 
    107108 * the result of combining the constants which are required 
    108  * to produce a typical application dialog shell: (that  
     109 * to produce a typical application dialog shell: (that 
    109110 * is, <code>TITLE | CLOSE | BORDER</code>) 
    110111 * </dd> 
     
    112113 * </p> 
    113114 * <p> 
    114  * Note: Only one of the styles APPLICATION_MODAL, MODELESS,  
     115 * Note: Only one of the styles APPLICATION_MODAL, MODELESS, 
    115116 * PRIMARY_MODAL and SYSTEM_MODAL may be specified. 
    116117 * </p><p> 
     
    165166 * The style value is either one of the style constants defined in 
    166167 * class <code>DWT</code> which is applicable to instances of this 
    167  * class, or must be built by <em>bitwise OR</em>'ing together  
     168 * class, or must be built by <em>bitwise OR</em>'ing together 
    168169 * (that is, using the <code>int</code> "|" operator) two or more 
    169170 * of those <code>DWT</code> style constants. The class description 
     
    178179 *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> 
    179180 * </ul> 
    180  *  
     181 * 
    181182 * @see DWT#BORDER 
    182183 * @see DWT#CLOSE 
     
    203204 * Note: Currently, null can be passed in for the display argument. 
    204205 * This has the effect of creating the shell on the currently active 
    205  * display if there is one. If there is no current display, the  
     206 * display if there is one. If there is no current display, the 
    206207 * shell is created on a "default" display. <b>Passing in null as 
    207208 * the display argument is not considered to be good coding style, 
     
    227228 * The style value is either one of the style constants defined in 
    228229 * class <code>DWT</code> which is applicable to instances of this 
    229  * class, or must be built by <em>bitwise OR</em>'ing together  
     230 * class, or must be built by <em>bitwise OR</em>'ing together 
    230231 * (that is, using the <code>int</code> "|" operator) two or more 
    231232 * of those <code>DWT</code> style constants. The class description 
     
    235236 * Note: Currently, null can be passed in for the display argument. 
    236237 * This has the effect of creating the shell on the currently active 
    237  * display if there is one. If there is no current display, the  
     238 * display if there is one. If there is no current display, the 
    238239 * shell is created on a "default" display. <b>Passing in null as 
    239240 * the display argument is not considered to be good coding style, 
     
    248249 *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> 
    249250 * </ul> 
    250  *  
     251 * 
    251252 * @see DWT#BORDER 
    252253 * @see DWT#CLOSE 
     
    288289 * Note: Currently, null can be passed in for the parent. 
    289290 * This has the effect of creating the shell on the currently active 
    290  * display if there is one. If there is no current display, the  
     291 * display if there is one. If there is no current display, the 
    291292 * shell is created on a "default" display. <b>Passing in null as 
    292293 * the parent is not considered to be good coding style, 
     
    314315 * The style value is either one of the style constants defined in 
    315316 * class <code>DWT</code> which is applicable to instances of this 
    316  * class, or must be built by <em>bitwise OR</em>'ing together  
     317 * class, or must be built by <em>bitwise OR</em>'ing together 
    317318 * (that is, using the <code>int</code> "|" operator) two or more 
    318319 * of those <code>DWT</code> style constants. The class description 
     
    322323 * Note: Currently, null can be passed in for the parent. 
    323324 * This has the effect of creating the shell on the currently active 
    324  * display if there is one. If there is no current display, the  
     325 * display if there is one. If there is no current display, the 
    325326 * shell is created on a "default" display. <b>Passing in null as 
    326327 * the parent is not considered to be good coding style, 
     
    335336 *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> 
    336337 * </ul> 
    337  *  
     338 * 
    338339 * @see DWT#BORDER 
    339340 * @see DWT#CLOSE 
     
    354355} 
    355356 
    356 /**      
     357/** 
    357358 * Invokes platform specific functionality to allocate a new shell. 
    358359 * <p> 
     
    367368 * @param handle the handle for the shell 
    368369 */ 
    369   
     370 
    370371/+ 
    371372 
     
    419420        switch (msg) { 
    420421            case OS.WM_KILLFOCUS: 
    421             case OS.WM_SETFOCUS:  
     422            case OS.WM_SETFOCUS: 
    422423                return OS.DefWindowProc (handle, msg, wParam, lParam); 
    423424        } 
     
    453454void createHandle () { 
    454455    bit embedded = handle != 0; 
    455      
     456 
    456457    /* 
    457458    * On Windows 98 and NT, setting a window to be the 
     
    467468//  if ((style & DWT.ON_TOP) != 0) display.lockActiveWindow = true; 
    468469    super.createHandle (); 
    469      
     470 
    470471    /* 
    471472    * The following code is intentionally commented. 
    472473    */ 
    473474//  if ((style & DWT.ON_TOP) != 0)  display.lockActiveWindow = false; 
    474      
     475 
    475476    if (!embedded) { 
    476         int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);     
     477        int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); 
    477478        bits &= ~(OS.WS_OVERLAPPED | OS.WS_CAPTION); 
    478479        if (!OS.IsWinCE) bits |= OS.WS_POPUP; 
     
    610611 * more of the following constants defined in class 
    611612 * <code>DWT</code>: 
    612  * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>,  
     613 * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>, 
    613614 * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>. 
    614615 * 
     
    651652} 
    652653 
    653 /**  
     654/** 
    654655 * Returns the region that defines the shape of the shell, 
    655656 * or null if the shell has the default shape. 
    656657 * 
    657658 * @return the region that defines the shape of the shell (or null) 
    658  *  
     659 * 
    659660 * @exception DWTException <ul> 
    660661 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    676677 
    677678/** 
    678  * Returns an array containing all shells which are  
     679 * Returns an array containing all shells which are 
    679680 * descendents of the receiver. 
    680681 * <p> 
     
    723724            new TCHAR (0, "MDICLIENT", true), 
    724725            null, 
    725             widgetStyle,  
     726            widgetStyle, 
    726727            0, 0, 0, 0, 
    727728            handle, 
     
    908909    if (lastActive != null && lastActive.isDisposed ()) lastActive = null; 
    909910    if (lastActive == control) return; 
    910      
     911 
    911912    /* 
    912913    * Compute the list of controls to be activated and 
     
    922923        index++; 
    923924    } 
    924      
     925 
    925926    /* 
    926927    * It is possible (but unlikely), that application 
     
    973974 
    974975/** 
    975  * Sets the input method editor mode to the argument which  
     976 * Sets the input method editor mode to the argument which 
    976977 * should be the result of bitwise OR'ing together one or more 
    977978 * of the following constants defined in class <code>DWT</code>: 
    978  * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>,  
     979 * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>, 
    979980 * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>. 
    980981 * 
     
    10451046 * 
    10461047 * @param region the region that defines the shape of the shell (or null) 
    1047  *  
     1048 * 
    10481049 * @exception DWTException <ul> 
    10491050 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    10791080            OS.GetModuleHandle (null), 
    10801081            null); 
    1081         if (toolTipHandle == 0) error (DWT.ERROR_NO_HANDLES);   
     1082        if (toolTipHandle == 0) error (DWT.ERROR_NO_HANDLES); 
    10821083        /* 
    10831084        * Feature in Windows.  Despite the fact that the 
     
    12441245    * and a parent window causes the new window to become a WS_CHILD of 
    12451246    * the parent instead of a dialog child.  The fix is to use WS_POPUP 
    1246     * for a window with a parent.   
    1247     *  
     1247    * for a window with a parent. 
     1248    * 
    12481249    * Feature in WinCE PPC.  A window without a parent with WS_POPUP 
    12491250    * always shows on top of the Pocket PC 'Today Screen'. The fix 
    12501251    * is to not set WS_POPUP for a window without a parent on WinCE 
    12511252    * devices. 
    1252     *  
     1253    * 
    12531254    * NOTE: WS_POPUP causes CreateWindowEx () to ignore CW_USEDEFAULT 
    12541255    * and causes the default window location and size to be zero. 
     
    12581259        return parent == null ? bits : bits | OS.WS_POPUP; 
    12591260    } 
    1260      
     1261 
    12611262    /* 
    12621263    * Use WS_OVERLAPPED for all windows, either dialog or top level 
    12631264    * so that CreateWindowEx () will respect CW_USEDEFAULT and set 
    12641265    * the default window location and size. 
    1265     *  
     1266    * 
    12661267    * NOTE:  When a WS_OVERLAPPED window is created, Windows gives 
    12671268    * the new window WS_CAPTION style bits.  These two constants are 
    12681269    * as follows: 
    1269     *  
     1270    * 
    12701271    *   WS_OVERLAPPED = 0 
    12711272    *   WS_CAPTION = WS_BORDER | WS_DLGFRAME 
    1272     *  
     1273    * 
    12731274    */ 
    12741275    return bits | OS.WS_OVERLAPPED | OS.WS_CAPTION; 
     
    12911292        if ((wParam & 0xFFFF) != 0) { 
    12921293            OS.SHSipPreference (handle, psai.fSipUp == 0 ? OS.SIP_DOWN : OS.SIP_UP); 
    1293         }  
     1294        } 
    12941295    } 
    12951296 
     
    12991300    * repaint issues.  The fix is to close the IME ourselves 
    13001301    * when the Shell is deactivated. 
    1301     *  
     1302    * 
    13021303    * Note.  When the Shell is reactivated, the text in the 
    13031304    * composition window has been lost. 
     
    13081309        } 
    13091310    } 
    1310      
     1311 
    13111312    LRESULT result = super.WM_ACTIVATE (wParam, lParam); 
    13121313    if (parent != null) return LRESULT.ZERO; 
     
    13311332        if (loWord == OS.IDOK && (lParam == 0 || lParam == handle)) { 
    13321333            OS.PostMessage (handle, OS.WM_CLOSE, 0, 0); 
    1333             return LRESULT.ZERO;            
    1334         } 
    1335     } 
    1336     /*  
     1334            return LRESULT.ZERO; 
     1335        } 
     1336    } 
     1337    /* 
    13371338    * Note in WinCE PPC.  Menu events originate from the command bar. 
    13381339    */ 
     
    13741375    LRESULT result = super.WM_MOUSEACTIVATE (wParam, lParam); 
    13751376    if (result != null) return result; 
    1376      
     1377 
    13771378    /* 
    13781379    * Check for WM_MOUSEACTIVATE when an MDI shell is active 
     
    14071408    } 
    14081409    if (hittest == OS.HTMENU) return null; 
    1409      
     1410 
    14101411    /* 
    14111412    * Get the current location of the cursor, 
     
    14301431    Control control = display.findControl (hwnd); 
    14311432    setActiveControl (control); 
    1432      
     1433 
    14331434    /* 
    14341435    * This code is intentionally commented.  On some platforms, 
     
    15461547    if (OS.IsPPC) { 
    15471548        if (wParam == OS.SPI_SETSIPINFO) { 
    1548             /*  
     1549            /* 
    15491550            * The SIP is in a new state.  Cache its new value. 
    15501551            * Resize the Shell if it has the style DWT.RESIZE. 
     
    15591560                pSipInfo.cbSize = SIPINFO.sizeof; 
    15601561                OS.SipGetInfo (pSipInfo); 
    1561                 psai.fSipUp = pSipInfo.fdwFlags & OS.SIPF_ON;                   
     1562                psai.fSipUp = pSipInfo.fdwFlags & OS.SIPF_ON; 
    15621563            } 
    15631564        }