summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2003-09-24 20:50:04 +0000
committerFelipe Heidrich <fheidric>2003-09-24 20:50:04 +0000
commitca879772beccbb2e0a848400a0c962ae48162ddd (patch)
tree4a4bc1b723c161f82c583f007699961043a3ffce /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt
parent8edab89e944b297057829033171049ca20ceb017 (diff)
downloadeclipse.platform.swt-ca879772beccbb2e0a848400a0c962ae48162ddd.tar.gz
eclipse.platform.swt-ca879772beccbb2e0a848400a0c962ae48162ddd.tar.xz
eclipse.platform.swt-ca879772beccbb2e0a848400a0c962ae48162ddd.zip
42892
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java9
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java5
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java9
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java5
5 files changed, 15 insertions, 15 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
index 5fd3f2a6a9..b2c709976e 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
@@ -2048,16 +2048,13 @@ void init(Drawable drawable, GCData data, int hDC) {
int layout = data.layout;
if (layout != -1) {
if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
- if ((data.style & SWT.RIGHT_TO_LEFT) != 0) {
- data.style |= SWT.MIRRORED;
- layout = OS.LAYOUT_RTL;
- }
int flags = OS.GetLayout(hDC);
- if ((flags & OS.LAYOUT_RTL) != layout) {
+ if ((flags & OS.LAYOUT_RTL) != (layout & OS.LAYOUT_RTL)) {
flags &= ~OS.LAYOUT_RTL;
OS.SetLayout(hDC, flags | layout);
}
- }
+ if ((flags & OS.LAYOUT_RTL) != 0) data.style |= SWT.MIRRORED;
+ }
}
this.drawable = drawable;
this.data = data;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
index 27647a127d..8d530bbbb3 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
@@ -34,5 +34,5 @@ public final class GCData {
public int hNullBitmap;
public int hwnd;
public PAINTSTRUCT ps;
- public int layout;
+ public int layout = -1;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
index e7fc9dd65a..c3840cfd17 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
@@ -1763,9 +1763,10 @@ public int internal_new_GC (GCData data) {
if (data != null) {
/* Set the GCData fields */
int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
- if ((data.style & mask) == 0) {
+ if ((data.style & mask) != 0) {
+ data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0;
+ } else {
data.style |= SWT.LEFT_TO_RIGHT;
- data.layout = -1;
}
data.device = device;
data.image = this;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index fa08a4b8c3..e030991261 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -1033,14 +1033,15 @@ public int internal_new_GC (GCData data) {
if (hDC == 0) SWT.error(SWT.ERROR_NO_HANDLES);
if (data != null) {
int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
- if ((data.style & mask) == 0) {
- int bits = OS.GetWindowLong (handle, OS.GWL_EXSTYLE);
- if ((bits & OS.WS_EX_LAYOUTRTL) != 0) {
+ if ((data.style & mask) != 0) {
+ data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0;
+ } else {
+ int flags = OS.GetLayout (hDC);
+ if ((flags & OS.LAYOUT_RTL) != 0) {
data.style |= SWT.RIGHT_TO_LEFT | SWT.MIRRORED;
} else {
data.style |= SWT.LEFT_TO_RIGHT;
}
- data.layout = -1;
}
data.device = display;
data.foreground = getForegroundPixel ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
index d1429cac46..efd8f31046 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
@@ -1412,9 +1412,10 @@ public int internal_new_GC (GCData data) {
if (hDC == 0) SWT.error (SWT.ERROR_NO_HANDLES);
if (data != null) {
int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
- if ((data.style & mask) == 0) {
+ if ((data.style & mask) != 0) {
+ data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0;
+ } else {
data.style |= SWT.LEFT_TO_RIGHT;
- data.layout = -1;
}
data.device = this;
data.hFont = systemFont ();