summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine <veronika>2004-02-16 22:16:17 +0000
committerVeronika Irvine <veronika>2004-02-16 22:16:17 +0000
commit52cc9f66dc2d916f415347f67eda980737e233af (patch)
treef4d7a48381ef66b79fd0c502f9217b9a4d9c8418
parent0317ba6a815f207c70e5fda4d9b59938d7524871 (diff)
downloadeclipse.platform.swt-52cc9f66dc2d916f415347f67eda980737e233af.tar.gz
eclipse.platform.swt-52cc9f66dc2d916f415347f67eda980737e233af.tar.xz
eclipse.platform.swt-52cc9f66dc2d916f415347f67eda980737e233af.zip
*** empty log message ***v3039
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java102
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem2.java103
-rwxr-xr-xbundles/org.eclipse.swt/buildnotes_swt.html4
3 files changed, 109 insertions, 100 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java
index 5fbcd4c843..2d748faaf5 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java
@@ -305,59 +305,61 @@ void drawSelected(GC gc ) {
}
parent.drawBackground(gc, shape, true);
- // Limit drawing area of tab
- Region r = new Region();
- r.subtract(r); //clear
- Region clipping = new Region();
- gc.getClipping(clipping);
- r.add(clipping);
- r.intersect(new Rectangle(x, y, Math.min(width, rightTabEdge-x), height));
- gc.setClipping(r);
-
- // draw Image
- int xDraw = x + LEFT_MARGIN;
- Image image = getImage();
- if (image != null) {
- Rectangle imageBounds = image.getBounds();
- int imageX = xDraw;
- int imageHeight = imageBounds.height;
- int imageY = y + (height - imageHeight) / 2;
- imageY += parent.onBottom ? -1 : 1;
- int imageWidth = imageBounds.width * imageHeight / imageBounds.height;
- gc.drawImage(image,
- imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height,
- imageX, imageY, imageWidth, imageHeight);
- xDraw += imageWidth + INTERNAL_SPACING;
- }
-
- // draw Text
- int textWidth = x + width - xDraw - RIGHT_MARGIN;
- if (closeRect.width > 0) textWidth -= closeRect.width + INTERNAL_SPACING;
- if (shortenedText == null || shortenedTextWidth != textWidth) {
- shortenedText = shortenText(gc, getText(), textWidth);
- shortenedTextWidth = textWidth;
- }
- Point extent = gc.textExtent(shortenedText, FLAGS);
- int textY = y + (height - extent.y) / 2;
- textY += parent.onBottom ? -1 : 1;
-
- gc.setForeground(parent.selectionForeground);
- gc.drawText(shortenedText, xDraw, textY, FLAGS);
-
- if (parent.showClose || showClose) drawClose(gc);
+ if (x < rightTabEdge) {
+ // Limit drawing area of tab
+ Region r = new Region();
+ r.subtract(r); //clear
+ Region clipping = new Region();
+ gc.getClipping(clipping);
+ r.add(clipping);
+ r.intersect(new Rectangle(x, y, Math.min(width, rightTabEdge-x), height));
+ gc.setClipping(r);
- // draw a Focus rectangle
- if (parent.isFocusControl()) {
- Display display = getDisplay();
- gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
- gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
- gc.drawFocus(xDraw-3, textY-2, extent.x+6, extent.y+4);
+ // draw Image
+ int xDraw = x + LEFT_MARGIN;
+ Image image = getImage();
+ if (image != null) {
+ Rectangle imageBounds = image.getBounds();
+ int imageX = xDraw;
+ int imageHeight = imageBounds.height;
+ int imageY = y + (height - imageHeight) / 2;
+ imageY += parent.onBottom ? -1 : 1;
+ int imageWidth = imageBounds.width * imageHeight / imageBounds.height;
+ gc.drawImage(image,
+ imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height,
+ imageX, imageY, imageWidth, imageHeight);
+ xDraw += imageWidth + INTERNAL_SPACING;
+ }
+
+ // draw Text
+ int textWidth = x + width - xDraw - RIGHT_MARGIN;
+ if (closeRect.width > 0) textWidth -= closeRect.width + INTERNAL_SPACING;
+ if (shortenedText == null || shortenedTextWidth != textWidth) {
+ shortenedText = shortenText(gc, getText(), textWidth);
+ shortenedTextWidth = textWidth;
+ }
+ Point extent = gc.textExtent(shortenedText, FLAGS);
+ int textY = y + (height - extent.y) / 2;
+ textY += parent.onBottom ? -1 : 1;
+
+ gc.setForeground(parent.selectionForeground);
+ gc.drawText(shortenedText, xDraw, textY, FLAGS);
+
+ if (parent.showClose || showClose) drawClose(gc);
+
+ // draw a Focus rectangle
+ if (parent.isFocusControl()) {
+ Display display = getDisplay();
+ gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+ gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
+ gc.drawFocus(xDraw-3, textY-2, extent.x+6, extent.y+4);
+ }
+
+ gc.setClipping(clipping);
+ r.dispose();
+ clipping.dispose();
}
- gc.setClipping(clipping);
- r.dispose();
- clipping.dispose();
-
// draw outline
shape[0] = Math.max(0, parent.borderLeft - 1);
shape[shape.length - 2] = size.x - parent.borderRight + 1;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem2.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem2.java
index 1946fb384a..579fe1ede4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem2.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem2.java
@@ -307,59 +307,61 @@ void drawSelected(GC gc ) {
}
parent.drawBackground(gc, shape, true);
- // Limit drawing area of tab
- Region r = new Region();
- r.subtract(r); //clear
- Region clipping = new Region();
- gc.getClipping(clipping);
- r.add(clipping);
- r.intersect(new Rectangle(x, y, Math.min(width, rightTabEdge-x), height));
- gc.setClipping(r);
-
- // draw Image
- int xDraw = x + LEFT_MARGIN;
- Image image = getImage();
- if (image != null) {
- Rectangle imageBounds = image.getBounds();
- int imageX = xDraw;
- int imageHeight = imageBounds.height;
- int imageY = y + (height - imageHeight) / 2;
- imageY += parent.onBottom ? -1 : 1;
- int imageWidth = imageBounds.width * imageHeight / imageBounds.height;
- gc.drawImage(image,
- imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height,
- imageX, imageY, imageWidth, imageHeight);
- xDraw += imageWidth + INTERNAL_SPACING;
- }
-
- // draw Text
- int textWidth = x + width - xDraw - RIGHT_MARGIN;
- if (closeRect.width > 0) textWidth -= closeRect.width + INTERNAL_SPACING;
- if (shortenedText == null || shortenedTextWidth != textWidth) {
- shortenedText = shortenText(gc, getText(), textWidth);
- shortenedTextWidth = textWidth;
- }
- Point extent = gc.textExtent(shortenedText, FLAGS);
- int textY = y + (height - extent.y) / 2;
- textY += parent.onBottom ? -1 : 1;
-
- gc.setForeground(parent.selectionForeground);
- gc.drawText(shortenedText, xDraw, textY, FLAGS);
-
- if (parent.showClose || showClose) drawClose(gc);
+ if ( x < rightTabEdge) {
+ // Limit drawing area of tab
+ Region r = new Region();
+ r.subtract(r); //clear
+ Region clipping = new Region();
+ gc.getClipping(clipping);
+ r.add(clipping);
+ r.intersect(new Rectangle(x, y, Math.min(width, rightTabEdge-x), height));
+ gc.setClipping(r);
- // draw a Focus rectangle
- if (parent.isFocusControl()) {
- Display display = getDisplay();
- gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
- gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
- gc.drawFocus(xDraw-3, textY-2, extent.x+6, extent.y+4);
+ // draw Image
+ int xDraw = x + LEFT_MARGIN;
+ Image image = getImage();
+ if (image != null) {
+ Rectangle imageBounds = image.getBounds();
+ int imageX = xDraw;
+ int imageHeight = imageBounds.height;
+ int imageY = y + (height - imageHeight) / 2;
+ imageY += parent.onBottom ? -1 : 1;
+ int imageWidth = imageBounds.width * imageHeight / imageBounds.height;
+ gc.drawImage(image,
+ imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height,
+ imageX, imageY, imageWidth, imageHeight);
+ xDraw += imageWidth + INTERNAL_SPACING;
+ }
+
+ // draw Text
+ int textWidth = x + width - xDraw - RIGHT_MARGIN;
+ if (closeRect.width > 0) textWidth -= closeRect.width + INTERNAL_SPACING;
+ if (shortenedText == null || shortenedTextWidth != textWidth) {
+ shortenedText = shortenText(gc, getText(), textWidth);
+ shortenedTextWidth = textWidth;
+ }
+ Point extent = gc.textExtent(shortenedText, FLAGS);
+ int textY = y + (height - extent.y) / 2;
+ textY += parent.onBottom ? -1 : 1;
+
+ gc.setForeground(parent.selectionForeground);
+ gc.drawText(shortenedText, xDraw, textY, FLAGS);
+
+ if (parent.showClose || showClose) drawClose(gc);
+
+ // draw a Focus rectangle
+ if (parent.isFocusControl()) {
+ Display display = getDisplay();
+ gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+ gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
+ gc.drawFocus(xDraw-3, textY-2, extent.x+6, extent.y+4);
+ }
+
+ gc.setClipping(clipping);
+ r.dispose();
+ clipping.dispose();
}
- gc.setClipping(clipping);
- r.dispose();
- clipping.dispose();
-
// draw outline
shape[0] = Math.max(0, parent.borderLeft - 1);
shape[shape.length - 2] = size.x - parent.borderRight + 1;
@@ -385,6 +387,7 @@ void drawUnselected(GC gc) {
parent.drawBackground(gc, shape, false);
return;
}
+
// draw background
int[] shape = null;
if (parent.indexOf(this) == parent.topTabIndex) {
diff --git a/bundles/org.eclipse.swt/buildnotes_swt.html b/bundles/org.eclipse.swt/buildnotes_swt.html
index 6ce893b1c2..f3eb6c80c3 100755
--- a/bundles/org.eclipse.swt/buildnotes_swt.html
+++ b/bundles/org.eclipse.swt/buildnotes_swt.html
@@ -14,6 +14,10 @@ SWT</h1>
<h2> SWT Build 3.0 039 - Tuesday February 17, 2004 </h2>
+<h3><a NAME="New APIs"></a>New APIs</h3>
+<p>CTabFolder has been modified to display the new look for 3.0.
+Please note that the new 3.0 API in CTabFolder has not been finalized and is subject to change.</p>
+
<h3><a NAME="Problem reports fixed"></a>Problem reports fixed</h3>
<blockquote>
21430: Accessibility:JAWS can not read label for multi-lines Text