summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2009-10-05 18:02:18 +0000
committerFelipe Heidrich <fheidric>2009-10-05 18:02:18 +0000
commit72e3e81c2dfdc15c1393cd52eb5e1e324eee9428 (patch)
tree8086e67eee9ce8daf2d02f4b0830c3b443739161
parentbb847d9554a3ec5018957900ef96edf821e2b2d9 (diff)
downloadeclipse.platform.swt-72e3e81c2dfdc15c1393cd52eb5e1e324eee9428.tar.gz
eclipse.platform.swt-72e3e81c2dfdc15c1393cd52eb5e1e324eee9428.tar.xz
eclipse.platform.swt-72e3e81c2dfdc15c1393cd52eb5e1e324eee9428.zip
Bug 289752 - Bidi: Ctrl+RightShift/Ctrl+LeftShift doesn't switch the StyledText orientation
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
index 2914afc2f4..428047c486 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -166,6 +166,7 @@ public class StyledText extends Canvas {
int indent;
int lineSpacing;
int alignmentMargin;
+ int newOrientation = SWT.NONE;
//block selection
boolean blockSelection;
@@ -5887,6 +5888,10 @@ void handleKeyDown(Event event) {
if (clipboardSelection == null) {
clipboardSelection = new Point(selection.x, selection.y);
}
+ newOrientation = SWT.NONE;
+ if ((event.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL && event.keyCode == SWT.SHIFT && isBidiCaret()) {
+ newOrientation = event.keyLocation == SWT.LEFT ? SWT.LEFT_TO_RIGHT : SWT.RIGHT_TO_LEFT;
+ }
Event verifyEvent = new Event();
verifyEvent.character = event.character;
@@ -5910,6 +5915,11 @@ void handleKeyUp(Event event) {
}
}
clipboardSelection = null;
+
+ if (newOrientation != SWT.NONE) {
+ setOrientation(newOrientation);
+ newOrientation = SWT.NONE;
+ }
}
/**
* Updates the caret location and selection if mouse button 1 has been