Mercurial > projects > dwt-win
changeset 315:349b8c12e243
Sync dwt/custom with dwt-linux
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 07 Oct 2008 16:18:26 +0200 |
parents | 0e2b4fed7a0f |
children | 7cffa1a2985c |
files | dwt/custom/BidiSegmentEvent.d dwt/custom/Bullet.d dwt/custom/BusyIndicator.d dwt/custom/CCombo.d dwt/custom/CLabel.d dwt/custom/CTabFolder.d dwt/custom/CTabFolderEvent.d dwt/custom/CTabFolderLayout.d dwt/custom/CTabItem.d dwt/custom/ControlEditor.d dwt/custom/ExtendedModifyEvent.d dwt/custom/LineBackgroundEvent.d dwt/custom/LineStyleEvent.d dwt/custom/MovementEvent.d dwt/custom/PopupList.d dwt/custom/SashFormData.d dwt/custom/ScrolledComposite.d dwt/custom/StackLayout.d dwt/custom/TableCursor.d dwt/custom/TableEditor.d dwt/custom/TableTree.d dwt/custom/TableTreeEditor.d dwt/custom/TableTreeItem.d dwt/custom/TextChangingEvent.d dwt/custom/TreeEditor.d dwt/custom/ViewForm.d dwt/custom/ViewFormLayout.d |
diffstat | 27 files changed, 76 insertions(+), 58 deletions(-) [+] |
line wrap: on
line diff
--- a/dwt/custom/BidiSegmentEvent.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/BidiSegmentEvent.d Tue Oct 07 16:18:26 2008 +0200 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * 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 @@ -12,10 +12,11 @@ *******************************************************************************/ module dwt.custom.BidiSegmentEvent; +import dwt.dwthelper.utils; + import dwt.events.TypedEvent; import dwt.custom.StyledTextEvent; -import dwt.dwthelper.utils; /** * This event is sent to BidiSegmentListeners when a line is to
--- a/dwt/custom/Bullet.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/Bullet.d Tue Oct 07 16:18:26 2008 +0200 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * 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 @@ -12,11 +12,12 @@ *******************************************************************************/ module dwt.custom.Bullet; +import dwt.dwthelper.utils; + import dwt.DWT; import dwt.custom.StyleRange; import dwt.custom.ST; import dwt.dwthelper.System; -import dwt.dwthelper.utils; /** * Instances of this class represent bullets in the <code>StyledText</code>.
--- a/dwt/custom/BusyIndicator.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/BusyIndicator.d Tue Oct 07 16:18:26 2008 +0200 @@ -18,8 +18,8 @@ import dwt.graphics.Cursor; import dwt.widgets.Display; import dwt.widgets.Shell; +import dwt.dwthelper.Runnable; import dwt.dwthelper.utils; -import dwt.dwthelper.Runnable; /** * Support for showing a Busy Cursor during a long running process.
--- a/dwt/custom/CCombo.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/CCombo.d Tue Oct 07 16:18:26 2008 +0200 @@ -205,7 +205,7 @@ */ public void add (String string) { checkWidget(); - // DWT extension: allow null string + // DWT extension: allow null for zero length string //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); list.add (string); } @@ -233,7 +233,7 @@ */ public void add (String string, int index) { checkWidget(); - // DWT extension: allow null string + // DWT extension: allow null for zero length string //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); list.add (string, index); } @@ -878,7 +878,7 @@ */ public int indexOf (String string) { checkWidget (); - // DWT extension: allow null string + // DWT extension: allow null for zero length string //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); return list.indexOf (string); } @@ -900,7 +900,7 @@ */ public int indexOf (String string, int start) { checkWidget (); - // DWT extension: allow null string + // DWT extension: allow null for zero length string //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); return list.indexOf (string, start); } @@ -1244,7 +1244,7 @@ */ public void remove (String string) { checkWidget(); - // DWT extension: allow null string + // DWT extension: allow null for zero length string //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); list.remove (string); } @@ -1435,7 +1435,6 @@ * @param items the array of items * * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the items array is null</li> * <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li> * </ul> * @exception DWTException <ul> @@ -1534,7 +1533,7 @@ */ public void setText (String string) { checkWidget(); - // DWT extension: allow null string + // DWT extension: allow null for zero length string //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); int index = list.indexOf (string); if (index is -1) {
--- a/dwt/custom/CLabel.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/CLabel.d Tue Oct 07 16:18:26 2008 +0200 @@ -38,10 +38,10 @@ import dwt.widgets.Composite; import dwt.widgets.Control; import dwt.widgets.Display; +import dwt.dwthelper.utils; static import tango.text.Unicode; static import tango.text.convert.Utf; -import dwt.dwthelper.utils; /** * A Label which supports aligned text and/or an image and different border styles.
--- a/dwt/custom/CTabFolder.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/CTabFolder.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,7 +12,6 @@ *******************************************************************************/ module dwt.custom.CTabFolder; - import dwt.DWT; import dwt.DWTException; import dwt.accessibility.ACC; @@ -542,7 +541,7 @@ void antialias (int[] shape, RGB lineRGB, RGB innerRGB, RGB outerRGB, GC gc){ // Don't perform anti-aliasing on Mac and WPF because the platform // already does it. The simple style also does not require anti-aliasing. - if (simple || "carbon"==DWT.getPlatform() || "wpf"==DWT.getPlatform()) return; //$NON-NLS-1$ + if (simple || "carbon".equals(DWT.getPlatform()) || "wpf".equals(DWT.getPlatform())) return; //$NON-NLS-1$ // Don't perform anti-aliasing on low resolution displays if (getDisplay().getDepth() < 15) return; if (outerRGB !is null) { @@ -555,8 +554,10 @@ left = onBottom ? oldY <= shape[index+3] : oldY >= shape[index+3]; oldY = shape[index+1]; } - outer[index] = shape[index++] + (left ? -1 : +1); - outer[index] = shape[index++]; + outer[index] = shape[index] + (left ? -1 : +1); + index++; + outer[index] = shape[index]; + index++; } RGB from = lineRGB; RGB to = outerRGB; @@ -578,8 +579,10 @@ left = onBottom ? oldY <= shape[index+3] : oldY >= shape[index+3]; oldY = shape[index+1]; } - inner[index] = shape[index++] + (left ? +1 : -1); - inner[index] = shape[index++]; + inner[index] = shape[index] + (left ? +1 : -1); + index++; + inner[index] = shape[index]; + index++; } RGB from = lineRGB; RGB to = innerRGB; @@ -1307,7 +1310,7 @@ do { while (index < length_ && string[index] !is '&') index++; if (++index >= length_) return '\0'; - if (string[index] !is '&') return CharacterToLower(firstCodePoint( string[index..$])); + if (string[index] !is '&') return CharacterFirstToLower(string[index..$]); index++; } while (index < length_); return '\0'; @@ -1319,7 +1322,7 @@ while ((index < length_) && (string[index] !is '&')) index++; if (++index >= length_) return string; if (string[index] !is '&') { - return string[0 .. index-1] ~ string[index .. length_]; + return string.substring(0, index-1) ~ string.substring(index, length_); } index++; } while (index < length_); @@ -1644,7 +1647,7 @@ return -1; } void initAccessible() { - final Accessible accessible = getAccessible(); + Accessible accessible = getAccessible(); accessible.addAccessibleListener(new class() AccessibleAdapter { public void getName(AccessibleEvent e) { String name = null; @@ -1828,7 +1831,9 @@ addListener(DWT.Selection, new class(accessible) Listener { Accessible acc; - this( Accessible acc ){ this.acc = acc; } + this( Accessible a ){ + this.acc = a; + } public void handleEvent(Event event) { if (isFocusControl()) { if (selectedIndex is -1) { @@ -1842,7 +1847,7 @@ addListener(DWT.FocusIn, new class(accessible) Listener { Accessible acc; - this( Accessible acc ){ this.acc = acc; } + this( Accessible a ){ this.acc = a; } public void handleEvent(Event event) { if (selectedIndex is -1) { acc.setFocus(ACC.CHILDID_SELF); @@ -1852,6 +1857,7 @@ } }); } + void onKeyDown (Event event) { switch (event.keyCode) { case DWT.ARROW_LEFT:
--- a/dwt/custom/CTabFolderEvent.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/CTabFolderEvent.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,13 +12,14 @@ *******************************************************************************/ module dwt.custom.CTabFolderEvent; +import dwt.dwthelper.utils; + import dwt.events.TypedEvent; import dwt.widgets.Widget; import tango.util.Convert; -import dwt.dwthelper.utils; /** * This event is sent when an event is generated in the CTabFolder.
--- a/dwt/custom/CTabFolderLayout.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/CTabFolderLayout.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,7 @@ *******************************************************************************/ module dwt.custom.CTabFolderLayout; +import dwt.dwthelper.utils; import dwt.DWT; import dwt.graphics.GC; @@ -21,7 +22,6 @@ import dwt.widgets.Layout; import dwt.custom.CTabFolder; import dwt.custom.CTabItem; -import dwt.dwthelper.utils; /** * This class provides the layout for CTabFolder
--- a/dwt/custom/CTabItem.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/CTabItem.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.custom.CTabItem; +import dwt.dwthelper.utils; + import dwt.DWT; @@ -29,7 +31,6 @@ import dwt.widgets.Item; import dwt.widgets.Widget; import dwt.custom.CTabFolder; -import dwt.dwthelper.utils; /** * Instances of this class represent a selectable user interface object @@ -774,14 +775,14 @@ * Returns <code>true</code> to indicate that the receiver's close button should be shown. * Otherwise return <code>false</code>. The initial value is defined by the style (DWT.CLOSE) * that was used to create the receiver. - * + * * @return <code>true</code> if the close button should be shown * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> - * + * * @since 3.4 */ public bool getShowClose() { @@ -1023,14 +1024,14 @@ * Sets to <code>true</code> to indicate that the receiver's close button should be shown. * If the parent (CTabFolder) was created with DWT.CLOSE style, changing this value has * no effect. - * + * * @param close the new state of the close button * * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> - * + * * @since 3.4 */ public void setShowClose(bool close) { @@ -1042,9 +1043,9 @@ } public override void setText (String string) { checkWidget(); - // DWT extension: allow null string + // DWT extension: allow null for zero length string //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); - if (string==getText()) return; + if (string.equals (getText())) return; super.setText(string); shortenedText = null; shortenedTextWidth = 0;
--- a/dwt/custom/ControlEditor.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/ControlEditor.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,7 +12,7 @@ *******************************************************************************/ module dwt.custom.ControlEditor; - +import dwt.dwthelper.utils; import dwt.DWT; import dwt.graphics.Rectangle; @@ -21,7 +21,6 @@ import dwt.widgets.Event; import dwt.widgets.Listener; import dwt.widgets.ScrollBar; -import dwt.dwthelper.utils; /** *
--- a/dwt/custom/ExtendedModifyEvent.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/ExtendedModifyEvent.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,9 +12,10 @@ *******************************************************************************/ module dwt.custom.ExtendedModifyEvent; +import dwt.dwthelper.utils; + import dwt.events.TypedEvent; import dwt.custom.StyledTextEvent; -import dwt.dwthelper.utils; /** * This event is sent after a text change occurs.
--- a/dwt/custom/LineBackgroundEvent.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/LineBackgroundEvent.d Tue Oct 07 16:18:26 2008 +0200 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * 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 @@ -12,11 +12,12 @@ *******************************************************************************/ module dwt.custom.LineBackgroundEvent; +import dwt.dwthelper.utils; + import dwt.events.TypedEvent; import dwt.graphics.Color; import dwt.custom.StyledTextEvent; -import dwt.dwthelper.utils; /** * This event is sent when a line is about to be drawn.
--- a/dwt/custom/LineStyleEvent.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/LineStyleEvent.d Tue Oct 07 16:18:26 2008 +0200 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * 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 @@ -12,11 +12,12 @@ *******************************************************************************/ module dwt.custom.LineStyleEvent; +import dwt.dwthelper.utils; + import dwt.events.TypedEvent; import dwt.custom.StyleRange; import dwt.custom.Bullet; import dwt.custom.StyledTextEvent; -import dwt.dwthelper.utils; /** * This event is sent when a line is about to be drawn.
--- a/dwt/custom/MovementEvent.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/MovementEvent.d Tue Oct 07 16:18:26 2008 +0200 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * 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 @@ -12,9 +12,10 @@ *******************************************************************************/ module dwt.custom.MovementEvent; +import dwt.dwthelper.utils; + import dwt.events.TypedEvent; import dwt.custom.StyledTextEvent; -import dwt.dwthelper.utils; /** * This event is sent when a new offset is required based on the current
--- a/dwt/custom/PopupList.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/PopupList.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.custom.PopupList; +import dwt.dwthelper.utils; + import dwt.DWT; import dwt.DWTException; @@ -29,7 +31,6 @@ import dwt.widgets.List; import dwt.widgets.Listener; import dwt.widgets.Shell; -import dwt.dwthelper.utils; /** * A PopupList is a list of selectable items that appears in its own shell positioned above
--- a/dwt/custom/SashFormData.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/SashFormData.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,9 +12,10 @@ *******************************************************************************/ module dwt.custom.SashFormData; +import dwt.dwthelper.utils; + static import tango.text.Util; import tango.util.Convert; -import dwt.dwthelper.utils; class SashFormData {
--- a/dwt/custom/ScrolledComposite.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/ScrolledComposite.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.custom.ScrolledComposite; +import dwt.dwthelper.utils; + import dwt.DWT; import dwt.DWTException; @@ -28,7 +30,6 @@ import dwt.widgets.ScrollBar; import dwt.widgets.Shell; import dwt.custom.ScrolledCompositeLayout; -import dwt.dwthelper.utils; /** * A ScrolledComposite provides scrollbars and will scroll its content when the user @@ -188,7 +189,7 @@ filter = new class() Listener { public void handleEvent(Event event) { - if ( auto control = cast(Control)event.widget ) { + if (auto control = cast(Control)event.widget ) { if (contains(control)) showControl(control); } }
--- a/dwt/custom/StackLayout.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/StackLayout.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.custom.StackLayout; +import dwt.dwthelper.utils; + import dwt.DWT; @@ -23,7 +25,6 @@ import tango.util.Convert; static import tango.text.Util; -import dwt.dwthelper.utils; /** * This Layout stacks all the controls one on top of the other and resizes all controls
--- a/dwt/custom/TableCursor.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/TableCursor.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.custom.TableCursor; +import dwt.dwthelper.utils; + import dwt.DWT; import dwt.DWTException; @@ -32,7 +34,6 @@ import dwt.widgets.TableItem; import dwt.widgets.TypedListener; import dwt.widgets.Widget; -import dwt.dwthelper.utils; /** * A TableCursor provides a way for the user to navigate around a Table
--- a/dwt/custom/TableEditor.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/TableEditor.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.custom.TableEditor; +import dwt.dwthelper.utils; + import dwt.DWT; @@ -25,7 +27,6 @@ import dwt.widgets.TableItem; import dwt.custom.ControlEditor; import dwt.dwthelper.Runnable; -import dwt.dwthelper.utils; /** *
--- a/dwt/custom/TableTree.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/TableTree.d Tue Oct 07 16:18:26 2008 +0200 @@ -36,7 +36,6 @@ import dwt.widgets.TableItem; import dwt.widgets.TypedListener; import dwt.custom.TableTreeItem; - import dwt.dwthelper.utils; /** @@ -776,7 +775,7 @@ */ public void setSelection (TableTreeItem[] items) { checkWidget (); - // DWT extension: allow null array + // DWT extension: allow null for zero length string //if (items is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); int length = items.length; if (length is 0 || ((table.getStyle() & DWT.SINGLE) !is 0 && length > 1)) {
--- a/dwt/custom/TableTreeEditor.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/TableTreeEditor.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,7 @@ *******************************************************************************/ module dwt.custom.TableTreeEditor; +import dwt.dwthelper.utils; import dwt.DWT; @@ -28,7 +29,6 @@ import dwt.custom.TableTreeItem; import dwt.dwthelper.Runnable; -import dwt.dwthelper.utils; /** *
--- a/dwt/custom/TableTreeItem.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/TableTreeItem.d Tue Oct 07 16:18:26 2008 +0200 @@ -826,7 +826,7 @@ */ public void setText(int index, String text) { checkWidget(); - // DWT extension: allow null string + // DWT extension: allow null for zero length string //if (text is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); int columnCount = Math.max(parent.getTable().getColumnCount(), 1); if (index < 0 || index >= columnCount) return;
--- a/dwt/custom/TextChangingEvent.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/TextChangingEvent.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,11 +12,12 @@ *******************************************************************************/ module dwt.custom.TextChangingEvent; +import dwt.dwthelper.utils; + import dwt.events.TypedEvent; import dwt.custom.StyledTextContent; import dwt.custom.StyledTextEvent; -import dwt.dwthelper.utils; /** * This event is sent by the StyledTextContent implementor when a change
--- a/dwt/custom/TreeEditor.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/TreeEditor.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,7 @@ *******************************************************************************/ module dwt.custom.TreeEditor; +import dwt.dwthelper.utils; import dwt.DWT; @@ -28,8 +29,6 @@ import dwt.custom.ControlEditor; import dwt.dwthelper.Runnable; -import dwt.dwthelper.utils; - /** * * A TreeEditor is a manager for a Control that appears above a cell in a Tree and tracks with the
--- a/dwt/custom/ViewForm.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/ViewForm.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.custom.ViewForm; +import dwt.dwthelper.utils; + import dwt.DWT; @@ -27,7 +29,6 @@ import dwt.widgets.Layout; import dwt.widgets.Listener; import dwt.custom.ViewFormLayout; -import dwt.dwthelper.utils; /** * Instances of this class implement a Composite that positions and sizes
--- a/dwt/custom/ViewFormLayout.d Tue Oct 07 14:44:44 2008 +0200 +++ b/dwt/custom/ViewFormLayout.d Tue Oct 07 16:18:26 2008 +0200 @@ -12,6 +12,7 @@ *******************************************************************************/ module dwt.custom.ViewFormLayout; +import dwt.dwthelper.utils; import dwt.DWT; import dwt.graphics.Point; @@ -22,7 +23,6 @@ import dwt.widgets.Scrollable; import dwt.custom.ViewForm; import dwt.custom.CLayoutData; -import dwt.dwthelper.utils; /** * This class provides the layout for ViewForm