Mercurial > projects > dwt-addons
diff dwtx/ui/internal/forms/widgets/SelectionData.d @ 104:04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
These new wrappers now use the tango.util.containers instead of the tango.util.collections.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 07 Aug 2008 15:01:33 +0200 |
parents | 26c6c9dfd13c |
children |
line wrap: on
line diff
--- a/dwtx/ui/internal/forms/widgets/SelectionData.d Sun Aug 03 17:01:51 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/SelectionData.d Thu Aug 07 15:01:33 2008 +0200 @@ -21,7 +21,8 @@ import dwt.widgets.Display; import dwt.dwthelper.utils; -import tango.util.collection.ArraySeq; +import dwtx.dwtxhelper.Collection; + static import tango.text.Text; public class SelectionData { @@ -30,12 +31,12 @@ public Color fg; private Point start; private Point stop; - private ArraySeq!(String) segments; + private ArrayList segments; private bool newLineNeeded; public this(MouseEvent e) { display = e.display; - segments = new ArraySeq!(String); + segments = new ArrayList(); start = new Point(e.x, e.y); stop = new Point(e.x, e.y); bg = e.display.getSystemColor(DWT.COLOR_LIST_SELECTION); @@ -47,10 +48,10 @@ } public void addSegment(String text) { if (newLineNeeded) { - segments.append(System.getProperty("line.separator")); //$NON-NLS-1$ + segments.add(System.getProperty("line.separator")); //$NON-NLS-1$ newLineNeeded=false; } - segments.append(text); + segments.add(text); } public void update(MouseEvent e) { @@ -64,7 +65,7 @@ public String getSelectionText() { auto buf = new tango.text.Text.Text!(char); for (int i=0; i<segments.size(); i++) { - buf.append(segments.get(i)); + buf.append(stringcast(segments.get(i))); } return buf.toString(); } @@ -91,7 +92,7 @@ return isInverted(rowHeight) ? start.x:stop.x; } private bool isInverted(Locator locator) { - int rowHeight = locator.heights.get(locator.rowCounter).array[0]; + int rowHeight = arrayFromObject!(Integer)(locator.heights.get(locator.rowCounter))[0].value; return isInverted(rowHeight); } private bool isInverted(int rowHeight) { @@ -110,7 +111,7 @@ public bool isSelectedRow(Locator locator) { if (!isEnclosed()) return false; - int rowHeight = locator.heights.get(locator.rowCounter).array[0]; + int rowHeight = arrayFromObject!(Integer)(locator.heights.get(locator.rowCounter))[0].value; return isSelectedRow(locator.y, rowHeight); } public bool isSelectedRow(int y, int rowHeight) { @@ -122,7 +123,7 @@ public bool isFirstSelectionRow(Locator locator) { if (!isEnclosed()) return false; - int rowHeight = locator.heights.get(locator.rowCounter).array[0]; + int rowHeight = arrayFromObject!(Integer)(locator.heights.get(locator.rowCounter))[0].value; return (locator.y + rowHeight >= getTopOffset() && locator.y <= getTopOffset()); } @@ -135,7 +136,7 @@ public bool isLastSelectionRow(Locator locator) { if (!isEnclosed()) return false; - int rowHeight = locator.heights.get(locator.rowCounter).array[0]; + int rowHeight = arrayFromObject!(Integer)(locator.heights.get(locator.rowCounter))[0].value; return (locator.y + rowHeight >=getBottomOffset() && locator.y <= getBottomOffset()); }