comparison dwt/widgets/Label.d @ 246:fd9c62a2998e

Updater SWT 3.4M7 to 3.4
author Frank Benoit <benoit@tionex.de>
date Tue, 01 Jul 2008 10:15:59 +0200
parents b4846fd3437a
children
comparison
equal deleted inserted replaced
245:d8c3d4a4f2b0 246:fd9c62a2998e
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 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 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
38 * Shadow styles are hints and may not be honoured 38 * Shadow styles are hints and may not be honoured
39 * by the platform. To create a separator label 39 * by the platform. To create a separator label
40 * with the default shadow style for the platform, 40 * with the default shadow style for the platform,
41 * do not specify a shadow style. 41 * do not specify a shadow style.
42 * </p> 42 * </p>
43 * <dl>
44 * <dl> 43 * <dl>
45 * <dt><b>Styles:</b></dt> 44 * <dt><b>Styles:</b></dt>
46 * <dd>SEPARATOR, HORIZONTAL, VERTICAL</dd> 45 * <dd>SEPARATOR, HORIZONTAL, VERTICAL</dd>
47 * <dd>SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd> 46 * <dd>SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
48 * <dd>CENTER, LEFT, RIGHT, WRAP</dd> 47 * <dd>CENTER, LEFT, RIGHT, WRAP</dd>
55 * Only one of CENTER, LEFT and RIGHT may be specified. 54 * Only one of CENTER, LEFT and RIGHT may be specified.
56 * </p><p> 55 * </p><p>
57 * IMPORTANT: This class is intended to be subclassed <em>only</em> 56 * IMPORTANT: This class is intended to be subclassed <em>only</em>
58 * within the DWT implementation. 57 * within the DWT implementation.
59 * </p> 58 * </p>
59 *
60 * @see <a href="http://www.eclipse.org/swt/snippets/#label">Label snippets</a>
61 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a>
62 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
60 */ 63 */
61 public class Label : Control { 64 public class Label : Control {
62 65
63 alias Control.computeSize computeSize; 66 alias Control.computeSize computeSize;
64 alias Control.windowProc windowProc; 67 alias Control.windowProc windowProc;
432 * the label uses it to draw. If the brush is a solid 435 * the label uses it to draw. If the brush is a solid
433 * color, this does not matter. However, if the brush 436 * color, this does not matter. However, if the brush
434 * contains an image, the image is misaligned. The 437 * contains an image, the image is misaligned. The
435 * fix is to draw the background in WM_ERASEBKGND. 438 * fix is to draw the background in WM_ERASEBKGND.
436 */ 439 */
437 if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) { 440 if (OS.COMCTL32_MAJOR < 6) {
438 if (findImageControl () !is null) OS.InvalidateRect (handle, null, true); 441 if (findImageControl () !is null) OS.InvalidateRect (handle, null, true);
439 } 442 }
440 } 443 }
441 444
442 override int widgetExtStyle () { 445 override int widgetExtStyle () {
478 * the label uses it to draw. If the brush is a solid 481 * the label uses it to draw. If the brush is a solid
479 * color, this does not matter. However, if the brush 482 * color, this does not matter. However, if the brush
480 * contains an image, the image is misaligned. The 483 * contains an image, the image is misaligned. The
481 * fix is to draw the background in WM_ERASEBKGND. 484 * fix is to draw the background in WM_ERASEBKGND.
482 */ 485 */
483 if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) { 486 if (OS.COMCTL32_MAJOR < 6) {
484 if (findImageControl () !is null) { 487 if (findImageControl () !is null) {
485 drawBackground (cast(HANDLE)wParam); 488 drawBackground (cast(HANDLE)wParam);
486 return LRESULT.ONE; 489 return LRESULT.ONE;
487 } 490 }
488 } 491 }
550 * color, this does not matter. However, if the brush 553 * color, this does not matter. However, if the brush
551 * contains an image, the image is misaligned. The 554 * contains an image, the image is misaligned. The
552 * fix is to draw the background in WM_ERASEBKGND. 555 * fix is to draw the background in WM_ERASEBKGND.
553 */ 556 */
554 LRESULT result = super.wmColorChild (wParam, lParam); 557 LRESULT result = super.wmColorChild (wParam, lParam);
555 if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) { 558 if (OS.COMCTL32_MAJOR < 6) {
556 int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); 559 int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
557 if ((bits & OS.SS_OWNERDRAW) !is OS.SS_OWNERDRAW) { 560 if ((bits & OS.SS_OWNERDRAW) !is OS.SS_OWNERDRAW) {
558 if (findImageControl () !is null) { 561 if (findImageControl () !is null) {
559 OS.SetBkMode ( cast(HANDLE) wParam, OS.TRANSPARENT); 562 OS.SetBkMode ( cast(HANDLE) wParam, OS.TRANSPARENT);
560 return new LRESULT ( cast(int)OS.GetStockObject (OS.NULL_BRUSH)); 563 return new LRESULT ( cast(int)OS.GetStockObject (OS.NULL_BRUSH));