Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2016-02-22 05:46:45 +0000
committerNiraj Modi2016-02-22 05:46:45 +0000
commit4f1f70d09023dd1e0c2e1ec1090d5cdae406c822 (patch)
treefac5f1c56b8a7a76d4ba18da6c715a6bf725a278
parentd9ff7d9701f2f3d26843aad0237da561f2e85815 (diff)
downloadeclipse.platform.swt-4f1f70d09023dd1e0c2e1ec1090d5cdae406c822.tar.gz
eclipse.platform.swt-4f1f70d09023dd1e0c2e1ec1090d5cdae406c822.tar.xz
eclipse.platform.swt-4f1f70d09023dd1e0c2e1ec1090d5cdae406c822.zip
Win32 (Part 8): Changing API's coordinate system from Pixels to
Points.nmodi/NeonhiDpiWork2 - Updated Shell, Tracker and Tooltip - Fixed CLabel, Text and few classes example classes Change-Id: Id3931fa3aa243a3733594951504daa317bdd0d20 Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolTip.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java26
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java4
18 files changed, 118 insertions, 28 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
index 1137b5bf8b..ee9193a53b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
@@ -609,7 +609,7 @@ void dropDown (boolean drop) {
* Fix is to reduce height of list and shell in that case, bug 388126.
*/
ScrollBar hBar = list.getHorizontalBar();
- int emptyHBarSpace = hBar.isVisible () ? 0 : hBar.getSize ().y;
+ int emptyHBarSpace = hBar.isVisible () ? 0 : hBar.getSizeInPixels ().y;
list.setSizeInPixels (listRect.width, listRect.height - emptyHBarSpace);
popup.setBoundsInPixel (x, y, width, height - emptyHBarSpace);
popup.setVisible (true);
@@ -1813,7 +1813,7 @@ void textEvent (Event event) {
e.x = event.x;
e.y = event.y;
if (event.detail == SWT.MENU_KEYBOARD) {
- Point pt = getDisplay().mapInPixels(text, null, text.getCaretLocation());
+ Point pt = getDisplay().mapInPixels(text, null, text.getCaretLocationInPixels());
e.x = pt.x;
e.y = pt.y;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
index b5b9c7baf4..7e27fa0c27 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
@@ -265,7 +265,7 @@ private Point getTotalSize(Image image, String text) {
size.y = Math.max(size.y, e.y);
if (image != null) size.x += GAP;
} else {
- size.y = DPIUtil.autoScaleDown(gc.getFontMetrics().getHeight());
+ size.y = gc.getFontMetrics().getHeight();
}
gc.dispose();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java
index 0b6e52ada0..f12ef09c6b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java
@@ -341,7 +341,7 @@ boolean needHScroll(Rectangle contentRect, boolean vVisible) {
int border = getBorderWidthInPixels();
hostRect.width -= 2*border;
ScrollBar vBar = getVerticalBar();
- if (vVisible && vBar != null) hostRect.width -= vBar.getSize().x;
+ if (vVisible && vBar != null) hostRect.width -= vBar.getSizeInPixels().x;
if (!expandHorizontal && contentRect.width > hostRect.width) return true;
if (expandHorizontal && minWidth > hostRect.width) return true;
@@ -356,7 +356,7 @@ boolean needVScroll(Rectangle contentRect, boolean hVisible) {
int border = getBorderWidthInPixels();
hostRect.height -= 2*border;
ScrollBar hBar = getHorizontalBar();
- if (hVisible && hBar != null) hostRect.height -= hBar.getSize().y;
+ if (hVisible && hBar != null) hostRect.height -= hBar.getSizeInPixels().y;
if (!expandVertical && contentRect.height > hostRect.height) return true;
if (expandVertical && minHeight > hostRect.height) return true;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java
index 199ef22481..7ec1a9b62b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java
@@ -55,12 +55,12 @@ protected void layout(Composite composite, boolean flushCache) {
ScrollBar hBar = sc.getHorizontalBar();
ScrollBar vBar = sc.getVerticalBar();
if (hBar != null) {
- if (hBar.getSize().y >= sc.getSizeInPixels().y) {
+ if (hBar.getSizeInPixels().y >= sc.getSizeInPixels().y) {
return;
}
}
if (vBar != null) {
- if (vBar.getSize().x >= sc.getSizeInPixels().x) {
+ if (vBar.getSizeInPixels().x >= sc.getSizeInPixels().x) {
return;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
index 8346d2b5c3..86e796a938 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -1609,6 +1609,7 @@ public int getAscent () {
/**
* @noreference This method is not intended to be referenced by clients.
*/
+
public int getAscentInPixels () {
checkLayout();
return ascent;
@@ -1626,7 +1627,7 @@ public int getAscentInPixels () {
* </ul>
*
* @see #setWidth(int)
- * @see #getLineBoundsInPixels(int)
+ * @see #getLineBounds(int)
*/
public Rectangle getBounds () {
return DPIUtil.autoScaleDown(getBoundsInPixels());
@@ -3382,6 +3383,13 @@ public void setTextDirection (int textDirection) {
* @see #setAlignment(int)
*/
public void setWidth (int width) {
+ setWidthInPixels(width != SWT.DEFAULT ? DPIUtil.autoScaleUp(width) : width);
+}
+
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public void setWidthInPixels (int width) {
checkLayout();
if (width < -1 || width == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (this.wrapWidth == width) return;
@@ -3404,6 +3412,13 @@ public void setWidth (int width) {
* @since 3.6
*/
public void setWrapIndent (int wrapIndent) {
+ setWrapIndentInPixels(DPIUtil.autoScaleUp(wrapIndent));
+}
+
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public void setWrapIndentInPixels (int wrapIndent) {
checkLayout();
if (wrapIndent < 0) return;
if (this.wrapIndent == wrapIndent) return;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
index 50d2300eb7..dd5476ebac 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
@@ -209,17 +209,17 @@ public Point computeSizeInPixels (int wHint, int hHint, boolean changed) {
int layoutWidth = layout.getWidthInPixels ();
//TEMPORARY CODE
if (wHint == 0) {
- layout.setWidth (1);
+ layout.setWidthInPixels (1);
Rectangle rect = layout.getBoundsInPixels ();
width = 0;
height = rect.height;
} else {
- layout.setWidth (wHint);
+ layout.setWidthInPixels (wHint);
Rectangle rect = layout.getBoundsInPixels ();
width = rect.width;
height = rect.height;
}
- layout.setWidth (layoutWidth);
+ layout.setWidthInPixels (layoutWidth);
}
if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = hHint;
@@ -1093,7 +1093,7 @@ LRESULT WM_SIZE (long /*int*/ wParam, long /*int*/ lParam) {
if (OS.COMCTL32_MAJOR < 6) {
RECT rect = new RECT ();
OS.GetClientRect (handle, rect);
- layout.setWidth (rect.right > 0 ? rect.right : -1);
+ layout.setWidthInPixels (rect.right > 0 ? rect.right : -1);
redraw ();
}
return result;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java
index dbbe6e85b3..676847f5ee 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java
@@ -1226,7 +1226,7 @@ public void setToolTipText (String toolTip) {
void showTooltip (int x, int y) {
if (itemToolTip == null) return;
- itemToolTip.setLocation (x, y);
+ itemToolTip.setLocationInPixels (x, y);
itemToolTip.setVisible (true);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java
index ab68be0aef..1882531a83 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java
@@ -11,10 +11,10 @@
package org.eclipse.swt.widgets;
-import org.eclipse.swt.internal.win32.*;
import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.win32.*;
/**
* Instances of this class are selectable user interface
@@ -365,6 +365,12 @@ public int getSelection () {
* </ul>
*/
public Point getSize () {
+ return DPIUtil.autoScaleDown(getSizeInPixels());
+}
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public Point getSizeInPixels () {
checkWidget();
parent.forceResize ();
RECT rect = new RECT ();
@@ -418,6 +424,12 @@ public int getThumb () {
* @since 3.6
*/
public Rectangle getThumbBounds () {
+ return DPIUtil.autoScaleDown(getThumbBoundsInPixels());
+}
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public Rectangle getThumbBoundsInPixels () {
checkWidget();
parent.forceResize ();
SCROLLBARINFO info = new SCROLLBARINFO();
@@ -460,6 +472,12 @@ public Rectangle getThumbBounds () {
* @since 3.6
*/
public Rectangle getThumbTrackBounds () {
+ return DPIUtil.autoScaleDown(getThumbTrackBoundsInPixels());
+}
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public Rectangle getThumbTrackBoundsInPixels () {
checkWidget();
parent.forceResize ();
SCROLLBARINFO info = new SCROLLBARINFO();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
index 8b7f1c8847..297b3e63d8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
@@ -1065,6 +1065,13 @@ public boolean getMaximized () {
* @since 3.1
*/
public Point getMinimumSize () {
+ return DPIUtil.autoScaleDown(getMinimumSizeInPixels());
+}
+
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public Point getMinimumSizeInPixels () {
checkWidget ();
int width = Math.max (0, minWidth);
int trim = SWT.TITLE | SWT.CLOSE | SWT.MIN | SWT.MAX;
@@ -1731,6 +1738,12 @@ public void setImeInputMode (int mode) {
* @since 3.1
*/
public void setMinimumSize (int width, int height) {
+ setMinimumSizeInPixels(DPIUtil.autoScaleUp(width), DPIUtil.autoScaleUp(height));
+}
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public void setMinimumSizeInPixels (int width, int height) {
checkWidget ();
int widthLimit = 0, heightLimit = 0;
int trim = SWT.TITLE | SWT.CLOSE | SWT.MIN | SWT.MAX;
@@ -1774,9 +1787,15 @@ public void setMinimumSize (int width, int height) {
* @since 3.1
*/
public void setMinimumSize (Point size) {
+ setMinimumSizeInPixels(DPIUtil.autoScaleUp(size));
+}
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public void setMinimumSizeInPixels (Point size) {
checkWidget ();
if (size == null) error (SWT.ERROR_NULL_ARGUMENT);
- setMinimumSize (size.x, size.y);
+ setMinimumSizeInPixels (size.x, size.y);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
index 582f39e972..82f9cd545d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
@@ -940,6 +940,12 @@ public int getCaretLineNumber () {
* </ul>
*/
public Point getCaretLocation () {
+ return DPIUtil.autoScaleDown(getCaretLocationInPixels());
+}
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public Point getCaretLocationInPixels () {
checkWidget ();
/*
* Bug in Windows. For some reason, Windows is unable
@@ -2499,7 +2505,7 @@ int untranslateOffset (int offset) {
@Override
void updateMenuLocation (Event event) {
- Point point = display.mapInPixels (this, null, getCaretLocation ());
+ Point point = display.mapInPixels (this, null, getCaretLocationInPixels ());
event.x = point.x;
event.y = point.y + getLineHeightInPixels ();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolTip.java
index e1f449040b..20f8448ad3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolTip.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolTip.java
@@ -366,6 +366,12 @@ public void setAutoHide (boolean autoHide) {
* </ul>
*/
public void setLocation (int x, int y) {
+ setLocationInPixels(DPIUtil.autoScaleUp(x), DPIUtil.autoScaleUp(y));
+}
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public void setLocationInPixels (int x, int y) {
checkWidget ();
this.x = x;
this.y = y;
@@ -396,9 +402,15 @@ public void setLocation (int x, int y) {
* </ul>
*/
public void setLocation (Point location) {
+ setLocationInPixels(DPIUtil.autoScaleUp(location));
+}
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public void setLocationInPixels (Point location) {
checkWidget ();
if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
- setLocation (location.x, location.y);
+ setLocationInPixels (location.x, location.y);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java
index d491e60749..e12492b129 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java
@@ -11,11 +11,11 @@
package org.eclipse.swt.widgets;
-import org.eclipse.swt.internal.*;
-import org.eclipse.swt.internal.win32.*;
-import org.eclipse.swt.graphics.*;
import org.eclipse.swt.*;
import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.win32.*;
/**
* Instances of this class implement rubber banding rectangles that are
@@ -410,6 +410,17 @@ void drawRectangles (Rectangle [] rects, boolean stippled) {
* </ul>
*/
public Rectangle [] getRectangles () {
+ Rectangle [] result = getRectanglesInPixels();
+ for (int i = 0; i < result.length; i++) {
+ result[i] = DPIUtil.autoScaleDown(result[i]);
+ }
+ return result;
+}
+
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public Rectangle [] getRectanglesInPixels () {
checkWidget();
Rectangle [] result = new Rectangle [rectangles.length];
for (int i = 0; i < rectangles.length; i++) {
@@ -848,6 +859,15 @@ public void setCursor(Cursor newCursor) {
* </ul>
*/
public void setRectangles (Rectangle [] rectangles) {
+ for (int i = 0; i < rectangles.length; i++) {
+ rectangles [i] = DPIUtil.autoScaleUp (rectangles [i]);
+ }
+ setRectanglesInPixels (rectangles);
+}
+/**
+* @noreference This method is not intended to be referenced by clients.
+*/
+public void setRectanglesInPixels (Rectangle [] rectangles) {
checkWidget ();
if (rectangles == null) error (SWT.ERROR_NULL_ARGUMENT);
this.rectangles = new Rectangle [rectangles.length];
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
index 9abbcd976e..1c9de87da0 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
@@ -1721,7 +1721,7 @@ boolean headerUpdateToolTip (int x) {
toolTipLabel.setSize (area.width, area.height);
/* Position the tooltip and ensure it's not located off the screen */
- Point cursorLocation = getDisplay ().getCursorLocationInPixels ();
+ Point cursorLocation = getDisplay ().getCursorLocation ();
int cursorHeight = 21; /* assuming cursor is 21x21 */
Point size = toolTipShell.getSize ();
Rectangle rect = getMonitor ().getBounds ();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
index 4a103ac09c..463211f25e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
@@ -523,7 +523,7 @@ void paint (GC gc) {
if (displayText.length () > 0) {
gc.setForeground (getParent ().display.getSystemColor (SWT.COLOR_BLACK));
int fontHeight = parent.fontHeight;
- gc.drawTextInPixels (displayText, startX, (headerHeight - fontHeight) / 2, SWT.DRAW_MNEMONIC);
+ gc.drawText (displayText, startX, (headerHeight - fontHeight) / 2, SWT.DRAW_MNEMONIC);
startX += gc.textExtent (displayText, SWT.DRAW_MNEMONIC).x + CTable.MARGIN_IMAGE;
}
if (sort != SWT.NONE) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
index bffe988184..22c8916873 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
@@ -961,7 +961,7 @@ abstract class Tab {
*/
Rectangle bounds = dialog.getBounds();
Rectangle trim = dialog.computeTrim(0, 0, 0, 0);
- Rectangle clientArea = display.getClientAreaInPixels();
+ Rectangle clientArea = display.getClientArea();
if (bounds.height > clientArea.height) {
dialog.setSize(bounds.width, clientArea.height - trim.height);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java
index 6555791cf6..11af8b7f2e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java
@@ -372,7 +372,7 @@ public class HoverHelp {
* @return the top-left location for a hovering box
*/
private void setHoverLocation(Shell shell, Point position) {
- Rectangle displayBounds = shell.getDisplay().getBoundsInPixels();
+ Rectangle displayBounds = shell.getDisplay().getBounds ();
Rectangle shellBounds = shell.getBounds();
shellBounds.x = Math.max(Math.min(position.x, displayBounds.width - shellBounds.width), 0);
shellBounds.y = Math.max(Math.min(position.y + 16, displayBounds.height - shellBounds.height), 0);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java
index 3006ec9cf3..09bdcc37cc 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java
@@ -592,7 +592,7 @@ public class PaintExample {
* in which case set it to 9/10 of display size.
*/
private static void setShellSize (Display display, Shell shell) {
- Rectangle bounds = display.getBoundsInPixels();
+ Rectangle bounds = display.getBounds();
Point size = shell.computeSize (SWT.DEFAULT, SWT.DEFAULT);
if (size.x > bounds.width) size.x = bounds.width * 9 / 10;
if (size.y > bounds.height) size.y = bounds.height * 9 / 10;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java
index 6ab0b9af6a..e67556e401 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java
@@ -76,7 +76,7 @@ public class PaintSurface {
clearStatus();
/* Set up the drawing surface */
- Rectangle displayRect = paintCanvas.getDisplay().getClientAreaInPixels();
+ Rectangle displayRect = paintCanvas.getDisplay().getClientArea();
imageWidth = displayRect.width;
imageHeight = displayRect.height;
image = new Image(paintCanvas.getDisplay(), imageWidth, imageHeight);
@@ -145,7 +145,7 @@ public class PaintSurface {
}
if (paintImage == null) {
Display display = getDisplay();
- Rectangle rect = display.getClientAreaInPixels();
+ Rectangle rect = display.getClientArea();
paintImage = new Image(display,
Math.max(rect.width, event.width + event.x),
Math.max(rect.height, event.height + event.y));

Back to the top