# HG changeset patch
# User Frank Benoit
ST.BULLET_DOT
ST.BULLET_NUMBER
ST.BULLET_LETTER_LOWER
ST.BULLET_LETTER_UPPER
ST.BULLET_TEXT
ST.BULLET_CUSTOM
ST.BULLET_DOT
.
* The style must have a glyph metrics set.
*
* @param style the style
@@ -60,6 +81,7 @@
* Create a new bullet the specified style and type.
* The style must have a glyph metrics set.
*
+ * @param type the bullet type
* @param style the style
*
* @exception IllegalArgumentException * IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see DWT Example: CustomControlExample + * @see Sample code and further information */ public class CLabel : Canvas { diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/CTabFolder.d --- a/dwt/custom/CTabFolder.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/CTabFolder.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -79,6 +79,10 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see CTabFolder, CTabItem snippets + * @see DWT Example: CustomControlExample + * @see Sample code and further information */ public class CTabFolder : Composite { @@ -2391,7 +2395,7 @@ /** * Removes the listener. * - * @param listener the listener + * @param listener the listener which should no longer be notified * * @exception IllegalArgumentExceptionCTabFolderListener
interface.
+ *
+ * @see CTabFolderListener
+ * @see CTabFolderEvent
+ * @see Sample code and further information
+ */
public class CTabFolderAdapter : CTabFolderListener {
public void itemClosed(CTabFolderEvent event){}
}
diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/CTabFolderEvent.d
--- a/dwt/custom/CTabFolderEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/custom/CTabFolderEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,7 +21,9 @@
import dwt.dwthelper.utils;
/**
+ * This event is sent when an event is generated in the CTabFolder.
*
+ * @see Sample code and further information
*/
public class CTabFolderEvent : TypedEvent {
/**
diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/CTabItem.d
--- a/dwt/custom/CTabItem.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/custom/CTabItem.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,6 +44,9 @@
* * IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see CTabFolder, CTabItem snippets + * @see Sample code and further information */ public class CTabItem : Item { CTabFolder parent; @@ -1039,7 +1042,8 @@ } public override void setText (String string) { checkWidget(); - if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); if (string==getText()) return; super.setText(string); shortenedText = null; diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/ControlEditor.d --- a/dwt/custom/ControlEditor.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/ControlEditor.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -67,6 +67,8 @@ * editor.minimumHeight = size.y; * editor.setEditor (button); * +* +* @see Sample code and further information */ public class ControlEditor { diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/DefaultContent.d --- a/dwt/custom/DefaultContent.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/DefaultContent.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -733,7 +733,8 @@ * Removes the specifiedTextChangeListener
.
* * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception IllegalArgumentException
diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/LineBackgroundEvent.d --- a/dwt/custom/LineBackgroundEvent.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/LineBackgroundEvent.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,6 +20,8 @@ /** * This event is sent when a line is about to be drawn. + * + * @see Sample code and further information */ public class LineBackgroundEvent : TypedEvent { @@ -40,6 +42,12 @@ static final long serialVersionUID = 3978711687853324342L; +/** + * Constructs a new instance of this class based on the + * information in the given event. + * + * @param e the event containing the information + */ public this(StyledTextEvent e) { super(cast(Object)e); lineOffset = e.detail; diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/LineBackgroundListener.d --- a/dwt/custom/LineBackgroundListener.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/LineBackgroundListener.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,6 +15,14 @@ import dwt.internal.DWTEventListener; import dwt.custom.LineBackgroundEvent; +/** + * Classes which implement this interface provide a method + * that can provide the background color for a line that + * is to be drawn. + * + * @see LineBackgroundEvent + * @see Sample code and further information + */ public interface LineBackgroundListener : DWTEventListener { /** diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/LineStyleEvent.d --- a/dwt/custom/LineStyleEvent.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/LineStyleEvent.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,6 +20,8 @@ /** * This event is sent when a line is about to be drawn. + * + * @see Sample code and further information */ public class LineStyleEvent : TypedEvent { @@ -86,6 +88,12 @@ static final long serialVersionUID = 3906081274027192884L; +/** + * Constructs a new instance of this class based on the + * information in the given event. + * + * @param e the event containing the information + */ public this(StyledTextEvent e) { super(cast(Object)e); styles = e.styles; diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/LineStyleListener.d --- a/dwt/custom/LineStyleListener.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/LineStyleListener.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,7 +15,16 @@ import dwt.internal.DWTEventListener; import dwt.custom.LineStyleEvent; +/** + * Classes which implement this interface provide a method + * that can provide the style information for a line that + * is to be drawn. + * + * @see LineStyleEvent + * @see Sample code and further information + */ public interface LineStyleListener : DWTEventListener { + /** * This method is called when a line is about to be drawn in order to get the * line's style information. diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/MovementEvent.d --- a/dwt/custom/MovementEvent.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/MovementEvent.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,6 +20,8 @@ * This event is sent when a new offset is required based on the current * offset and a movement type. * + * @see Sample code and further information + * * @since 3.3 */ public class MovementEvent : TypedEvent { @@ -57,6 +59,12 @@ static final long serialVersionUID = 3978765487853324342L; +/** + * Constructs a new instance of this class based on the + * information in the given event. + * + * @param e the event containing the information + */ public this(StyledTextEvent e) { super(cast(Object)e); lineOffset = e.detail; diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/PaintObjectEvent.d --- a/dwt/custom/PaintObjectEvent.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/PaintObjectEvent.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -22,6 +22,8 @@ /** * This event is sent when an object needs to be drawn. * + * @see Sample code and further information + * * @since 3.2 */ public class PaintObjectEvent : TypedEvent { @@ -68,6 +70,12 @@ static final long serialVersionUID = 3906081274027192855L; +/** + * Constructs a new instance of this class based on the + * information in the given event. + * + * @param e the event containing the information + */ public this(StyledTextEvent e) { super(cast(Object)e); gc = e.gc; diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/PopupList.d --- a/dwt/custom/PopupList.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/PopupList.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,6 +39,8 @@ * The list will be positioned so that it does not run off the screen and the largest number of items * are visible. It may appear above the current cursor location or below it depending how close you * are to the edge of the screen. +* +* @see Sample code and further information */ public class PopupList { Shell shell; @@ -263,7 +265,6 @@ * or could not be added in the OS. * * @exception IllegalArgumentException
StyledText
.
+ *
+ * @see Sample code and further information
*/
public class ST {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/SashForm.d
--- a/dwt/custom/SashForm.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/custom/SashForm.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,9 +41,16 @@
* true
if the receiver automatically scrolls to a focused child control
* to make it visible. Otherwise, returns false
.
*
+ * @return a bool indicating whether focused child controls are automatically scrolled into the viewport
+ *
* @exception DWTException StyleRange
defines a set of styles for a specified
+ * range of text.
+ * + * The hashCode() method in this class uses the values of the public + * fields to compute the hash value. When storing instances of the + * class in hashed collections, do not modify these fields after the + * object has been inserted. + *
+ * + * @see Sample code and further information + */ public class StyleRange : TextStyle, CloneableCompatibility { /** @@ -57,9 +69,9 @@ /** * Create a new style range from an existing text style. * - *@param style the text style to copy + * @param style the text style to copy * - *@since 3.4 + * @since 3.4 */ public this(TextStyle style) { super(style); diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/StyledText.d --- a/dwt/custom/StyledText.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/StyledText.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -143,6 +143,10 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see StyledText snippets + * @see DWT Examples: CustomControlExample, TextEditor + * @see Sample code and further information */ public class StyledText : Canvas { @@ -197,8 +201,8 @@ Point doubleClickSelection; // selection after last mouse double click bool editable = true; bool wordWrap = false; - bool doubleClickEnabled = true; // see getDoubleClickEnabled - bool overwrite = false; // insert/overwrite edit mode + bool doubleClickEnabled = true; // see getDoubleClickEnabled + bool overwrite = false; // insert/overwrite edit mode int textLimit = -1; // limits the number of characters the user can type in the widget. Unlimited by default. int[int] keyActionMap; Color background = null; // workaround for bug 4791 @@ -214,7 +218,7 @@ int lastTextChangeReplaceCharCount; int lastLineBottom; // the bottom pixel of the last line been replaced bool isMirrored_; - bool bidiColoring = false; // apply the BIDI algorithm on text segments of the same color + bool bidiColoring = false; // apply the BIDI algorithm on text segments of the same color Image leftCaretBitmap = null; Image rightCaretBitmap = null; int caretDirection = DWT.NULL; @@ -263,9 +267,9 @@ int endPage; // last page to print int startLine; // first (wrapped) line to print int endLine; // last (wrapped) line to print - bool singleLine; // widget single line mode + bool singleLine; // widget single line mode Point selection = null; // selected text - bool mirrored; // indicates the printing gc should be mirrored + bool mirrored; // indicates the printing gc should be mirrored int lineSpacing; int printMargin; @@ -1605,9 +1609,10 @@ */ public void append(String string) { checkWidget(); - if (string is null) { - DWT.error(DWT.ERROR_NULL_ARGUMENT); - } + // DWT extension: allow null string + //if (string is null) { + // DWT.error(DWT.ERROR_NULL_ARGUMENT); + //} int lastChar = Math.max(getCharCount(), 0); replaceTextRange(lastChar, 0, string); } @@ -3823,6 +3828,8 @@ * lineIndex is lineCount it returns the bottom pixel of the last line. * It means this function can be used to retrieve the bottom pixel of any line. * + * @return the top pixel of a given line index + * * @since 3.2 */ public int getLinePixel(int lineIndex) { @@ -3849,6 +3856,10 @@ /** * Returns the line index for a y, relative to the client area. * The line index returned is always in the range 0..lineCount - 1. + * + * @param y the y-coordinate pixel + * + * @return the line index for a given y-coordinate pixel * * @since 3.2 */ @@ -4936,15 +4947,13 @@ *Runnable
for printing the receiver's text
+ *
* @exception DWTException Runnable
for printing the receiver's text
+ *
* @exception DWTException * - * @param listener the listener + * @param listener the listener which should no longer be notified + * * @exception IllegalArgumentException
TableItem
that is to be edited.
+*
+* @param item the item to be edited
+*/
public void setItem (TableItem item) {
this.item = item;
resize();
diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/TableTree.d
--- a/dwt/custom/TableTree.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/custom/TableTree.d Sun Jul 06 17:26:06 2008 +0200
@@ -765,7 +765,6 @@
* @param items the array of items
*
* @exception IllegalArgumentException TreeItem
that is to be edited.
+*
+* @param item the item to be edited
+*/
public void setItem (TreeItem item) {
this.item = item;
resize();
diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/VerifyKeyListener.d
--- a/dwt/custom/VerifyKeyListener.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/custom/VerifyKeyListener.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,14 @@
import dwt.events.VerifyEvent;
import dwt.internal.DWTEventListener;
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the event that is generated when a
+ * key is pressed.
+ *
+ * @see VerifyEvent
+ * @see Sample code and further information
+ */
public interface VerifyKeyListener : DWTEventListener {
/**
* The following event fields are used:* IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Sample code and further information */ public class ViewForm : Composite { diff -r d10ff1f47f84 -r 55591bc3974c dwt/custom/ViewFormLayout.d --- a/dwt/custom/ViewFormLayout.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/custom/ViewFormLayout.d Sun Jul 06 17:26:06 2008 +0200 @@ -197,7 +197,7 @@ int oldSeperator = form.separator; form.separator = -1; if (content !is null && !content.isDisposed()) { - if (left !is null || right!is null || center !is null){ + if (left !is null || right !is null || center !is null){ form.separator = y; y++; } diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/ByteArrayTransfer.d --- a/dwt/dnd/ByteArrayTransfer.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/dnd/ByteArrayTransfer.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,8 +25,7 @@ /** * The classByteArrayTransfer
provides a platform specific
* mechanism for converting a java byte[]
to a platform
- * specific representation of the byte array and vice versa. See
- * Transfer
for additional information.
+ * specific representation of the byte array and vice versa.
*
* ByteArrayTransfer
is never used directly but is sub-classed
* by transfer agents that convert between data in a java format such as a
@@ -125,6 +124,8 @@
* }
* }
*
+ *
+ * @see Transfer
*/
public abstract class ByteArrayTransfer : Transfer {
@@ -158,14 +159,13 @@
/**
* This implementation of javaToNative
converts a java
- * byte[]
to a platform specific representation. For additional
- * information see Transfer#javaToNative
.
- *
- * @see Transfer#javaToNative
- *
+ * byte[]
to a platform specific representation.
+ *
* @param object a java byte[]
containing the data to be converted
- * @param transferData an empty TransferData
object; this
- * object will be filled in on return with the platform specific format of the data
+ * @param transferData an empty TransferData
object that will
+ * be filled in on return with the platform specific format of the data
+ *
+ * @see Transfer#nativeToJava
*/
protected void javaToNative (Object object, TransferData transferData) {
if (!checkByteArray(object) || !isSupportedType(transferData)) {
@@ -187,14 +187,12 @@
/**
* This implementation of nativeToJava
converts a platform specific
* representation of a byte array to a java byte[]
.
- * For additional information see Transfer#nativeToJava
.
- *
- * @see Transfer#nativeToJava
*
- * @param transferData the platform specific representation of the data to be
- * been converted
- * @return a java byte[]
containing the converted data if the
- * conversion was successful; otherwise null
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java byte[]
containing the converted data if the conversion was
+ * successful; otherwise null
+ *
+ * @see Transfer#javaToNative
*/
protected Object nativeToJava(TransferData transferData) {
if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/Clipboard.d
--- a/dwt/dnd/Clipboard.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/Clipboard.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,6 +35,10 @@
* application to another or within an application.
*
*
IMPORTANT: This class is not intended to be subclassed.
+ * + * @see Clipboard snippets + * @see DWT Example: ClipboardExample + * @see Sample code and further information */ public class Clipboard { diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/DND.d --- a/dwt/dnd/DND.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/dnd/DND.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,6 +25,7 @@ * Class DND contains all the constants used in defining a * DragSource or a DropTarget. * + * @see Sample code and further information */ public class DND { diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/DragSource.d --- a/dwt/dnd/DragSource.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/dnd/DragSource.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -122,6 +122,10 @@ *DragSourceListener
interface.
*
+ * @return the listeners who will be notified when a drag and drop
+ * operation is in progress
+ *
* @exception DWTException dragStart
permits the drag operation to start.
- * For additional information see DragSourceListener.dragStart
.
- */
- public void dragStart(DragSourceEvent event){}
- /**
- * This implementation of dragFinished
does nothing.
- * For additional information see DragSourceListener.dragFinished
.
- */
- public void dragFinished(DragSourceEvent event){}
- /**
- * This implementation of dragSetData
does nothing.
- * For additional information see DragSourceListener.dragSetData
.
- */
- public void dragSetData(DragSourceEvent event){}
+
+/**
+ * This implementation of dragStart
permits the drag operation to start.
+ * For additional information see DragSourceListener.dragStart
.
+ *
+ * @param event the information associated with the drag start event
+ */
+public void dragStart(DragSourceEvent event){}
+
+/**
+ * This implementation of dragFinished
does nothing.
+ * For additional information see DragSourceListener.dragFinished
.
+ *
+ * @param event the information associated with the drag finished event
+ */
+public void dragFinished(DragSourceEvent event){}
+
+/**
+ * This implementation of dragSetData
does nothing.
+ * For additional information see DragSourceListener.dragSetData
.
+ *
+ * @param event the information associated with the drag set data event
+ */
+public void dragSetData(DragSourceEvent event){}
+
}
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/DragSourceEffect.d
--- a/dwt/dnd/DragSourceEffect.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/DragSourceEffect.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@
*
* @see DragSourceAdapter
* @see DragSourceEvent
+ * @see Sample code and further information
*
* @since 3.3
*/
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/DragSourceEvent.d
--- a/dwt/dnd/DragSourceEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/DragSourceEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@
* The DragSourceEvent contains the event information passed in the methods of the DragSourceListener.
*
* @see DragSourceListener
+ * @see Sample code and further information
*/
public class DragSourceEvent : TypedEvent {
/**
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/DropTarget.d
--- a/dwt/dnd/DropTarget.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/DropTarget.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -91,6 +91,10 @@
* DropTargetListener
interface.
*
+ * @return the listeners who will be notified when a drag and drop
+ * operation is in progress
+ *
* @exception DWTException event.detail
to be performed on the current data type
* defined in event.currentDataType
.
* For additional information see DropTargetListener.dragEnter
.
+ *
+ * @param event the information associated with the drag enter event
*/
public void dragEnter(DropTargetEvent event){}
+
/**
* This implementation of dragLeave
does nothing.
* For additional information see DropTargetListener.dragOperationChanged
.
+ *
+ * @param event the information associated with the drag leave event
*/
public void dragLeave(DropTargetEvent event){}
+
/**
* This implementation of dragOperationChanged
permits the default
* operation defined in event.detail
to be performed on the current data type
* defined in event.currentDataType
.
* For additional information see DropTargetListener.dragOperationChanged
.
+ *
+ * @param event the information associated with the drag operation changed event
*/
public void dragOperationChanged(DropTargetEvent event){}
+
/**
* This implementation of dragOver
permits the default
* operation defined in event.detail
to be performed on the current data type
* defined in event.currentDataType
.
* For additional information see DropTargetListener.dragOver
.
+ *
+ * @param event the information associated with the drag over event
*/
public void dragOver(DropTargetEvent event){}
+
/**
* This implementation of drop
does nothing.
* For additional information see DropTargetListener.drop
.
+ *
+ * @param event the information associated with the drop event
*/
public void drop(DropTargetEvent event){}
+
/**
* This implementation of dropAccept
permits the default
* operation defined in event.detail
to be performed on the current data type
* defined in event.currentDataType
.
* For additional information see DropTargetListener.dropAccept
.
+ *
+ * @param event the information associated with the drop accept event
*/
public void dropAccept(DropTargetEvent event){}
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/DropTargetEffect.d
--- a/dwt/dnd/DropTargetEffect.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/DropTargetEffect.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -54,6 +54,7 @@
*
* @see DropTargetAdapter
* @see DropTargetEvent
+ * @see Sample code and further information
*
* @since 3.3
*/
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/DropTargetEvent.d
--- a/dwt/dnd/DropTargetEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/DropTargetEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,8 @@
/**
* The DropTargetEvent contains the event information passed in the methods of the DropTargetListener.
+ *
+ * @see Sample code and further information
*/
public class DropTargetEvent : TypedEvent {
/**
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/FileTransfer.d
--- a/dwt/dnd/FileTransfer.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/FileTransfer.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,7 +30,6 @@
* platform specific representation of the data and vice versa.
* Each String
in the array contains the absolute path for a single
* file or directory.
- * See Transfer
for additional information.
*
* An example of a java String[]
containing a list of files is shown
* below:
javaToNative
converts a list of file names
* represented by a java String[]
to a platform specific representation.
* Each String
in the array contains the absolute path for a single
- * file or directory. For additional information see
- * Transfer#javaToNative
.
- *
- * @param object a java String[]
containing the file names to be
- * converted
- * @param transferData an empty TransferData
object; this
- * object will be filled in on return with the platform specific format of the data
+ * file or directory.
+ *
+ * @param object a java String[]
containing the file names to be converted
+ * @param transferData an empty TransferData
object that will
+ * be filled in on return with the platform specific format of the data
+ *
+ * @see Transfer#nativeToJava
*/
public void javaToNative(Object object, TransferData transferData) {
if (!checkFile(object) || !isSupportedType(transferData)) {
@@ -116,12 +117,12 @@
* This implementation of nativeToJava
converts a platform specific
* representation of a list of file names to a java String[]
.
* Each String in the array contains the absolute path for a single file or directory.
- * For additional information see Transfer#nativeToJava
.
*
- * @param transferData the platform specific representation of the data to be
- * been converted
- * @return a java String[]
containing a list of file names if the
- * conversion was successful; otherwise null
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java String[]
containing a list of file names if the conversion
+ * was successful; otherwise null
+ *
+ * @see Transfer#javaToNative
*/
public Object nativeToJava(TransferData transferData) {
if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/HTMLTransfer.d
--- a/dwt/dnd/HTMLTransfer.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/HTMLTransfer.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,8 +27,7 @@
/**
* The class HTMLTransfer
provides a platform specific mechanism
* for converting text in HTML format represented as a java String
- * to a platform specific representation of the data and vice versa. See
- * Transfer
for additional information.
+ * to a platform specific representation of the data and vice versa.
*
* An example of a java String
containing HTML text is shown
* below:
* String htmlData = "This is a paragraph of text.
";
*
+ *
+ * @see Transfer
*/
public class HTMLTransfer : ByteArrayTransfer {
@@ -74,11 +75,12 @@
/**
* This implementation of javaToNative
converts HTML-formatted text
* represented by a java String
to a platform specific representation.
- * For additional information see Transfer#javaToNative
.
*
* @param object a java String
containing HTML text
- * @param transferData an empty TransferData
object; this
- * object will be filled in on return with the platform specific format of the data
+ * @param transferData an empty TransferData
object that will
+ * be filled in on return with the platform specific format of the data
+ *
+ * @see Transfer#nativeToJava
*/
public void javaToNative (Object object, TransferData transferData){
if (!checkHTML(object) || !isSupportedType(transferData)) {
@@ -145,12 +147,12 @@
/**
* This implementation of nativeToJava
converts a platform specific
* representation of HTML text to a java String
.
- * For additional information see Transfer#nativeToJava
.
*
- * @param transferData the platform specific representation of the data to be
- * been converted
- * @return a java String
containing HTML text if the
- * conversion was successful; otherwise null
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java String
containing HTML text if the conversion was successful;
+ * otherwise null
+ *
+ * @see Transfer#javaToNative
*/
public Object nativeToJava(TransferData transferData){
if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/ImageTransfer.d
--- a/dwt/dnd/ImageTransfer.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/ImageTransfer.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,18 +26,18 @@
/**
* The class ImageTransfer
provides a platform specific mechanism
- * for converting a Image represented as a java ImageData
to a
+ * for converting an Image represented as a java ImageData
to a
* platform specific representation of the data and vice versa.
- * See Transfer
for additional information.
*
- * An example of a java ImageData
is shown
- * below:
An example of a java ImageData
is shown below:
- * Image image = new Image("C:\temp\img1.gif");
+ * Image image = new Image(display, "C:\temp\img1.gif");
* ImageData imgData = image.getImageData();
*
*
+ * @see Transfer
+ *
* @since 3.4
*/
public class ImageTransfer : ByteArrayTransfer {
@@ -65,12 +65,12 @@
/**
* This implementation of javaToNative
converts an ImageData object represented
* by java ImageData
to a platform specific representation.
- * For additional information see Transfer#javaToNative
.
*
- * @param object a java ImageData
containing the ImageData to be
- * converted
- * @param transferData an empty TransferData
object; this
- * object will be filled in on return with the platform specific format of the data
+ * @param object a java ImageData
containing the ImageData to be converted
+ * @param transferData an empty TransferData
object that will
+ * be filled in on return with the platform specific format of the data
+ *
+ * @see Transfer#nativeToJava
*/
public void javaToNative(Object object, TransferData transferData) {
if (!checkImage(object) || !isSupportedType(transferData)) {
@@ -138,12 +138,12 @@
/**
* This implementation of nativeToJava
converts a platform specific
* representation of an image to java ImageData
.
- * For additional information see Transfer#nativeToJava
.
*
- * @param transferData the platform specific representation of the data to be
- * been converted
- * @return a java ImageData
of the image if
- * conversion was successful; otherwise null
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java ImageData
of the image if the conversion was successful;
+ * otherwise null
+ *
+ * @see Transfer#javaToNative
*/
public Object nativeToJava(TransferData transferData) {
if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/OleEnumFORMATETC.d
--- a/dwt/dnd/OleEnumFORMATETC.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/OleEnumFORMATETC.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/RTFTransfer.d
--- a/dwt/dnd/RTFTransfer.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/RTFTransfer.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,8 +28,7 @@
/**
* The class RTFTransfer
provides a platform specific mechanism
* for converting text in RTF format represented as a java String
- * to a platform specific representation of the data and vice versa. See
- * Transfer
for additional information.
+ * to a platform specific representation of the data and vice versa.
*
* An example of a java String
containing RTF text is shown
* below:
* String rtfData = "{\\rtf1{\\colortbl;\\red255\\green0\\blue0;}\\uc1\\b\\i Hello World}";
*
+ *
+ * @see Transfer
*/
public class RTFTransfer : ByteArrayTransfer {
@@ -69,11 +70,12 @@
/**
* This implementation of javaToNative
converts RTF-formatted text
* represented by a java String
to a platform specific representation.
- * For additional information see Transfer#javaToNative
.
*
* @param object a java String
containing RTF text
- * @param transferData an empty TransferData
object; this
- * object will be filled in on return with the platform specific format of the data
+ * @param transferData an empty TransferData
object that will
+ * be filled in on return with the platform specific format of the data
+ *
+ * @see Transfer#nativeToJava
*/
public void javaToNative (Object object, TransferData transferData){
if (!checkRTF(object) || !isSupportedType(transferData)) {
@@ -102,12 +104,12 @@
/**
* This implementation of nativeToJava
converts a platform specific
* representation of RTF text to a java String
.
- * For additional information see Transfer#nativeToJava
.
*
- * @param transferData the platform specific representation of the data to be
- * been converted
- * @return a java String
containing RTF text if the
- * conversion was successful; otherwise null
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java String
containing RTF text if the conversion was successful;
+ * otherwise null
+ *
+ * @see Transfer#javaToNative
*/
public Object nativeToJava(TransferData transferData){
if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/TableDragSourceEffect.d
--- a/dwt/dnd/TableDragSourceEffect.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/TableDragSourceEffect.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,6 +41,7 @@
*
* @see DragSourceEffect
* @see DragSourceEvent
+ * @see Sample code and further information
*
* @since 3.3
*/
@@ -93,7 +94,11 @@
SHDRAGIMAGE shdi;
int DI_GETDRAGIMAGE = OS.RegisterWindowMessage ( "ShellGetDragImage"w.ptr ); //$NON-NLS-1$
if (OS.SendMessage (control.handle, DI_GETDRAGIMAGE, 0, &shdi) !is 0) {
- event.x += shdi.ptOffset.x;
+ if ((control.getStyle() & DWT.MIRRORED) !is 0) {
+ event.x += shdi.sizeDragImage.cx - shdi.ptOffset.x;
+ } else {
+ event.x += shdi.ptOffset.x;
+ }
event.y += shdi.ptOffset.y;
auto hImage = shdi.hbmpDragImage;
if (hImage !is null) {
@@ -129,20 +134,23 @@
//OS.MoveMemory (srcData, dibBM.bmBits, sizeInBytes);
byte[] srcData = (cast(byte*) dibBM.bmBits)[ 0 .. BITMAPINFOHEADER.sizeof ];
- byte[] alphaData = new byte[srcWidth * srcHeight];
- int spinc = dibBM.bmWidthBytes - srcWidth * 4;
- int ap = 0, sp = 3;
- for (int y = 0; y < srcHeight; ++y) {
- for (int x = 0; x < srcWidth; ++x) {
- alphaData [ap++] = srcData [sp];
- sp += 4;
- }
- sp += spinc;
- }
PaletteData palette = new PaletteData(0xFF00, 0xFF0000, 0xFF000000);
ImageData data = new ImageData(srcWidth, srcHeight, bm.bmBitsPixel, palette, bm.bmWidthBytes, srcData);
- data.alphaData = alphaData;
- data.transparentPixel = shdi.crColorKey;
+ if (shdi.crColorKey is -1) {
+ byte[] alphaData = new byte[srcWidth * srcHeight];
+ int spinc = dibBM.bmWidthBytes - srcWidth * 4;
+ int ap = 0, sp = 3;
+ for (int y = 0; y < srcHeight; ++y) {
+ for (int x = 0; x < srcWidth; ++x) {
+ alphaData [ap++] = srcData [sp];
+ sp += 4;
+ }
+ sp += spinc;
+ }
+ data.alphaData = alphaData;
+ } else {
+ data.transparentPixel = shdi.crColorKey << 8;
+ }
dragSourceImage = new Image(control.getDisplay(), data);
OS.SelectObject (memHdc, oldMemBitmap);
OS.DeleteDC (memHdc);
@@ -150,6 +158,7 @@
OS.SelectObject (srcHdc, oldSrcBitmap);
OS.DeleteDC (srcHdc);
OS.ReleaseDC (null, hdc);
+ OS.DeleteObject (hImage);
return dragSourceImage;
}
}
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/TableDropTargetEffect.d
--- a/dwt/dnd/TableDropTargetEffect.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/TableDropTargetEffect.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -49,6 +49,7 @@
*
* @see DropTargetAdapter
* @see DropTargetEvent
+ * @see Sample code and further information
*
* @since 3.3
*/
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/TextTransfer.d
--- a/dwt/dnd/TextTransfer.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/TextTransfer.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -69,10 +69,10 @@
* represented by a java String
to a platform specific representation.
*
* @param object a java String
containing text
- * @param transferData an empty TransferData
object; this object
- * will be filled in on return with the platform specific format of the data
+ * @param transferData an empty TransferData
object that will
+ * be filled in on return with the platform specific format of the data
*
- * @see Transfer#javaToNative
+ * @see Transfer#nativeToJava
*/
public void javaToNative (Object object, TransferData transferData){
if (!checkText(object) || !isSupportedType(transferData)) {
@@ -125,7 +125,7 @@
* @param transferData the platform specific representation of the data to be converted
* @return a java String
containing text if the conversion was successful; otherwise null
*
- * @see Transfer#nativeToJava
+ * @see Transfer#javaToNative
*/
public Object nativeToJava(TransferData transferData){
if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/Transfer.d
--- a/dwt/dnd/Transfer.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/Transfer.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,6 +29,9 @@
* ByteArrayTransfer class.
*
* @see ByteArrayTransfer
+ * @see Drag and Drop snippets
+ * @see DWT Example: DNDExample
+ * @see Sample code and further information
*/
public abstract class Transfer {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/TransferData.d
--- a/dwt/dnd/TransferData.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/dnd/TransferData.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,6 +28,8 @@
* You should only need to become familiar with the fields in this class if you * are implementing a Transfer subclass and you are unable to subclass the * ByteArrayTransfer class.
+ * + * @see Sample code and further information */ public class TransferData { /** diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/TreeDragSourceEffect.d --- a/dwt/dnd/TreeDragSourceEffect.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/dnd/TreeDragSourceEffect.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,6 +40,7 @@ * * @see DragSourceEffect * @see DragSourceEvent + * @see Sample code and further information * * @since 3.3 */ @@ -92,7 +93,11 @@ SHDRAGIMAGE shdi; int DI_GETDRAGIMAGE = OS.RegisterWindowMessage ("ShellGetDragImage"w.ptr); //$NON-NLS-1$ if (OS.SendMessage (control.handle, DI_GETDRAGIMAGE, 0, &shdi) !is 0) { - event.x += shdi.ptOffset.x; + if ((control.getStyle() & DWT.MIRRORED) !is 0) { + event.x += shdi.sizeDragImage.cx - shdi.ptOffset.x; + } else { + event.x += shdi.ptOffset.x; + } event.y += shdi.ptOffset.y; auto hImage = shdi.hbmpDragImage; if (hImage !is null) { @@ -128,7 +133,21 @@ PaletteData palette = new PaletteData(0xFF00, 0xFF0000, 0xFF000000); ImageData data = new ImageData(srcWidth, srcHeight, bm.bmBitsPixel, palette, bm.bmWidthBytes, srcData); - data.transparentPixel = shdi.crColorKey << 8; + if (shdi.crColorKey is -1) { + byte[] alphaData = new byte[srcWidth * srcHeight]; + int spinc = dibBM.bmWidthBytes - srcWidth * 4; + int ap = 0, sp = 3; + for (int y = 0; y < srcHeight; ++y) { + for (int x = 0; x < srcWidth; ++x) { + alphaData [ap++] = srcData [sp]; + sp += 4; + } + sp += spinc; + } + data.alphaData = alphaData; + } else { + data.transparentPixel = shdi.crColorKey << 8; + } dragSourceImage = new Image (control.getDisplay (), data); OS.SelectObject (memHdc, oldMemBitmap); OS.DeleteDC (memHdc); @@ -136,6 +155,7 @@ OS.SelectObject (srcHdc, oldSrcBitmap); OS.DeleteDC (srcHdc); OS.ReleaseDC (null, hdc); + OS.DeleteObject (hImage); return dragSourceImage; } } diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/TreeDropTargetEffect.d --- a/dwt/dnd/TreeDropTargetEffect.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/dnd/TreeDropTargetEffect.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -54,6 +54,7 @@ * * @see DropTargetAdapter * @see DropTargetEvent + * @see Sample code and further information * * @since 3.3 */ diff -r d10ff1f47f84 -r 55591bc3974c dwt/dnd/URLTransfer.d --- a/dwt/dnd/URLTransfer.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/dnd/URLTransfer.d Sun Jul 06 17:26:06 2008 +0200 @@ -27,16 +27,16 @@ /** * The classURLTransfer
provides a platform specific mechanism
* for converting text in URL format represented as a java String
- * to a platform specific representation of the data and vice versa. See
- * Transfer
for additional information. The string
+ * to a platform specific representation of the data and vice versa. The string
* must contain a fully specified url.
*
- * An example of a java String
containing a URL is shown
- * below:
An example of a java String
containing a URL is shown below:
* String url = "http://www.eclipse.org";
*
+ *
+ * @see Transfer
*/
public class URLTransfer : ByteArrayTransfer {
@@ -69,11 +69,12 @@
/**
* This implementation of javaToNative
converts a URL
* represented by a java String
to a platform specific representation.
- * For additional information see Transfer#javaToNative
.
*
* @param object a java String
containing a URL
- * @param transferData an empty TransferData
object; this
- * object will be filled in on return with the platform specific format of the data
+ * @param transferData an empty TransferData
object that will
+ * be filled in on return with the platform specific format of the data
+ *
+ * @see Transfer#nativeToJava
*/
public void javaToNative (Object object, TransferData transferData){
if (!checkURL(object) || !isSupportedType(transferData)) {
@@ -101,14 +102,14 @@
}
/**
- * This implementation of nativeToJava
converts a platform specific
- * representation of a URL to a java String
.
- * For additional information see Transfer#nativeToJava
.
- *
- * @param transferData the platform specific representation of the data to be
- * converted
- * @return a java String
containing a URL if the
- * conversion was successful; otherwise null
+ * This implementation of nativeToJava
converts a platform
+ * specific representation of a URL to a java String
.
+ *
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java String
containing a URL if the conversion was successful;
+ * otherwise null
+ *
+ * @see Transfer#javaToNative
*/
public Object nativeToJava(TransferData transferData){
if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
diff -r d10ff1f47f84 -r 55591bc3974c dwt/dwthelper/utils.d
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/ArmEvent.d
--- a/dwt/events/ArmEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/ArmEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@
* a widget such as a menu item being armed.
*
* @see ArmListener
+ * @see Sample code and further information
*/
public final class ArmEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/ControlAdapter.d
--- a/dwt/events/ControlAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/ControlAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@
*
* @see ControlListener
* @see ControlEvent
+ * @see Sample code and further information
*/
public abstract class ControlAdapter : ControlListener {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/ControlEvent.d
--- a/dwt/events/ControlEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/ControlEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
* controls being moved or resized.
*
* @see ControlListener
+ * @see Sample code and further information
*/
public final class ControlEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/DisposeEvent.d
--- a/dwt/events/DisposeEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/DisposeEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
* widgets being disposed.
*
* @see DisposeListener
+ * @see Sample code and further information
*/
public final class DisposeEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/DragDetectEvent.d
--- a/dwt/events/DragDetectEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/DragDetectEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@
* a drag gesture.
*
* @see DragDetectListener
+ * @see Sample code and further information
*
* @since 3.3
*/
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/ExpandAdapter.d
--- a/dwt/events/ExpandAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/ExpandAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
*
* @see ExpandListener
* @see ExpandEvent
+ * @see Sample code and further information
*
* @since 3.2
*/
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/ExpandEvent.d
--- a/dwt/events/ExpandEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/ExpandEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
* ExpandItem
s being expanded or collapsed.
*
* @see ExpandListener
+ * @see Sample code and further information
*
* @since 3.2
*/
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/FocusAdapter.d
--- a/dwt/events/FocusAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/FocusAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
*
* @see FocusListener
* @see FocusEvent
+ * @see Sample code and further information
*/
public abstract class FocusAdapter : FocusListener {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/FocusEvent.d
--- a/dwt/events/FocusEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/FocusEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
* widgets gaining and losing focus.
*
* @see FocusListener
+ * @see Sample code and further information
*/
public final class FocusEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/HelpEvent.d
--- a/dwt/events/HelpEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/HelpEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
* help being requested for a widget.
*
* @see HelpListener
+ * @see Sample code and further information
*/
public final class HelpEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/KeyAdapter.d
--- a/dwt/events/KeyAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/KeyAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
*
* @see KeyListener
* @see KeyEvent
+ * @see Sample code and further information
*/
public abstract class KeyAdapter : KeyListener {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/KeyEvent.d
--- a/dwt/events/KeyEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/KeyEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,8 +34,10 @@
* not necessary to add traversal listeners for these controls,
* unless you want to override the default traversal.
*
+ *
* @see KeyListener
* @see TraverseListener
+ * @see Sample code and further information
*/
public class KeyEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/MenuAdapter.d
--- a/dwt/events/MenuAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/MenuAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
*
* @see MenuListener
* @see MenuEvent
+ * @see Sample code and further information
*/
public abstract class MenuAdapter : MenuListener {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/MenuDetectEvent.d
--- a/dwt/events/MenuDetectEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/MenuDetectEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@
* specific trigger for showing a context menu is detected.
*
* @see MenuDetectListener
+ * @see Sample code and further information
*
* @since 3.3
*/
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/MenuEvent.d
--- a/dwt/events/MenuEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/MenuEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
* menus being shown and hidden.
*
* @see MenuListener
+ * @see Sample code and further information
*/
public final class MenuEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/ModifyEvent.d
--- a/dwt/events/ModifyEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/ModifyEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
* text being modified.
*
* @see ModifyListener
+ * @see Sample code and further information
*/
public final class ModifyEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/MouseAdapter.d
--- a/dwt/events/MouseAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/MouseAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,6 +26,7 @@
*
* @see MouseListener
* @see MouseEvent
+ * @see Sample code and further information
*/
public abstract class MouseAdapter : MouseListener {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/MouseEvent.d
--- a/dwt/events/MouseEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/MouseEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,6 +33,7 @@
* @see MouseListener
* @see MouseMoveListener
* @see MouseTrackListener
+ * @see Sample code and further information
*/
public class MouseEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/MouseTrackAdapter.d
--- a/dwt/events/MouseTrackAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/MouseTrackAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,6 +26,7 @@
*
* @see MouseTrackListener
* @see MouseEvent
+ * @see Sample code and further information
*/
public abstract class MouseTrackAdapter : MouseTrackListener {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/PaintEvent.d
--- a/dwt/events/PaintEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/PaintEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,6 +26,7 @@
* visible areas of controls requiring re-painting.
*
* @see PaintListener
+ * @see Sample code and further information
*/
public final class PaintEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/SelectionAdapter.d
--- a/dwt/events/SelectionAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/SelectionAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
*
* @see SelectionListener
* @see SelectionEvent
+ * @see Sample code and further information
*/
public abstract class SelectionAdapter : SelectionListener {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/SelectionEvent.d
--- a/dwt/events/SelectionEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/SelectionEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@
*
*
* @see SelectionListener
+ * @see Sample code and further information
*/
public class SelectionEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/ShellAdapter.d
--- a/dwt/events/ShellAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/ShellAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
*
* @see ShellListener
* @see ShellEvent
+ * @see Sample code and further information
*/
public abstract class ShellAdapter : ShellListener {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/ShellEvent.d
--- a/dwt/events/ShellEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/ShellEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@
* operations being performed on shells.
*
* @see ShellListener
+ * @see Sample code and further information
*/
public final class ShellEvent : TypedEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/TraverseEvent.d
--- a/dwt/events/TraverseEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/TraverseEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -81,6 +81,7 @@
*
*
* @see TraverseListener
+ * @see Sample code and further information
*/
public final class TraverseEvent : KeyEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/TreeAdapter.d
--- a/dwt/events/TreeAdapter.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/TreeAdapter.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
*
* @see TreeListener
* @see TreeEvent
+ * @see Sample code and further information
*/
public abstract class TreeAdapter : TreeListener {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/TreeEvent.d
--- a/dwt/events/TreeEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/TreeEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
* trees being expanded and collapsed.
*
* @see TreeListener
+ * @see Sample code and further information
*/
public final class TreeEvent : SelectionEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/TypedEvent.d
--- a/dwt/events/TypedEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/TypedEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@
* applicable to the event occurrence.
*
* @see dwt.widgets.Event
+ * @see Sample code and further information
*/
public class TypedEvent : DWTEventObject {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/events/VerifyEvent.d
--- a/dwt/events/VerifyEvent.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/events/VerifyEvent.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@
* widgets handling keyboard events
*
* @see VerifyListener
+ * @see Sample code and further information
*/
public final class VerifyEvent : KeyEvent {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Color.d
--- a/dwt/graphics/Color.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/graphics/Color.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,9 @@
*
* @see RGB
* @see Device#getSystemColor
+ * @see Color and RGB snippets
+ * @see DWT Example: PaintExample
+ * @see Sample code and further information
*/
public final class Color : Resource {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Cursor.d
--- a/dwt/graphics/Cursor.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/graphics/Cursor.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,6 +50,9 @@
* * Note: Only one of the above styles may be specified. *
+ * + * @see Cursor snippets + * @see Sample code and further information */ public final class Cursor : Resource { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Device.d --- a/dwt/graphics/Device.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/Device.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,6 +46,8 @@ * such as the Display device and the Printer device. Devices * can have a graphics context (GC) created for them, and they * can be drawn on by sending messages to the associated GC. + * + * @see Sample code and further information */ public abstract class Device : Drawable { @@ -86,7 +88,6 @@ /* Scripts */ SCRIPT_PROPERTIES*[] scripts; - LOGFONT* [] logFontsCache; /* Advanced Graphics */ ULONG_PTR gdipToken; @@ -928,7 +929,6 @@ } gdipToken = 0; // TODO: assignment of 0 might not be valid for token scripts = null; - logFontsCache = null; if (hPalette !is null) OS.DeleteObject (hPalette); hPalette = null; colorRefCount = null; diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Font.d --- a/dwt/graphics/Font.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/Font.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,6 +38,9 @@ * * * @see FontData + * @see Font snippets + * @see DWT Examples: GraphicsExample, PaintExample + * @see Sample code and further information */ public final class Font : Resource { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/FontData.d --- a/dwt/graphics/FontData.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/FontData.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -44,6 +44,7 @@ * required, and thus nodispose()
method is provided.
*
* @see Font
+ * @see Sample code and further information
*/
public final class FontData {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/FontMetrics.d
--- a/dwt/graphics/FontMetrics.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/graphics/FontMetrics.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@
* using the getFontMetrics()
method.
*
* @see GC#getFontMetrics
+ * @see Sample code and further information
*/
public final class FontMetrics {
diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/GC.d
--- a/dwt/graphics/GC.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/graphics/GC.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -69,6 +69,9 @@
*
*
* @see dwt.events.PaintEvent
+ * @see GC snippets
+ * @see DWT Examples: GraphicsExample, PaintExample
+ * @see Sample code and further information
*/
public final class GC : Resource {
@@ -1481,97 +1484,101 @@
void drawBitmapTransparent(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, bool simple, BITMAP bm, int imgWidth, int imgHeight) {
/* Find the RGB values for the transparent pixel. */
- int transBlue = 0, transGreen = 0, transRed = 0;
bool isDib = bm.bmBits !is null;
auto hBitmap = srcImage.handle;
auto srcHdc = OS.CreateCompatibleDC(handle);
auto oldSrcBitmap = OS.SelectObject(srcHdc, hBitmap);
byte[] originalColors = null;
- if (bm.bmBitsPixel <= 8) {
- if (isDib) {
- /* Palette-based DIBSECTION */
- static if (OS.IsWinCE) {
- byte* pBits = cast(byte*)bm.bmBits;
- //OS.MoveMemory(pBits, bm.bmBits, 1);
- byte oldValue = pBits[0];
- int mask = (0xFF << (8 - bm.bmBitsPixel)) & 0x00FF;
- pBits[0] = cast(byte)((srcImage.transparentPixel << (8 - bm.bmBitsPixel)) | (pBits[0] & ~mask));
- //OS.MoveMemory(bm.bmBits, pBits, 1);
- int color = OS.GetPixel(srcHdc, 0, 0);
- pBits[0] = oldValue;
- //OS.MoveMemory(bm.bmBits, pBits, 1);
- transBlue = (color & 0xFF0000) >> 16;
- transGreen = (color & 0xFF00) >> 8;
- transRed = color & 0xFF;
- } else {
- int maxColors = 1 << bm.bmBitsPixel;
- byte[] oldColors = new byte[maxColors * 4];
- OS.GetDIBColorTable(srcHdc, 0, maxColors, cast(RGBQUAD*)oldColors.ptr);
- int offset = srcImage.transparentPixel * 4;
- bool fixPalette = false;
- for (int i = 0; i < oldColors.length; i += 4) {
- if (i !is offset) {
- if (oldColors[offset] is oldColors[i] && oldColors[offset+1] is oldColors[i+1] && oldColors[offset+2] is oldColors[i+2]) {
- fixPalette = true;
- break;
+ int transparentColor = srcImage.transparentColor;
+ if (transparentColor is -1) {
+ int transBlue = 0, transGreen = 0, transRed = 0;
+ bool fixPalette = false;
+ if (bm.bmBitsPixel <= 8) {
+ if (isDib) {
+ /* Palette-based DIBSECTION */
+ static if (OS.IsWinCE) {
+ byte* pBits = cast(byte*)bm.bmBits;
+ //OS.MoveMemory(pBits, bm.bmBits, 1);
+ byte oldValue = pBits[0];
+ int mask = (0xFF << (8 - bm.bmBitsPixel)) & 0x00FF;
+ pBits[0] = cast(byte)((srcImage.transparentPixel << (8 - bm.bmBitsPixel)) | (pBits[0] & ~mask));
+ //OS.MoveMemory(bm.bmBits, pBits, 1);
+ int color = OS.GetPixel(srcHdc, 0, 0);
+ pBits[0] = oldValue;
+ //OS.MoveMemory(bm.bmBits, pBits, 1);
+ transBlue = (color & 0xFF0000) >> 16;
+ transGreen = (color & 0xFF00) >> 8;
+ transRed = color & 0xFF;
+ } else {
+ int maxColors = 1 << bm.bmBitsPixel;
+ byte[] oldColors = new byte[maxColors * 4];
+ OS.GetDIBColorTable(srcHdc, 0, maxColors, cast(RGBQUAD*)oldColors.ptr);
+ int offset = srcImage.transparentPixel * 4;
+ for (int i = 0; i < oldColors.length; i += 4) {
+ if (i !is offset) {
+ if (oldColors[offset] is oldColors[i] && oldColors[offset+1] is oldColors[i+1] && oldColors[offset+2] is oldColors[i+2]) {
+ fixPalette = true;
+ break;
+ }
}
}
+ if (fixPalette) {
+ byte[] newColors = new byte[oldColors.length];
+ transRed = transGreen = transBlue = 0xff;
+ newColors[offset] = cast(byte)transBlue;
+ newColors[offset+1] = cast(byte)transGreen;
+ newColors[offset+2] = cast(byte)transRed;
+ OS.SetDIBColorTable(srcHdc, 0, maxColors, cast(RGBQUAD*)newColors.ptr);
+ originalColors = oldColors;
+ } else {
+ transBlue = oldColors[offset] & 0xFF;
+ transGreen = oldColors[offset+1] & 0xFF;
+ transRed = oldColors[offset+2] & 0xFF;
+ }
}
- if (fixPalette) {
- byte[] newColors = new byte[oldColors.length];
- transRed = transGreen = transBlue = 0xff;
- newColors[offset] = cast(byte)transBlue;
- newColors[offset+1] = cast(byte)transGreen;
- newColors[offset+2] = cast(byte)transRed;
- OS.SetDIBColorTable(srcHdc, 0, maxColors, cast(RGBQUAD*)newColors.ptr);
- originalColors = oldColors;
- } else {
- transBlue = oldColors[offset] & 0xFF;
- transGreen = oldColors[offset+1] & 0xFF;
- transRed = oldColors[offset+2] & 0xFF;
- }
+ } else {
+ /* Palette-based bitmap */
+ int numColors = 1 << bm.bmBitsPixel;
+ /* Set the few fields necessary to get the RGB data out */
+ BITMAPINFOHEADER bmiHeader;
+ bmiHeader.biSize = BITMAPINFOHEADER.sizeof;
+ bmiHeader.biPlanes = bm.bmPlanes;
+ bmiHeader.biBitCount = bm.bmBitsPixel;
+ byte[] bmi = new byte[BITMAPINFOHEADER.sizeof + numColors * 4];
+ bmi[] = (cast(byte*)&bmiHeader)[ 0 .. BITMAPINFOHEADER.sizeof ];
+ static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED);
+ OS.GetDIBits(srcHdc, srcImage.handle, 0, 0, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS);
+ int offset = BITMAPINFOHEADER.sizeof + 4 * srcImage.transparentPixel;
+ transRed = bmi[offset + 2] & 0xFF;
+ transGreen = bmi[offset + 1] & 0xFF;
+ transBlue = bmi[offset] & 0xFF;
}
} else {
- /* Palette-based bitmap */
- int numColors = 1 << bm.bmBitsPixel;
- /* Set the few fields necessary to get the RGB data out */
- BITMAPINFOHEADER bmiHeader;
- bmiHeader.biSize = BITMAPINFOHEADER.sizeof;
- bmiHeader.biPlanes = bm.bmPlanes;
- bmiHeader.biBitCount = bm.bmBitsPixel;
- byte[] bmi = new byte[BITMAPINFOHEADER.sizeof + numColors * 4];
- bmi[] = (cast(byte*)&bmiHeader)[ 0 .. BITMAPINFOHEADER.sizeof ];
- static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED);
- OS.GetDIBits(srcHdc, srcImage.handle, 0, 0, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS);
- int offset = BITMAPINFOHEADER.sizeof + 4 * srcImage.transparentPixel;
- transRed = bmi[offset + 2] & 0xFF;
- transGreen = bmi[offset + 1] & 0xFF;
- transBlue = bmi[offset] & 0xFF;
+ /* Direct color image */
+ int pixel = srcImage.transparentPixel;
+ switch (bm.bmBitsPixel) {
+ case 16:
+ transBlue = (pixel & 0x1F) << 3;
+ transGreen = (pixel & 0x3E0) >> 2;
+ transRed = (pixel & 0x7C00) >> 7;
+ break;
+ case 24:
+ transBlue = (pixel & 0xFF0000) >> 16;
+ transGreen = (pixel & 0xFF00) >> 8;
+ transRed = pixel & 0xFF;
+ break;
+ case 32:
+ transBlue = (pixel & 0xFF000000) >>> 24;
+ transGreen = (pixel & 0xFF0000) >> 16;
+ transRed = (pixel & 0xFF00) >> 8;
+ break;
+ default:
+ }
}
- } else {
- /* Direct color image */
- int pixel = srcImage.transparentPixel;
- switch (bm.bmBitsPixel) {
- case 16:
- transBlue = (pixel & 0x1F) << 3;
- transGreen = (pixel & 0x3E0) >> 2;
- transRed = (pixel & 0x7C00) >> 7;
- break;
- case 24:
- transBlue = (pixel & 0xFF0000) >> 16;
- transGreen = (pixel & 0xFF00) >> 8;
- transRed = pixel & 0xFF;
- break;
- case 32:
- transBlue = (pixel & 0xFF000000) >>> 24;
- transGreen = (pixel & 0xFF0000) >> 16;
- transRed = (pixel & 0xFF00) >> 8;
- break;
- default:
- }
+ transparentColor = transBlue << 16 | transGreen << 8 | transRed;
+ if (!fixPalette) srcImage.transparentColor = transparentColor;
}
- int transparentColor = transBlue << 16 | transGreen << 8 | transRed;
static if (OS.IsWinCE) {
/*
* Note in WinCE. TransparentImage uses the first entry of a palette
@@ -3001,7 +3008,8 @@
}
/**
- * Returns the receiver's alpha value.
+ * Returns the receiver's alpha value. The alpha value
+ * is between 0 (transparent) and 255 (opaque).
*
* @return the alpha value
*
@@ -3939,7 +3947,8 @@
}
/**
- * Sets the receiver's alpha value.
+ * Sets the receiver's alpha value which must be
+ * between 0 (transparent) and 255 (opaque).
* * This operation requires the operating system's advanced * graphics subsystem which may not be available on some diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/GCData.d --- a/dwt/graphics/GCData.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/GCData.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,6 +30,7 @@ * within the packages provided by DWT. It is not available on all * platforms, and should never be called from application code. *
+ * @see Sample code and further information */ public final class GCData { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/GlyphMetrics.d --- a/dwt/graphics/GlyphMetrics.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/GlyphMetrics.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,6 +32,7 @@ * * @see TextStyle * @see TextLayout + * @see Sample code and further information * * @since 3.2 */ @@ -56,13 +57,17 @@ * Constructs an instance of this class with the given * ascent, descent and width values. * + * @param ascent the GlyphMetrics ascent + * @param descent the GlyphMetrics descent + * @param width the GlyphMetrics width + * * @exception IllegalArgumentExceptionx
in
* scanline y
in the receiver's alpha data.
+ * The alpha value is between 0 (transparent) and
+ * 255 (opaque).
*
* @param x the x coordinate of the pixel to get the alpha value of
* @param y the y coordinate of the pixel to get the alpha value of
@@ -620,7 +625,9 @@
/**
* Returns getWidth
alpha values starting at offset
* x
in scanline y
in the receiver's alpha
- * data starting at startIndex
.
+ * data starting at startIndex
. The alpha values
+ * are unsigned, between (byte)0
(transparent) and
+ * (byte)255
(opaque).
*
* @param x the x position of the pixel to begin getting alpha values
* @param y the y position of the pixel to begin getting alpha values
@@ -1174,6 +1181,8 @@
/**
* Sets the alpha value at offset x
in
* scanline y
in the receiver's alpha data.
+ * The alpha value must be between 0 (transparent)
+ * and 255 (opaque).
*
* @param x the x coordinate of the alpha value to set
* @param y the y coordinate of the alpha value to set
@@ -1195,7 +1204,8 @@
* Sets the alpha values starting at offset x
in
* scanline y
in the receiver's alpha data to the
* values from the array alphas
starting at
- * startIndex
.
+ * startIndex
. The alpha values must be between
+ * (byte)0
(transparent) and (byte)255
(opaque)
*
* @param x the x coordinate of the pixel to being setting the alpha values
* @param y the y coordinate of the pixel to being setting the alpha values
diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/ImageLoader.d
--- a/dwt/graphics/ImageLoader.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/graphics/ImageLoader.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -47,6 +47,9 @@
* * This operation requires the operating system's advanced * graphics subsystem which may not be available on some diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/PathData.d --- a/dwt/graphics/PathData.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/PathData.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,6 +17,7 @@ * Instances of this class describe device-independent paths. * * @see Path + * @see Sample code and further information * * @since 3.1 */ diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Pattern.d --- a/dwt/graphics/Pattern.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/Pattern.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,6 +40,10 @@ * which may not be available on some platforms. *
* + * @see Path, Pattern snippets + * @see DWT Example: GraphicsExample + * @see Sample code and further information + * * @since 3.1 */ public class Pattern : Resource { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Point.d --- a/dwt/graphics/Point.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/Point.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,6 +40,7 @@ * * * @see Rectangle + * @see Sample code and further information */ public final class Point : SerializableCompatibility { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/RGB.d --- a/dwt/graphics/RGB.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/RGB.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,6 +40,8 @@ * * * @see Color + * @see Color and RGB snippets + * @see Sample code and further information */ public final class RGB : SerializableCompatibility { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Rectangle.d --- a/dwt/graphics/Rectangle.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/Rectangle.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -44,6 +44,7 @@ * * * @see Point + * @see Sample code and further information */ public final class Rectangle : SerializableCompatibility { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Region.d --- a/dwt/graphics/Region.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/Region.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,6 +35,9 @@ * method to release the operating system resources managed by each instance * when those instances are no longer required. * + * + * @see DWT Example: GraphicsExample + * @see Sample code and further information */ public final class Region : Resource { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Resource.d --- a/dwt/graphics/Resource.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/Resource.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,6 +34,7 @@ * * @see #dispose * @see #isDisposed + * @see Sample code and further information * * @since 3.1 */ @@ -44,7 +45,7 @@ */ Device device; -this() { +public this() { } this(Device device) { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/TextLayout.d --- a/dwt/graphics/TextLayout.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/TextLayout.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -50,7 +50,11 @@ * when those instances are no longer required. * * - * @since 3.0 + * @see TextLayout, TextStyle snippets + * @see DWT Example: CustomControlExample, StyledText tab + * @see Sample code and further information + * + * @since 3.0 */ public final class TextLayout : Resource { @@ -184,10 +188,7 @@ psla = null; } if (fallbackFont !is null) { - if (mLangFontLink2 !is null) { - /* ReleaseFont() */ - OS.VtblCall(8, mLangFontLink2, cast(int)fallbackFont); - } + OS.DeleteObject(fallbackFont); fallbackFont = null; } width = 0; @@ -243,24 +244,6 @@ OS.ScriptBreak(chars.ptr, chars.length, &run.analysis, run.psla); } -void checkItem (HDC hDC, StyleItem item) { - if (item.fallbackFont !is null) { - /* - * Feature in Windows. The fallback font returned by the MLang service - * can be disposed by some other client running in the same thread. - * For example, disposing a Browser widget internally releases all fonts - * in the MLang cache. The fix is to use GetObject() to detect if the - * font was disposed and reshape the run. - */ - LOGFONT logFont; - if (OS.GetObject( item.fallbackFont, LOGFONT.sizeof, &logFont) is 0) { - item.free(); - OS.SelectObject(hDC, getItemFont(item)); - shape(hDC, item); - } - } -} - void checkLayout () { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); } @@ -317,7 +300,10 @@ if (next.length !is 0 && segmentsText.charAt(next.start) is '\n') { run.length += 1; next.free(); - i++; + StyleItem[] newAllRuns = new StyleItem[allRuns.length - 1]; + System.arraycopy(allRuns, 0, newAllRuns, 0, i + 1); + System.arraycopy(allRuns, i + 2, newAllRuns, i + 1, allRuns.length - i - 2); + allRuns = newAllRuns; } break; } @@ -396,12 +382,14 @@ newRun.start = run.start + start; newRun.length = run.length - start; newRun.style = run.style; - newRun.analysis = run.analysis; + newRun.analysis = cloneScriptAnalysis(run.analysis); run.free(); run.length = start; OS.SelectObject(srcHdc, getItemFont(run)); + run.analysis.fNoGlyphIndex = false; shape (srcHdc, run); OS.SelectObject(srcHdc, getItemFont(newRun)); + newRun.analysis.fNoGlyphIndex = false; shape (srcHdc, newRun); StyleItem[] newAllRuns = new StyleItem[allRuns.length + 1]; System.arraycopy(allRuns, 0, newAllRuns, 0, i + 1); @@ -521,6 +509,29 @@ OS.OleUninitialize(); } +SCRIPT_ANALYSIS cloneScriptAnalysis ( inout SCRIPT_ANALYSIS src) { + SCRIPT_ANALYSIS dst; + dst.eScript = src.eScript; + dst.fRTL = src.fRTL; + dst.fLayoutRTL = src.fLayoutRTL; + dst.fLinkBefore = src.fLinkBefore; + dst.fLinkAfter = src.fLinkAfter; + dst.fLogicalOrder = src.fLogicalOrder; + dst.fNoGlyphIndex = src.fNoGlyphIndex; + dst.s.uBidiLevel = src.s.uBidiLevel; + dst.s.fOverrideDirection = src.s.fOverrideDirection; + dst.s.fInhibitSymSwap = src.s.fInhibitSymSwap; + dst.s.fCharShape = src.s.fCharShape; + dst.s.fDigitSubstitute = src.s.fDigitSubstitute; + dst.s.fInhibitLigate = src.s.fInhibitLigate; + dst.s.fDisplayZWG = src.s.fDisplayZWG; + dst.s.fArabicNumContext = src.s.fArabicNumContext; + dst.s.fGcpClusters = src.s.fGcpClusters; + dst.s.fReserved = src.s.fReserved; + dst.s.fEngineReserved = src.s.fEngineReserved; + return dst; +} + /** * Draws the receiver's text using the specified GC at the specified * point. @@ -811,7 +822,6 @@ int end = run.start + run.length - 1; bool fullSelection = hasSelection && selectionStart <= run.start && selectionEnd >= end; bool partialSelection = hasSelection && !fullSelection && !(selectionStart > end || run.start > selectionEnd); - checkItem(hdc, run); OS.SelectObject(hdc, getItemFont(run)); int drawRunY = drawY + (baseline - run.ascent); if (partialSelection) { @@ -2770,11 +2780,27 @@ this.wrapWidth = width; } -bool shape (HDC hdc, StyleItem run, char[] chars, int[] glyphCount, int maxGlyphs) { - wchar[] wchars = StrToWCHARs( chars ); +bool shape (HDC hdc, StyleItem run, wchar[] wchars, int[] glyphCount, int maxGlyphs, SCRIPT_PROPERTIES* sp) { + //wchar[] wchars = StrToWCHARs( chars ); + bool useCMAPcheck = !sp.fComplex && !run.analysis.fNoGlyphIndex; + if (useCMAPcheck) { + ushort[] glyphs = new ushort[wchars.length]; + scope(exit) delete glyphs; + if (OS.ScriptGetCMap(hdc, run.psc, wchars.ptr, wchars.length, 0, glyphs.ptr) !is OS.S_OK) { + if (run.psc !is null) { + OS.ScriptFreeCache(run.psc); + glyphCount[0] = 0; + *cast(int*)run.psc = 1; + } + return false; + } + } auto hr = OS.ScriptShape(hdc, run.psc, wchars.ptr, wchars.length, maxGlyphs, &run.analysis, run.glyphs, run.clusters, run.visAttrs, glyphCount.ptr); run.glyphCount = glyphCount[0]; + if (useCMAPcheck) return true; + if (hr !is OS.USP_E_SCRIPT_NOT_IN_FONT) { + if (run.analysis.fNoGlyphIndex) return true; SCRIPT_FONTPROPERTIES fp; fp.cBytes = SCRIPT_FONTPROPERTIES.sizeof; OS.ScriptGetFontProperties(hdc, run.psc, &fp); @@ -2811,7 +2837,7 @@ final char[] chars = new char[run.length]; segmentsText.getChars(run.start, run.start + run.length, chars, 0); wchar[] wchars = StrToWCHARs( chars ); - int maxGlyphs = (chars.length * 3 / 2) + 16; + int maxGlyphs = (wchars.length * 3 / 2) + 16; auto hHeap = OS.GetProcessHeap(); run.glyphs = cast(ushort*)OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, maxGlyphs * 2); if (run.glyphs is null) DWT.error(DWT.ERROR_NO_HANDLES); @@ -2821,111 +2847,78 @@ if (run.visAttrs is null) DWT.error(DWT.ERROR_NO_HANDLES); run.psc = cast(SCRIPT_CACHE*)OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, (void*).sizeof); if (run.psc is null) DWT.error(DWT.ERROR_NO_HANDLES); - bool shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs); - final short script = run.analysis.eScript; - - if (!shapeSucceed) { - /* - * Shape failed. - * Try to shape with fNoGlyphIndex when the run is in the - * Private Use Area. This allows for end-user-defined character (EUDC). - */ - auto properties = device.scripts[script]; - if (properties.fPrivateUseArea) { - run.analysis.fNoGlyphIndex = true; - shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs); - } - } - + short script = run.analysis.eScript; + auto sp = device.scripts[script]; + bool shapeSucceed = shape(hdc, run, wchars, buffer, maxGlyphs, sp); if (!shapeSucceed) { - /* - * Shape Failed. - * Try to use MLANG to find a suitable font to shape the run. - */ - if (mLangFontLink2 !is null) { - int dwCodePages; - int cchCodePages; - /* GetStrCodePages() */ - OS.VtblCall(4, mLangFontLink2, cast(int)wchars.ptr, wchars.length, 0, cast(int)&dwCodePages, cast(int)&cchCodePages); - HFONT hNewFont; - /* MapFont() */ - if (OS.VtblCall(10, mLangFontLink2, cast(int)hdc, dwCodePages, cast(int)wchars[0], cast(int)hNewFont) is OS.S_OK) { - auto hFont = OS.SelectObject(hdc, hNewFont); - shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs); - if (shapeSucceed) { - run.fallbackFont = hNewFont; + auto hFont = OS.GetCurrentObject(hdc, OS.OBJ_FONT); + auto ssa = cast(SCRIPT_STRING_ANALYSIS*) OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, SCRIPT_STRING_ANALYSIS.sizeof); + auto metaFileDc = OS.CreateEnhMetaFile(hdc, null, null, null); + auto oldMetaFont = OS.SelectObject(metaFileDc, hFont); + int flags = OS.SSA_METAFILE | OS.SSA_FALLBACK | OS.SSA_GLYPHS | OS.SSA_LINK; + if (OS.ScriptStringAnalyse(metaFileDc, wchars.ptr, wchars.length, 0, -1, flags, 0, null, null, null, null, null, ssa) is OS.S_OK) { + OS.ScriptStringOut(ssa, 0, 0, 0, null, 0, 0, false); + OS.ScriptStringFree(ssa); + } + OS.HeapFree(hHeap, 0, ssa); + OS.SelectObject(metaFileDc, oldMetaFont); + auto metaFile = OS.CloseEnhMetaFile(metaFileDc); + EMREXTCREATEFONTINDIRECTW emr; + static extern(Windows) int metaFileEnumProc (HDC hDC, HANDLETABLE* table, ENHMETARECORD* record, int nObj, LPARAM lpData) { + EMREXTCREATEFONTINDIRECTW* emr_; + OS.MoveMemory(&emr_.emr, record, EMR.sizeof); + switch (emr_.emr.iType) { + case OS.EMR_EXTCREATEFONTINDIRECTW: + OS.MoveMemory(emr_, record, EMREXTCREATEFONTINDIRECTW.sizeof); + break; + case OS.EMR_EXTTEXTOUTW: + return 0; + } + return 1; + } + OS.EnumEnhMetaFile(null, metaFile, &metaFileEnumProc, &emr, null); + OS.DeleteEnhMetaFile(metaFile); + + auto newFont = OS.CreateFontIndirectW(&emr.elfw.elfLogFont); + OS.SelectObject(hdc, newFont); + if ((shapeSucceed = shape(hdc, run, wchars, buffer, maxGlyphs, sp)) is true ) { + run.fallbackFont = newFont; + } + if (!shapeSucceed) { + if (!sp.fComplex) { + run.analysis.fNoGlyphIndex = true; + if ((shapeSucceed = shape(hdc, run, wchars, buffer, maxGlyphs, sp)) is true ) { + run.fallbackFont = newFont; } else { - /* ReleaseFont() */ - OS.VtblCall(8, mLangFontLink2, cast(int)hNewFont); - OS.SelectObject(hdc, hFont); + run.analysis.fNoGlyphIndex = false; } } } - } - - if (!shapeSucceed) { - /* - * Shape Failed. - * Try to shape the run using the LOGFONT in the cache. - */ - auto hFont = OS.GetCurrentObject(hdc, OS.OBJ_FONT); - LOGFONT logFont; - OS.GetObject(hFont, LOGFONT.sizeof, &logFont); - - LOGFONT* cachedLogFont = device.logFontsCache !is null ? device.logFontsCache[script] : null; - if (cachedLogFont !is null) { - cachedLogFont.lfHeight = logFont.lfHeight; - cachedLogFont.lfWeight = logFont.lfWeight; - cachedLogFont.lfItalic = logFont.lfItalic; - cachedLogFont.lfWidth = logFont.lfWidth; - auto newFont = OS.CreateFontIndirect(cachedLogFont); - OS.SelectObject(hdc, newFont); - shapeSucceed = shape(hdc, run, chars, buffer, maxGlyphs); - if (shapeSucceed) { - run.fallbackFont = newFont; - } else { - OS.SelectObject(hdc, hFont); - OS.DeleteObject(newFont); + if (!shapeSucceed) { + if (mLangFontLink2 !is null) { + HANDLE hNewFont; + int dwCodePages, cchCodePages; + /* GetStrCodePages() */ + OS.VtblCall(4, mLangFontLink2, cast(int)wchars.ptr, wchars.length, 0, cast(int)&dwCodePages, cast(int)&cchCodePages); + /* MapFont() */ + if (OS.VtblCall(10, mLangFontLink2, cast(int)hdc, dwCodePages, cast(int)wchars[0], cast(int)&hNewFont) is OS.S_OK) { + LOGFONT logFont; + OS.GetObject( hNewFont, LOGFONT.sizeof, &logFont ); + /* ReleaseFont() */ + OS.VtblCall(8, mLangFontLink2, cast(int)hNewFont); + auto mLangFont = OS.CreateFontIndirect(&logFont); + auto oldFont = OS.SelectObject(hdc, mLangFont); + if ((shapeSucceed = shape(hdc, run, wchars, buffer, maxGlyphs, sp)) is true ) { + run.fallbackFont = mLangFont; + } else { + OS.SelectObject(hdc, oldFont); + OS.DeleteObject(mLangFont); + } + } } } - if (!shapeSucceed) { - /* - * Shape Failed. - * Use EnumFontFamExProc to iterate over every font in the system that supports - * the charset of the run and try to shape it. - */ - if (device.logFontsCache is null) device.logFontsCache = new LOGFONT*[device.scripts.length]; - LOGFONT newLogFont; - - int EnumFontFamExProc( ENUMLOGFONTEX* lpelfe, NEWTEXTMETRICEX* lpntme, int FontType, int lParam) { - OS.MoveMemory(&newLogFont, cast(void*)lpelfe, LOGFONT.sizeof); - if (FontType is OS.RASTER_FONTTYPE) return 1; - newLogFont.lfHeight = logFont.lfHeight; - newLogFont.lfWeight = logFont.lfWeight; - newLogFont.lfItalic = logFont.lfItalic; - newLogFont.lfWidth = logFont.lfWidth; - auto newFont = OS.CreateFontIndirect(&newLogFont); - OS.SelectObject(hdc, newFont); - if (shape(hdc, run, chars, buffer, maxGlyphs)) { - run.fallbackFont = newFont; - LOGFONT* cacheLogFont = new LOGFONT(); - OS.MoveMemory(cacheLogFont, lpelfe, LOGFONT.sizeof); - device.logFontsCache[script] = cacheLogFont; - return 0; - } - OS.SelectObject(hdc, hFont); - OS.DeleteObject(newFont); - return 1; - } - CallbackDataEnumFontFamExProc cb; - cb.EnumFontFamExProc = &EnumFontFamExProc; - cb.lParam = 0; - auto properties = device.scripts[script]; - int charSet = properties.fAmbiguousCharSet ? OS.DEFAULT_CHARSET : properties.bCharSet; - newLogFont.lfCharSet = cast(byte)charSet; - OS.EnumFontFamiliesEx(hdc, &newLogFont, &EnumFontFamExProcFunc, cast(int) &cb, 0); - shapeSucceed = run.fallbackFont !is null; - } + if (!shapeSucceed) OS.SelectObject(hdc, hFont); + if (newFont !is run.fallbackFont) OS.DeleteObject(newFont); } if (!shapeSucceed) { diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/TextStyle.d --- a/dwt/graphics/TextStyle.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/TextStyle.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,6 +38,8 @@ * @see TextLayout * @see Font * @see Color + * @see TextLayout, TextStyle snippets + * @see Sample code and further information * * @since 3.0 */ @@ -173,7 +175,7 @@ /** * Create a new text style from an existing text style. * - *@param style the style to copy + * @param style the style to copy * * @since 3.4 */ diff -r d10ff1f47f84 -r 55591bc3974c dwt/graphics/Transform.d --- a/dwt/graphics/Transform.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/graphics/Transform.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,6 +36,9 @@ * which may not be available on some platforms. * * + * @see DWT Example: GraphicsExample + * @see Sample code and further information + * * @since 3.1 */ public class Transform : Resource { diff -r d10ff1f47f84 -r 55591bc3974c dwt/internal/Compatibility.d --- a/dwt/internal/Compatibility.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/internal/Compatibility.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff -r d10ff1f47f84 -r 55591bc3974c dwt/internal/Library.d --- a/dwt/internal/Library.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/internal/Library.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,7 +34,7 @@ /** * DWT Minor version number (must be in the range 0..999) */ - static const int MINOR_VERSION = 442; + static const int MINOR_VERSION = 448; /** * DWT revision number (must be >= 0) diff -r d10ff1f47f84 -r 55591bc3974c dwt/internal/gdip/native.d --- a/dwt/internal/gdip/native.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/internal/gdip/native.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,1714 +1,1714 @@ -/****************************************************************************** - - module: - - Based on D version created by John Chapman for the Juno Project - see: www.dsource.org/projects/juno - - Changes and Additions for DWT: - John Reimertrue
if the document has been modified,
+ * false
otherwise.
+ * @since 3.1
+ */
public bool isDirty() {
/*
* Note: this method must return true unless it is absolutely clear that the
@@ -987,7 +1005,7 @@
}
protected void releaseObjectInterfaces() {
- if (objIOleInPlaceObject!is null)
+ if (objIOleInPlaceObject !is null)
objIOleInPlaceObject.Release();
objIOleInPlaceObject = null;
@@ -1019,6 +1037,17 @@
COM.CoFreeUnusedLibraries();
}
+/**
+ * Saves the document to the specified file and includes OLE specific information if specified.
+ * This method must only be used for files that have an OLE Storage format. For example,
+ * a word file edited with Word.Document should be saved using this method because there is
+ * formating information that should be stored in the OLE specific Storage format.
+ *
+ * @param file the file to which the changes are to be saved
+ * @param includeOleInfo the flag to indicate whether OLE specific information should be saved.
+ *
+ * @return true if the save was successful
+ */
public bool save(File file, bool includeOleInfo) {
if (includeOleInfo)
return saveToStorageFile(file);
@@ -1210,6 +1239,11 @@
objIOleObject.Close(COM.OLECLOSE_SAVEIFDIRTY);
}
}
+/**
+ * The indent value is no longer being used by the client site.
+ *
+ * @param newIndent the rectangle representing the indent amount
+ */
public void setIndent(Rectangle newIndent) {
indent.left = newIndent.x;
indent.right = newIndent.width;
diff -r d10ff1f47f84 -r 55591bc3974c dwt/ole/win32/OleControlSite.d
--- a/dwt/ole/win32/OleControlSite.d Sun Jul 06 16:42:54 2008 +0200
+++ b/dwt/ole/win32/OleControlSite.d Sun Jul 06 17:26:06 2008 +0200
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -61,6 +61,8 @@
* null
if the dispId is not recognised.
*
+ * @param dispId the dispId
+ *
+ * @return the property value or null
+ *
* @since 2.1
- *
*/
public Variant getSiteProperty(int dispId){
for (int i = 0; i < sitePropertyIds.length; i++) {
@@ -651,7 +657,7 @@
*
* @param eventID the event identifier
*
- * @param listener the listener
+ * @param listener the listener which should no longer be notified
*
* @exception IllegalArgumentException OleListener
provide a simple
+ * handleEvent()
method that is used internally
+ * by DWT to dispatch events.
+ *
+ * After creating an instance of a class that implements this
+ * interface it can be added to an OleControlSite
+ * using the addEventListener()
method and removed
+ * using the removeEventListener()
method. When the
+ * specified event occurs, handleEvent()
will be
+ * sent to the instance.
+ *
+ * For a printer, this is the size of the physical page, in pixels. + *
* * @return the bounding rectangle * @@ -438,8 +442,10 @@ /** * Returns a rectangle which describes the area of the * receiver which is capable of displaying data. + ** For a printer, this is the size of the printable area - * of a page, in pixels. + * of the page, in pixels. + *
* * @return the client area * @@ -458,28 +464,32 @@ } /** - * Given a desired client area for the receiver - * (as described by the arguments), returns the bounding - * rectangle which would be required to produce that client - * area. + * Given a client area (as described by the arguments), + * returns a rectangle, relative to the client area's coordinates, + * that is the client area expanded by the printer's trim (or minimum margins). *- * In other words, it returns a rectangle such that, if the - * receiver's bounds were set to that rectangle, the area - * of the receiver which is capable of displaying data - * (that is, not covered by the "trimmings") would be the - * rectangle described by the arguments (relative to the - * receiver's parent). - *
- * Note that there is no setBounds for a printer. This method - * is usually used by passing in the client area (the 'printable - * area') of the printer. It can also be useful to pass in 0, 0, 0, 0. + * Most printers have a minimum margin on each edge of the paper where the + * printer device is unable to print. This margin is known as the "trim." + * This method can be used to calculate the printer's minimum margins + * by passing in a client area of 0, 0, 0, 0 and then using the resulting + * x and y coordinates (which will be <= 0) to determine the minimum margins + * for the top and left edges of the paper, and the resulting width and height + * (offset by the resulting x and y) to determine the minimum margins for the + * bottom and right edges of the paper, as follows: + *
null
+ *
* @exception DWTException true
if the operation was successful and false
otherwise
*
* @exception IllegalArgumentException * IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see CoolBar snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class CoolBar : Composite { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/CoolItem.d --- a/dwt/widgets/CoolItem.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/CoolItem.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,6 +41,8 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Sample code and further information */ public class CoolItem : Item { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/DateTime.d --- a/dwt/widgets/DateTime.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/DateTime.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -50,6 +50,10 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see DateTime snippets + * @see DWT Example: ControlExample + * @see Sample code and further information * * @since 3.3 */ @@ -63,9 +67,9 @@ SYSTEMTIME* lastSystemTime; SYSTEMTIME time; // only used in calendar mode static /+const+/ WNDPROC DateTimeProc; - static const TCHAR* DateTimeClass = OS.DATETIMEPICK_CLASS.ptr; + static const TCHAR[] DateTimeClass = OS.DATETIMEPICK_CLASS; static /+const+/ WNDPROC CalendarProc; - static const TCHAR* CalendarClass = OS.MONTHCAL_CLASS.ptr; + static const TCHAR[] CalendarClass = OS.MONTHCAL_CLASS; private static bool static_this_completed = false; private static void static_this() { @@ -81,10 +85,66 @@ icex.dwICC = OS.ICC_DATE_CLASSES; OS.InitCommonControlsEx (&icex); WNDCLASS lpWndClass; - OS.GetClassInfo (null, DateTimeClass, &lpWndClass); + OS.GetClassInfo (null, DateTimeClass.ptr, &lpWndClass); DateTimeProc = lpWndClass.lpfnWndProc; - OS.GetClassInfo (null, CalendarClass, &lpWndClass); + /* + * Feature in Windows. The date time window class + * does not include CS_DBLCLKS. This means that these + * controls will not get double click messages such as + * WM_LBUTTONDBLCLK. The fix is to register a new + * window class with CS_DBLCLKS. + * + * NOTE: Screen readers look for the exact class name + * of the control in order to provide the correct kind + * of assistance. Therefore, it is critical that the + * new window class have the same name. It is possible + * to register a local window class with the same name + * as a global class. Since bits that affect the class + * are being changed, it is possible that other native + * code, other than DWT, could create a control with + * this class name, and fail unexpectedly. + */ + auto hInstance = OS.GetModuleHandle (null); + auto hHeap = OS.GetProcessHeap (); + lpWndClass.hInstance = hInstance; + lpWndClass.style &= ~OS.CS_GLOBALCLASS; + lpWndClass.style |= OS.CS_DBLCLKS; + int byteCount = DateTimeClass.length * TCHAR.sizeof; + auto lpszClassName = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); + OS.MoveMemory (lpszClassName, DateTimeClass.ptr, byteCount); + lpWndClass.lpszClassName = lpszClassName; + OS.RegisterClass (&lpWndClass); + OS.HeapFree (hHeap, 0, lpszClassName); + OS.GetClassInfo (null, CalendarClass.ptr, &lpWndClass); CalendarProc = lpWndClass.lpfnWndProc; + /* + * Feature in Windows. The date time window class + * does not include CS_DBLCLKS. This means that these + * controls will not get double click messages such as + * WM_LBUTTONDBLCLK. The fix is to register a new + * window class with CS_DBLCLKS. + * + * NOTE: Screen readers look for the exact class name + * of the control in order to provide the correct kind + * of assistance. Therefore, it is critical that the + * new window class have the same name. It is possible + * to register a local window class with the same name + * as a global class. Since bits that affect the class + * are being changed, it is possible that other native + * code, other than DWT, could create a control with + * this class name, and fail unexpectedly. + */ + hInstance = OS.GetModuleHandle (null); + hHeap = OS.GetProcessHeap (); + lpWndClass.hInstance = hInstance; + lpWndClass.style &= ~OS.CS_GLOBALCLASS; + lpWndClass.style |= OS.CS_DBLCLKS; + byteCount = CalendarClass.length * TCHAR.sizeof; + lpszClassName = cast(TCHAR*)OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); + OS.MoveMemory (lpszClassName, CalendarClass.ptr, byteCount); + lpWndClass.lpszClassName = lpszClassName; + OS.RegisterClass (&lpWndClass); + OS.HeapFree (hHeap, 0, lpszClassName); static_this_completed = true; } } @@ -879,7 +939,7 @@ } override String windowClass () { - return (style & DWT.CALENDAR) !is 0 ? TCHARzToStr(CalendarClass) : TCHARzToStr(DateTimeClass); + return (style & DWT.CALENDAR) !is 0 ? TCHARsToStr(CalendarClass) : TCHARsToStr(DateTimeClass); } override int windowProc () { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Decorations.d --- a/dwt/widgets/Decorations.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Decorations.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -109,6 +109,7 @@ * @see #getMaximized * @see Shell * @see DWT + * @see Sample code and further information */ public class Decorations : Canvas { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Dialog.d --- a/dwt/widgets/Dialog.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Dialog.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -78,6 +78,8 @@ * * * @see Shell + * @see DWT Example: ControlExample + * @see Sample code and further information */ public abstract class Dialog { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/DirectoryDialog.d --- a/dwt/widgets/DirectoryDialog.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/DirectoryDialog.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -37,6 +37,10 @@ * IMPORTANT: This class is intended to be subclassed only * within the DWT implementation. * + * + * @see DirectoryDialog snippets + * @see DWT Example: ControlExample, Dialog tab + * @see Sample code and further information */ public class DirectoryDialog : Dialog { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Display.d --- a/dwt/widgets/Display.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Display.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -131,6 +131,8 @@ * @see #readAndDispatch * @see #sleep * @see Device#dispose + * @see Display snippets + * @see Sample code and further information */ public class Display : Device { @@ -744,7 +746,27 @@ override protected void checkDevice () { if (thread is null) error (DWT.ERROR_WIDGET_DISPOSED); - if (thread !is Thread.getThis ()) error (DWT.ERROR_THREAD_INVALID_ACCESS); + if (thread !is Thread.getThis ()) { + /* + * Bug in IBM JVM 1.6. For some reason, under + * conditions that are yet to be full understood, + * Thread.currentThread() is either returning null + * or a different instance from the one that was + * saved when the Display was created. This is + * possibly a JIT problem because modifying this + * method to print logging information when the + * error happens seems to fix the problem. The + * fix is to use operating system calls to verify + * that the current thread is not the Display thread. + * + * NOTE: Despite the fact that Thread.currentThread() + * is used in other places, the failure has not been + * observed in all places where it is called. + */ + if (threadId !is OS.GetCurrentThreadId ()) { + error (DWT.ERROR_THREAD_INVALID_ACCESS); + } + } if (isDisposed ()) error (DWT.ERROR_DEVICE_DISPOSED); } @@ -2054,11 +2076,21 @@ MSG* keyMsg = cast(MSG*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, MSG.sizeof); *keyMsg = *msg; OS.PostMessage (hwndMessage, SWT_KEYMSG, wParam, cast(int)keyMsg); - msg.message = OS.WM_NULL; - //OS.MoveMemory (lParam, msg, MSG.sizeof); + switch (msg.wParam) { + case OS.VK_SHIFT: + case OS.VK_MENU: + case OS.VK_CONTROL: + case OS.VK_CAPITAL: + case OS.VK_NUMLOCK: + case OS.VK_SCROLL: + break; + default: + msg.message = OS.WM_NULL; + //OS.MoveMemory (lParam, msg, MSG.sizeof); + } } + default: } - default: } } return OS.CallNextHookEx (msgHook, code, wParam, lParam); @@ -3020,6 +3052,16 @@ default: } } + switch (keyMsg.wParam) { + case OS.VK_SHIFT: + case OS.VK_MENU: + case OS.VK_CONTROL: + case OS.VK_CAPITAL: + case OS.VK_NUMLOCK: + case OS.VK_SCROLL: + consumed = true; + default: + } if (consumed) { auto hHeap = OS.GetProcessHeap (); OS.HeapFree (hHeap, 0, cast(void*)lParam); @@ -3792,7 +3834,7 @@ * is one of the event constants defined in classDWT
.
*
* @param eventType the type of event to listen for
- * @param listener the listener which should no longer be notified when the event occurs
+ * @param listener the listener which should no longer be notified
*
* @exception IllegalArgumentException * The strings are platform specific. For example, on - * Windows, an extension filter string is typically of - * the form "*.extension", where "*.*" matches all files. + * some platforms, an extension filter string is typically + * of the form "*.extension", where "*.*" matches all files. + * For filters with multiple extensions, use semicolon as + * a separator, e.g. "*.jpg;*.png". *
* * @param extensions the file extension filter diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/FontDialog.d --- a/dwt/widgets/FontDialog.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/FontDialog.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,6 +39,9 @@ * IMPORTANT: This class is intended to be subclassed only * within the DWT implementation. * + * + * @see DWT Example: ControlExample, Dialog tab + * @see Sample code and further information */ public class FontDialog : Dialog { FontData fontData; diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Group.d --- a/dwt/widgets/Group.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Group.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,10 +16,12 @@ import dwt.DWT; import dwt.DWTException; import dwt.graphics.Font; +import dwt.graphics.GC; import dwt.graphics.Point; import dwt.graphics.Rectangle; import dwt.internal.win32.OS; import dwt.widgets.Composite; +import dwt.widgets.Control; import dwt.dwthelper.utils; @@ -42,6 +44,9 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class Group : Composite { @@ -316,6 +321,38 @@ return CharacterToUpper (key) is CharacterToUpper (mnemonic); } +void printWidget (HWND hwnd, GC gc) { + /* + * Bug in Windows. For some reason, PrintWindow() fails + * when it is called on a push button. The fix is to + * detect the failure and use WM_PRINT instead. Note + * that WM_PRINT cannot be used all the time because it + * fails for browser controls when the browser has focus. + */ + auto hDC = gc.handle; + if (!OS.PrintWindow (hwnd, hDC, 0)) { + /* + * Bug in Windows. For some reason, WM_PRINT when called + * with PRF_CHILDREN will not draw the tool bar divider + * for tool bar children that do not have CCS_NODIVIDER. + * The fix is to draw the group box and iterate through + * the children, drawing each one. + */ + int flags = OS.PRF_CLIENT | OS.PRF_NONCLIENT | OS.PRF_ERASEBKGND; + OS.SendMessage (hwnd, OS.WM_PRINT, hDC, flags); + int nSavedDC = OS.SaveDC (hDC); + Control [] children = _getChildren (); + Rectangle rect = getBounds (); + OS.IntersectClipRect (hDC, 0, 0, rect.width, rect.height); + for (int i=children.length - 1; i>=0; --i) { + Point location = children [i].getLocation (); + OS.SetWindowOrgEx (hDC, -location.x, -location.y, null); + children [i].print (gc); + } + OS.RestoreDC (hDC, nSavedDC); + } +} + override void releaseWidget () { super.releaseWidget (); text = null; diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/IME.d --- a/dwt/widgets/IME.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/IME.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,6 +12,7 @@ import dwt.DWT; +import dwt.DWTException; import dwt.graphics.Color; import dwt.graphics.TextStyle; import dwt.internal.win32.OS; @@ -25,21 +26,25 @@ import dwt.dwthelper.utils; /** - * TODO - JAVA DOC + * Instances of this class represent input method editors. + * These are typically in-line pre-edit text areas that allow + * the user to compose characters from Far Eastern languages + * such as Japanese, Chinese or Korean. * *- * . + * IMPORTANT: This class is not intended to be subclassed. *
* + * @see Sample code and further information + * * @since 3.4 */ - public class IME : Widget { Canvas parent; int caretOffset; @@ -76,8 +81,31 @@ } /** + * Constructs a new instance of this class given its parent + * and a style value describing its behavior and appearance. + *
+ * The style value is either one of the style constants defined in
+ * class DWT
which is applicable to instances of this
+ * class, or must be built by bitwise OR'ing together
+ * (that is, using the int
"|" operator) two or more
+ * of those DWT
style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ *
+ * The ranges array contains start and end pairs. Each pair refers to
+ * the corresponding style in the styles array. For example, the pair
+ * that starts at ranges[n] and ends at ranges[n+1] uses the style
+ * at styles[n/2] returned by getStyles()
.
+ *
+ * The ranges array contains start and end pairs. Each pair refers to + * the corresponding style in the styles array. For example, the pair + * that starts at ranges[n] and ends at ranges[n+1] uses the style + * at styles[n/2]. + *
+ * + * @return the ranges for the styles + * + * @exception DWTException+ * The text for an IME is the characters in the widget that + * are in the current composition. When the commit count is + * equal to the length of the composition text, then the + * in-line edit operation is complete. + *
+ * + * @return the widget text + * + * @exception DWTExceptiontrue
if the caret should be wide, and
+ * false
otherwise. In some languages, for example
+ * Korean, the caret is typically widened to the width of the
+ * current character in the in-line edit session.
+ *
+ * @return the wide caret state
+ *
+ * @exception DWTException * IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see List snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class List : Scrollable { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Menu.d --- a/dwt/widgets/Menu.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Menu.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,6 +48,10 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Menu snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class Menu : Widget { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/MenuItem.d --- a/dwt/widgets/MenuItem.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/MenuItem.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -49,6 +49,8 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Sample code and further information */ public class MenuItem : Item { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/MessageBox.d --- a/dwt/widgets/MessageBox.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/MessageBox.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,6 +40,9 @@ * IMPORTANT: This class is intended to be subclassed only * within the DWT implementation. * + * + * @see DWT Example: ControlExample, Dialog tab + * @see Sample code and further information */ public class MessageBox : Dialog { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Monitor.d --- a/dwt/widgets/Monitor.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Monitor.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,6 +19,8 @@ * Instances of this class are descriptions of monitors. * * @see Display + * @see Monitor snippets + * @see Sample code and further information * * @since 3.0 */ diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/ProgressBar.d --- a/dwt/widgets/ProgressBar.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/ProgressBar.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,6 +39,10 @@ * IMPORTANT: This class is intended to be subclassed only * within the DWT implementation. * + * + * @see ProgressBar snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class ProgressBar : Control { @@ -211,8 +215,12 @@ } /** - * Returns the state of the receiver. The value will be one of - *NORMAL
, ERROR
or PAUSED
.
+ * Returns the state of the receiver. The value will be one of:
+ * NORMAL
, ERROR
or PAUSED
.
+ * Sets the state of the receiver. The state must be one of these values:
+ * * This operation requires the operating system's advanced * widgets subsystem which may not be available on some diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Slider.d --- a/dwt/widgets/Slider.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Slider.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -73,6 +73,9 @@ *
* * @see ScrollBar + * @see Slider snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class Slider : Control { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Spinner.d --- a/dwt/widgets/Spinner.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Spinner.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -52,6 +52,10 @@ * IMPORTANT: This class is not intended to be subclassed. * * + * @see Spinner snippets + * @see DWT Example: ControlExample + * @see Sample code and further information + * * @since 3.1 */ public class Spinner : Composite { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Synchronizer.d --- a/dwt/widgets/Synchronizer.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Synchronizer.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,6 +39,7 @@ * * * @see Display#setSynchronizer + * @see Sample code and further information */ public class Synchronizer { Display display; diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/TabFolder.d --- a/dwt/widgets/TabFolder.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/TabFolder.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -56,6 +56,10 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see TabFolder, TabItem snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class TabFolder : Composite { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/TabItem.d --- a/dwt/widgets/TabItem.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/TabItem.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -37,6 +37,9 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see TabFolder, TabItem snippets + * @see Sample code and further information */ public class TabItem : Item { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Table.d --- a/dwt/widgets/Table.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Table.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -82,6 +82,10 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Table, TableItem, TableColumn snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class Table : Composite { @@ -112,8 +116,9 @@ static const int HEADER_EXTRA = 3; static const int VISTA_EXTRA = 2; static const int EXPLORER_EXTRA = 2; - static final int H_SCROLL_LIMIT = 32; - static final int V_SCROLL_LIMIT = 16; + static const int H_SCROLL_LIMIT = 32; + static const int V_SCROLL_LIMIT = 16; + static const int DRAG_IMAGE_SIZE = 301; static const bool EXPLORER_THEME = true; private static /+const+/ WNDPROC TableProc; static const TCHAR[] TableClass = OS.WC_LISTVIEW; @@ -1123,7 +1128,6 @@ * * @exception IllegalArgumentException* IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Table, TableItem, TableColumn snippets + * @see Sample code and further information */ public class TableColumn : Item { Table parent; @@ -780,8 +783,9 @@ override public void setText (String string) { checkWidget (); - if (string is null) error (DWT.ERROR_NULL_ARGUMENT); - if (string==/*eq*/text) return; + // DWT extension: allow null string + //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); + if (string.equals (text)) return; int index = parent.indexOf (this); if (index is -1) return; super.setText (string); diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/TableItem.d --- a/dwt/widgets/TableItem.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/TableItem.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,6 +39,9 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Table, TableItem, TableColumn snippets + * @see Sample code and further information */ public class TableItem : Item { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/Text.d --- a/dwt/widgets/Text.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/Text.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -56,6 +56,10 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Text snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class Text : Scrollable { @@ -336,9 +340,6 @@ * * @param string the string to be appended * - * @exception IllegalArgumentExceptionnull
* IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see ToolBar, ToolItem snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class ToolBar : Composite { diff -r d10ff1f47f84 -r 55591bc3974c dwt/widgets/ToolItem.d --- a/dwt/widgets/ToolItem.d Sun Jul 06 16:42:54 2008 +0200 +++ b/dwt/widgets/ToolItem.d Sun Jul 06 17:26:06 2008 +0200 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -45,6 +45,9 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see ToolBar, ToolItem snippets + * @see Sample code and further information */ public class ToolItem : Item { ToolBar parent; @@ -760,9 +763,6 @@ * * @param string the new text * - * @exception IllegalArgumentException* IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Tracker snippets + * @see Sample code and further information */ public class Tracker : Widget { Control parent; @@ -802,7 +805,7 @@ * @param rectangles the bounds of the rectangles to be drawn * * @exception IllegalArgumentException* IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Tree, TreeItem, TreeColumn snippets + * @see DWT Example: ControlExample + * @see Sample code and further information */ public class Tree : Composite { @@ -129,6 +133,7 @@ static const int HEADER_EXTRA = 3; static const int INCREMENT = 5; static const int EXPLORER_EXTRA = 2; + static const int DRAG_IMAGE_SIZE = 301; static const bool EXPLORER_THEME = true; private static /+const+/ WNDPROC TreeProc; static const TCHAR[] TreeClass = OS.WC_TREEVIEW; @@ -234,11 +239,14 @@ OS.SendMessage (handle, OS.TVM_SETSCROLLTIME, 0, 0); int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); if (eventType is DWT.MeasureItem) { - if (explorerTheme) { - int bits1 = OS.SendMessage (handle, OS.TVM_GETEXTENDEDSTYLE, 0, 0); - bits1 &= ~OS.TVS_EX_AUTOHSCROLL; - OS.SendMessage (handle, OS.TVM_SETEXTENDEDSTYLE, 0, bits1); - } + /* + * This code is intentionally commented. + */ +// if (explorerTheme) { +// int bits1 = (int)/*64*/OS.SendMessage (handle, OS.TVM_GETEXTENDEDSTYLE, 0, 0); +// bits1 &= ~OS.TVS_EX_AUTOHSCROLL; +// OS.SendMessage (handle, OS.TVM_SETEXTENDEDSTYLE, 0, bits1); +// } bits |= OS.TVS_NOHSCROLL; } /* @@ -1873,7 +1881,10 @@ explorerTheme = true; OS.SetWindowTheme (handle, cast(TCHAR*) Display.EXPLORER, null); int bits = OS.TVS_EX_DOUBLEBUFFER | OS.TVS_EX_FADEINOUTEXPANDOS | OS.TVS_EX_RICHTOOLTIP; - if ((style & DWT.FULL_SELECTION) is 0) bits |= OS.TVS_EX_AUTOHSCROLL; + /* + * This code is intentionally commented. + */ +// if ((style & DWT.FULL_SELECTION) is 0) bits |= OS.TVS_EX_AUTOHSCROLL; OS.SendMessage (handle, OS.TVM_SETEXTENDEDSTYLE, 0, bits); /* * Bug in Windows. When the tree is using the explorer @@ -3839,7 +3850,7 @@ } RECT rect; int index = 0, count = OS.SendMessage (handle, OS.TVM_GETVISIBLECOUNT, 0, 0); - while (index < count && hItem !is null) { + while (index <= count && hItem !is null) { int state = 0; static if (OS.IsWinCE) { tvItem.hItem = hItem; @@ -4520,7 +4531,6 @@ ** IMPORTANT: This class is not intended to be subclassed. *
+ * + * @see Tree, TreeItem, TreeColumn snippets + * @see Sample code and further information */ public class TreeItem : Item { @@ -1630,7 +1633,6 @@ * @param images the array of new images * * @exception IllegalArgumentException