Changeset 18
- Timestamp:
- 05/25/04 12:16:20 (5 years ago)
- Files:
-
- branches/0.1/src/dwt/graphics/gc.d (modified) (5 diffs)
- branches/0.1/src/dwt/graphics/image.d (modified) (3 diffs)
- branches/0.1/src/dwt/internal/win32/os.d (modified) (5 diffs)
- branches/0.1/src/dwt/widgets/decorations.d (modified) (47 diffs)
- branches/0.1/src/dwt/widgets/shell.d (modified) (45 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.1/src/dwt/graphics/gc.d
r17 r18 1 1 /******************************************************************************* 2 2 * 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 4 4 * are made available under the terms of the Common Public License v1.0 5 5 * which accompanies this distribution, and is available at 6 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 7 * 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation … … 12 12 /******************************************************************************* 13 13 * DWT: SWT port for the D Language 14 * 14 * 15 15 * Contributors: 16 16 * The DWT team at http://www.dsource.org/projects/dwt 17 * 17 * 18 18 *******************************************************************************/ 19 19 … … 50 50 import dwt.internal.win32.tchar; 51 51 import dwt.internal.win32.types; 52 52 53 53 import dwt.util.util; 54 54 … … 811 811 } 812 812 } 813 OS.MoveMemory(srcData, dibBM.bmBits, sizeInBytes);813 srcData[0 .. sizeInBytes] = dibBM.bmBits[0 .. sizeInBytes]; 814 814 815 815 /* Compose the pixels */ … … 828 828 829 829 /* Draw the composed pixels */ 830 OS.MoveMemory(dibBM.bmBits, destData, sizeInBytes);830 dibBM.bmBits[0 .. sizeInBytes] = destData[0 .. sizeInBytes]; 831 831 OS.BitBlt(handle, destX, destY, destWidth, destHeight, memHdc, 0, 0, OS.SRCCOPY); 832 832 branches/0.1/src/dwt/graphics/image.d
r17 r18 1 1 /******************************************************************************* 2 2 * 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 4 4 * are made available under the terms of the Common Public License v1.0 5 5 * which accompanies this distribution, and is available at 6 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 7 * 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation … … 12 12 /******************************************************************************* 13 13 * DWT: SWT port for the D Language 14 * 14 * 15 15 * Contributors: 16 16 * The DWT team at http://www.dsource.org/projects/dwt 17 * 17 * 18 18 *******************************************************************************/ 19 19 … … 1105 1105 if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 1106 1106 OS.GetDIBits(hBitmapDC, hBitmap, 0, height, null, bmiHeader, OS.DIB_RGB_COLORS); 1107 OS.MoveMemory(bmiHeader, bmi, BITMAPINFOHEADER.sizeof);1108 1107 imageSize = bmiHeader.biSizeImage; 1109 1108 auto byte[] data = new byte[imageSize]; branches/0.1/src/dwt/internal/win32/os.d
r17 r18 1 1 /******************************************************************************* 2 2 * 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 4 4 * are made available under the terms of the Common Public License v1.0 5 5 * which accompanies this distribution, and is available at 6 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 7 * 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation … … 12 12 /******************************************************************************* 13 13 * DWT: SWT port for the D Language 14 * 14 * 15 15 * Contributors: 16 16 * The DWT team at http://www.dsource.org/projects/dwt 17 * 17 * 18 18 *******************************************************************************/ 19 19 … … 1802 1802 } 1803 1803 1804 static void MoveMemory (TCHAR Destination, intSource, int Length) {1804 static void MoveMemory (TCHAR Destination, void* Source, int Length) { 1805 1805 if (IsUnicode) { 1806 1806 wchar* Destination1 = w_str(Destination); … … 2397 2397 + (Andy's work, maybe?) 2398 2398 +/ 2399 2399 2400 2400 // :P 2401 2401 //void MoveMemory(void* destination, void* source, int length); … … 2451 2451 void MoveMemory(int DestinationPtr, float[] Source, int Length); 2452 2452 void MoveMemory(int DestinationPtr, short[] Source, int Length); 2453 2454 2453 2454 2455 2455 bool MoveToEx (int hdc,int x1, int x2, int lPoint); 2456 2456 int MsgWaitForMultipleObjectsEx (int nCount, int pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags); branches/0.1/src/dwt/widgets/decorations.d
r17 r18 1 1 /******************************************************************************* 2 2 * 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 4 4 * are made available under the terms of the Common Public License v1.0 5 5 * which accompanies this distribution, and is available at 6 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 7 * 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation … … 12 12 /******************************************************************************* 13 13 * DWT: SWT port for the D Language 14 * 14 * 15 15 * Contributors: 16 16 * The DWT team at http://www.dsource.org/projects/dwt 17 * 17 * 18 18 *******************************************************************************/ 19 19 … … 37 37 * and is a subclass. 38 38 * <p> 39 * Instances are always displayed in one of the maximized, 39 * Instances are always displayed in one of the maximized, 40 40 * minimized or normal states: 41 41 * <ul> … … 44 44 * window manager will typically resize it to fill the 45 45 * 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 47 47 * (even if it has style <code>RESIZE</code>) until it is 48 48 * no longer maximized. … … 82 82 * <dd> 83 83 * 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 85 85 * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>) 86 86 * </dd> … … 88 88 * <dd> 89 89 * 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 91 91 * is, <code>TITLE | CLOSE | BORDER</code>) 92 92 * </dd> … … 106 106 107 107 private import dwt.dwt; 108 108 109 109 private import dwt.graphics.image; 110 110 private import dwt.graphics.point; 111 111 private import dwt.graphics.rectangle; 112 112 113 113 private import dwt.internal.win32.os; 114 114 private import dwt.internal.win32.types; 115 115 116 116 private import dwt.util.util; 117 117 118 118 private import dwt.widgets.menu; 119 119 private import dwt.widgets.menuitem; … … 121 121 private import dwt.widgets.button; 122 122 private import dwt.widgets.shell; 123 123 private import dwt.widgets.composite; 124 124 125 OS os; 125 126 Image image, smallImage, largeImage; … … 131 132 Button defaultButton, saveDefault; 132 133 int swFlags, hAccel, nAccel; 133 134 134 135 /* 135 136 * The start value for WM_COMMAND id's. 136 137 * Windows reserves the values 0..100. 137 * 138 * 138 139 * The SmartPhone DWT resource file reserves 139 140 * the values 101..107. … … 152 153 * The style value is either one of the style constants defined in 153 154 * 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 155 156 * (that is, using the <code>int</code> "|" operator) two or more 156 157 * of those <code>DWT</code> style constants. The class description … … 230 231 */ 231 232 // 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; 233 234 // OS.SetWindowPos (handle, OS.HWND_TOP, 0, 0, 0, 0, flags); 234 235 // } else { … … 256 257 */ 257 258 if ((style & (DWT.MIN | DWT.MAX)) != 0) style |= DWT.CLOSE; 258 259 259 260 /* 260 261 * Both WS_SYSMENU and WS_CAPTION must be set in order … … 262 263 */ 263 264 if ((style & DWT.CLOSE) != 0) style |= DWT.TITLE; 264 265 265 266 /* 266 267 * Bug in Windows. The WS_CAPTION style must be … … 277 278 */ 278 279 // if ((style & DWT.RESIZE) != 0) style |= DWT.TITLE; 279 280 280 281 return style; 281 282 } … … 337 338 int size = ACCEL.sizeof; 338 339 ACCEL accel; 339 byte [] buffer1 = new byte [size]; 340 byte [] buffer1 = new byte [size]; 340 341 byte [] buffer2 = new byte [maxAccel * size]; 341 342 if (menuBar != null && items != null) { … … 357 358 } 358 359 if (OS.IsPPC) { 359 /* 360 /* 360 361 * Note on WinCE PPC. Close the shell when user taps CTRL-Q. 361 362 * IDOK represents the "Done Button" which also closes the shell. … … 366 367 OS.MoveMemory (buffer1, accel, size); 367 368 System.arraycopy (buffer1, 0, buffer2, nAccel * size, size); 368 nAccel++; 369 nAccel++; 369 370 } 370 371 if (nAccel != 0) hAccel = OS.CreateAcceleratorTable (buffer2, nAccel); … … 459 460 public Rectangle getClientArea () { 460 461 checkWidget (); 461 /* 462 /* 462 463 * Note: The CommandBar is part of the client area, 463 464 * not the trim. Applications don't expect this so … … 509 510 510 511 /** 511 * Returns the receiver's image if it had previously been 512 * Returns the receiver's image if it had previously been 512 513 * set using <code>setImage()</code>. The image is typically 513 514 * displayed by the window manager when the instance is … … 521 522 * even if one exists. 522 523 * </p> 523 * 524 * 524 525 * @return the image 525 526 * … … 535 536 536 537 /** 537 * Returns the receiver's images if they had previously been 538 * Returns the receiver's images if they had previously been 538 539 * set using <code>setImages()</code>. Images are typically 539 540 * displayed by the window manager when the instance is … … 544 545 * the array will contain the same icon rendered at different 545 546 * resolutions. 546 * 547 * 547 548 * <p> 548 549 * Note: This method will return an empty array if called before … … 551 552 * even if one exists. 552 553 * </p> 553 * 554 * 554 555 * @return the images 555 556 * … … 558 559 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 559 560 * </ul> 560 * 561 * 561 562 * @since 3.0 562 563 */ … … 581 582 /** 582 583 * Returns <code>true</code> if the receiver is currently 583 * maximized, and false otherwise. 584 * maximized, and false otherwise. 584 585 * <p> 585 586 * … … 618 619 /** 619 620 * Returns <code>true</code> if the receiver is currently 620 * minimized, and false otherwise. 621 * minimized, and false otherwise. 621 622 * <p> 622 623 * … … 663 664 * Returns the receiver's text, which is the string that the 664 665 * 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, 666 667 * returns an empty string. 667 668 * … … 796 797 * button to the argument, and if the argument is null, sets 797 798 * 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 799 800 * <em>saved default button</em>). If no default button had 800 801 * previously been set, or the saved default button was 801 802 * disposed, the receiver's default button will be set to 802 * null. 803 * null. 803 804 * 804 805 * @param the new default button 805 806 * 806 807 * @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> 808 809 * </ul> 809 810 * @exception SWTException <ul> … … 845 846 * may also be displayed somewhere in the trim when the 846 847 * instance is in normal or maximized states. 847 * 848 * 848 849 * @param image the new image (or null) 849 850 * 850 851 * @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> 852 853 * </ul> 853 854 * @exception SWTException <ul> … … 870 871 * later free the icon, thus freeing the icon for every window. 871 872 * The fix is to avoid the API. 872 * 873 * 873 874 * On WinCE PPC, icons in windows are not displayed anyways. 874 875 */ … … 884 885 smallWidth = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXSMICON)); 885 886 smallIcon = image; 886 largeWidth = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON)); 887 largeWidth = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON)); 887 888 largeIcon = image; 888 889 } … … 930 931 } 931 932 OS.SendMessage (handle, OS.WM_SETICON, OS.ICON_BIG, hLargeIcon); 932 933 933 934 /* 934 935 * Bug in Windows. When WM_SETICON is used to remove an … … 955 956 * the "best" size. It is expected that the array will contain 956 957 * the same icon rendered at different resolutions. 957 * 958 * 958 959 * @param images the new image array 959 960 * … … 966 967 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 967 968 * </ul> 968 * 969 * 969 970 * @since 3.0 970 971 */ … … 1034 1035 } 1035 1036 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); 1037 1038 } else { 1038 1039 if ((style & DWT.NO_TRIM) == 0) { … … 1060 1061 * 1061 1062 * @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> 1063 1064 * <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li> 1064 1065 * </ul> … … 1075 1076 if ((menu.style & DWT.BAR) == 0) error (DWT.ERROR_MENU_NOT_BAR); 1076 1077 if (menu.parent != this) error (DWT.ERROR_INVALID_PARENT); 1077 } 1078 } 1078 1079 if (OS.IsWinCE) { 1079 1080 if (OS.IsHPC) { … … 1104 1105 if (menuBar != null) OS.ShowWindow (menuBar.hwndCB, OS.SW_SHOW); 1105 1106 } 1106 } 1107 } 1107 1108 } else { 1108 1109 if (menu != null) display.removeBar (menu); … … 1170 1171 OS.SetWindowLong (handle, OS.GWL_STYLE, bits | OS.WS_POPUP); 1171 1172 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; 1173 1174 OS.SetWindowPos (handle, OS.HWND_BOTTOM, 0, 0, 0, 0, flags); 1174 1175 display.lockActiveWindow = false; … … 1227 1228 } 1228 1229 int newCount = OS.GetMenuItemCount (hMenu); 1229 if ((style & DWT.CLOSE) == 0 || newCount != oldCount) { 1230 if ((style & DWT.CLOSE) == 0 || newCount != oldCount) { 1230 1231 OS.DeleteMenu (hMenu, OS.SC_TASKLIST, OS.MF_BYCOMMAND); 1231 1232 MENUITEMINFO info = new MENUITEMINFO (); … … 1251 1252 * Sets the receiver's text, which is the string that the 1252 1253 * 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. 1254 1255 * 1255 1256 * @param string the new text … … 1437 1438 1438 1439 int widgetStyle () { 1439 /* 1440 /* 1440 1441 * Clear WS_VISIBLE and WS_TABSTOP. NOTE: In Windows, WS_TABSTOP 1441 1442 * has the same value as WS_MAXIMIZEBOX so these bits cannot be … … 1443 1444 */ 1444 1445 int bits = super.widgetStyle () & ~(OS.WS_TABSTOP | OS.WS_VISIBLE); 1445 1446 1446 1447 /* Set the title bits and no-trim bits */ 1447 1448 bits &= ~OS.WS_BORDER; 1448 1449 if ((style & DWT.NO_TRIM) != 0) return bits; 1449 1450 if ((style & DWT.TITLE) != 0) bits |= OS.WS_CAPTION; 1450 1451 1451 1452 /* Set the min and max button bits */ 1452 1453 if ((style & DWT.MIN) != 0) bits |= OS.WS_MINIMIZEBOX; 1453 1454 if ((style & DWT.MAX) != 0) bits |= OS.WS_MAXIMIZEBOX; 1454 1455 1455 1456 /* Set the resize, dialog border or border bits */ 1456 1457 if ((style & DWT.RESIZE) != 0) { … … 1460 1461 * It does not set the WS_THICKFRAME style. 1461 1462 */ 1462 if (!OS.IsPPC) bits |= OS.WS_THICKFRAME; 1463 if (!OS.IsPPC) bits |= OS.WS_THICKFRAME; 1463 1464 } else { 1464 1465 if ((style & DWT.BORDER) == 0) bits |= OS.WS_BORDER; … … 1469 1470 if ((style & DWT.CLOSE) != 0) bits |= OS.WS_SYSMENU; 1470 1471 } 1471 1472 1472 1473 return bits; 1473 1474 } … … 1511 1512 +/ 1512 1513 1513 if (restoreFocus ()) return LRESULT.ZERO; 1514 if (restoreFocus ()) return LRESULT.ZERO; 1514 1515 } else { 1515 1516 /* … … 1554 1555 * Feature on WinCE SP. The Back key is either used to close 1555 1556 * 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 1558 1559 * workaround is to override the Back key when creating 1559 1560 * the menubar and handle it based on the style of the Shell. branches/0.1/src/dwt/widgets/shell.d
r17 r18 1 1 /******************************************************************************* 2 2 * 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 4 4 * are made available under the terms of the Common Public License v1.0 5 5 * which accompanies this distribution, and is available at 6 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 7 * 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation … … 12 12 /******************************************************************************* 13 13 * DWT: SWT port for the D Language 14 * 14 * 15 15 * Contributors: 16 16 * The DWT team at http://www.dsource.org/projects/dwt 17 * 17 * 18 18 *******************************************************************************/ 19 19 … … 22 22 module dwt.widgets.shell; 23 23 24 /+ 24 /+ 25 25 import org.eclipse.swt.internal.win32.*; 26 26 import org.eclipse.swt.*; … … 33 33 private import dwt.internal.win32.os; 34 34 private import dwt.internal.win32.types; 35 private import dwt.internal.win32.tchar; 35 36 36 37 private import dwt.widgets.control; … … 43 44 * which the desktop or "window manager" is managing. 44 45 * 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 46 47 * <code>Display</code> as the argument) are described 47 48 * as <em>top level</em> shells. Instances that do have … … 49 50 * <em>dialog</em> shells. 50 51 * <p> 51 * Instances are always displayed in one of the maximized, 52 * Instances are always displayed in one of the maximized, 52 53 * minimized or normal states: 53 54 * <ul> … … 56 57 * window manager will typically resize it to fill the 57 58 * 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 59 60 * (even if it has style <code>RESIZE</code>) until it is 60 61 * no longer maximized. … … 100 101 * <dd> 101 102 * 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 103 104 * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>) 104 105 * </dd> … … 106 107 * <dd> 107 108 * 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 109 110 * is, <code>TITLE | CLOSE | BORDER</code>) 110 111 * </dd> … … 112 113 * </p> 113 114 * <p> 114 * Note: Only one of the styles APPLICATION_MODAL, MODELESS, 115 * Note: Only one of the styles APPLICATION_MODAL, MODELESS, 115 116 * PRIMARY_MODAL and SYSTEM_MODAL may be specified. 116 117 * </p><p> … … 165 166 * The style value is either one of the style constants defined in 166 167 * 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 168 169 * (that is, using the <code>int</code> "|" operator) two or more 169 170 * of those <code>DWT</code> style constants. The class description … … 178 179 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> 179 180 * </ul> 180 * 181 * 181 182 * @see DWT#BORDER 182 183 * @see DWT#CLOSE … … 203 204 * Note: Currently, null can be passed in for the display argument. 204 205 * 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 206 207 * shell is created on a "default" display. <b>Passing in null as 207 208 * the display argument is not considered to be good coding style, … … 227 228 * The style value is either one of the style constants defined in 228 229 * 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 230 231 * (that is, using the <code>int</code> "|" operator) two or more 231 232 * of those <code>DWT</code> style constants. The class description … … 235 236 * Note: Currently, null can be passed in for the display argument. 236 237 * 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 238 239 * shell is created on a "default" display. <b>Passing in null as 239 240 * the display argument is not considered to be good coding style, … … 248 249 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> 249 250 * </ul> 250 * 251 * 251 252 * @see DWT#BORDER 252 253 * @see DWT#CLOSE … … 288 289 * Note: Currently, null can be passed in for the parent. 289 290 * 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 291 292 * shell is created on a "default" display. <b>Passing in null as 292 293 * the parent is not considered to be good coding style, … … 314 315 * The style value is either one of the style constants defined in 315 316 * 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 317 318 * (that is, using the <code>int</code> "|" operator) two or more 318 319 * of those <code>DWT</code> style constants. The class description … … 322 323 * Note: Currently, null can be passed in for the parent. 323 324 * 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 325 326 * shell is created on a "default" display. <b>Passing in null as 326 327 * the parent is not considered to be good coding style, … … 335 336 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> 336 337 * </ul> 337 * 338 * 338 339 * @see DWT#BORDER 339 340 * @see DWT#CLOSE … … 354 355 } 355 356 356 /** 357 /** 357 358 * Invokes platform specific functionality to allocate a new shell. 358 359 * <p> … … 367 368 * @param handle the handle for the shell 368 369 */ 369 370 370 371 /+ 371 372 … … 419 420 switch (msg) { 420 421 case OS.WM_KILLFOCUS: 421 case OS.WM_SETFOCUS: 422 case OS.WM_SETFOCUS: 422 423 return OS.DefWindowProc (handle, msg, wParam, lParam); 423 424 } … … 453 454 void createHandle () { 454 455 bit embedded = handle != 0; 455 456 456 457 /* 457 458 * On Windows 98 and NT, setting a window to be the … … 467 468 // if ((style & DWT.ON_TOP) != 0) display.lockActiveWindow = true; 468 469 super.createHandle (); 469 470 470 471 /* 471 472 * The following code is intentionally commented. 472 473 */ 473 474 // if ((style & DWT.ON_TOP) != 0) display.lockActiveWindow = false; 474 475 475 476 if (!embedded) { 476 int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); 477 int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); 477 478 bits &= ~(OS.WS_OVERLAPPED | OS.WS_CAPTION); 478 479 if (!OS.IsWinCE) bits |= OS.WS_POPUP; … … 610 611 * more of the following constants defined in class 611 612 * <code>DWT</code>: 612 * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>, 613 * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>, 613 614 * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>. 614 615 * … … 651 652 } 652 653 653 /** 654 /** 654 655 * Returns the region that defines the shape of the shell, 655 656 * or null if the shell has the default shape. 656 657 * 657 658 * @return the region that defines the shape of the shell (or null) 658 * 659 * 659 660 * @exception DWTException <ul> 660 661 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> … … 676 677 677 678 /** 678 * Returns an array containing all shells which are 679 * Returns an array containing all shells which are 679 680 * descendents of the receiver. 680 681 * <p> … … 723 724 new TCHAR (0, "MDICLIENT", true), 724 725 null, 725 widgetStyle, 726 widgetStyle, 726 727 0, 0, 0, 0, 727 728 handle, … … 908 909 if (lastActive != null && lastActive.isDisposed ()) lastActive = null; 909 910 if (lastActive == control) return; 910 911 911 912 /* 912 913 * Compute the list of controls to be activated and … … 922 923 index++; 923 924 } 924 925 925 926 /* 926 927 * It is possible (but unlikely), that application … … 973 974 974 975 /** 975 * Sets the input method editor mode to the argument which 976 * Sets the input method editor mode to the argument which 976 977 * should be the result of bitwise OR'ing together one or more 977 978 * 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>, 979 980 * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>. 980 981 * … … 1045 1046 * 1046 1047 * @param region the region that defines the shape of the shell (or null) 1047 * 1048 * 1048 1049 * @exception DWTException <ul> 1049 1050 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> … … 1079 1080 OS.GetModuleHandle (null), 1080 1081 null); 1081 if (toolTipHandle == 0) error (DWT.ERROR_NO_HANDLES); 1082 if (toolTipHandle == 0) error (DWT.ERROR_NO_HANDLES); 1082 1083 /* 1083 1084 * Feature in Windows. Despite the fact that the … … 1244 1245 * and a parent window causes the new window to become a WS_CHILD of 1245 1246 * 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 * 1248 1249 * Feature in WinCE PPC. A window without a parent with WS_POPUP 1249 1250 * always shows on top of the Pocket PC 'Today Screen'. The fix 1250 1251 * is to not set WS_POPUP for a window without a parent on WinCE 1251 1252 * devices. 1252 * 1253 * 1253 1254 * NOTE: WS_POPUP causes CreateWindowEx () to ignore CW_USEDEFAULT 1254 1255 * and causes the default window location and size to be zero. … … 1258 1259 return parent == null ? bits : bits | OS.WS_POPUP; 1259 1260 } 1260 1261 1261 1262 /* 1262 1263 * Use WS_OVERLAPPED for all windows, either dialog or top level 1263 1264 * so that CreateWindowEx () will respect CW_USEDEFAULT and set 1264 1265 * the default window location and size. 1265 * 1266 * 1266 1267 * NOTE: When a WS_OVERLAPPED window is created, Windows gives 1267 1268 * the new window WS_CAPTION style bits. These two constants are 1268 1269 * as follows: 1269 * 1270 * 1270 1271 * WS_OVERLAPPED = 0 1271 1272 * WS_CAPTION = WS_BORDER | WS_DLGFRAME 1272 * 1273 * 1273 1274 */ 1274 1275 return bits | OS.WS_OVERLAPPED | OS.WS_CAPTION; … … 1291 1292 if ((wParam & 0xFFFF) != 0) { 1292 1293 OS.SHSipPreference (handle, psai.fSipUp == 0 ? OS.SIP_DOWN : OS.SIP_UP); 1293 } 1294 } 1294 1295 } 1295 1296 … … 1299 1300 * repaint issues. The fix is to close the IME ourselves 1300 1301 * when the Shell is deactivated. 1301 * 1302 * 1302 1303 * Note. When the Shell is reactivated, the text in the 1303 1304 * composition window has been lost. … … 1308 1309 } 1309 1310 } 1310 1311 1311 1312 LRESULT result = super.WM_ACTIVATE (wParam, lParam); 1312 1313 if (parent != null) return LRESULT.ZERO; … … 1331 1332 if (loWord == OS.IDOK && (lParam == 0 || lParam == handle)) { 1332 1333 OS.PostMessage (handle, OS.WM_CLOSE, 0, 0); 1333 return LRESULT.ZERO; 1334 } 1335 } 1336 /* 1334 return LRESULT.ZERO; 1335 } 1336 } 1337 /* 1337 1338 * Note in WinCE PPC. Menu events originate from the command bar. 1338 1339 */ … … 1374 1375 LRESULT result = super.WM_MOUSEACTIVATE (wParam, lParam); 1375 1376 if (result != null) return result; 1376 1377 1377 1378 /* 1378 1379 * Check for WM_MOUSEACTIVATE when an MDI shell is active … … 1407 1408 } 1408 1409 if (hittest == OS.HTMENU) return null; 1409 1410 1410 1411 /* 1411 1412 * Get the current location of the cursor, … … 1430 1431 Control control = display.findControl (hwnd); 1431 1432 setActiveControl (control); 1432 1433 1433 1434 /* 1434 1435 * This code is intentionally commented. On some platforms, … … 1546 1547 if (OS.IsPPC) { 1547 1548 if (wParam == OS.SPI_SETSIPINFO) { 1548 /* 1549 /* 1549 1550 * The SIP is in a new state. Cache its new value. 1550 1551 * Resize the Shell if it has the style DWT.RESIZE. … … 1559 1560 pSipInfo.cbSize = SIPINFO.sizeof; 1560 1561 OS.SipGetInfo (pSipInfo); 1561 psai.fSipUp = pSipInfo.fdwFlags & OS.SIPF_ON; 1562 psai.fSipUp = pSipInfo.fdwFlags & OS.SIPF_ON; 1562 1563 } 1563 1564 }
