summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2010-12-23 19:03:29 +0000
committerFelipe Heidrich <fheidric>2010-12-23 19:03:29 +0000
commite1ddb07c7c0cc45210739f25c19adbd93ffa639d (patch)
treee86a3ee5e0dbe8ad0879c9dabcb511e901373a07 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
parentb13cb0959e0afe3c17aa178a3bca80d7d1fd22d7 (diff)
downloadeclipse.platform.swt-e1ddb07c7c0cc45210739f25c19adbd93ffa639d.tar.gz
eclipse.platform.swt-e1ddb07c7c0cc45210739f25c19adbd93ffa639d.tar.xz
eclipse.platform.swt-e1ddb07c7c0cc45210739f25c19adbd93ffa639d.zip
[Bug 29779] BIDI: lack of ability to change orientation of widget in runtime
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
index 0729e2e90d..ef70da5eda 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
@@ -1113,6 +1113,27 @@ void unsubclass () {
OS.SetWindowLongPtr (hwndUpDown, OS.GWLP_WNDPROC, UpDownProc);
}
+void updateOrientation () {
+ super.updateOrientation ();
+ int bits = OS.GetWindowLong (hwndText, OS.GWL_EXSTYLE);
+ int bits1 = OS.GetWindowLong (hwndText, OS.GWL_STYLE);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0){
+ bits |= OS.WS_EX_RIGHT;
+ bits1 |= OS.ES_RIGHT;
+ }
+ else{
+ bits &= ~OS.WS_EX_RIGHT;
+ bits1 &= ~OS.ES_RIGHT;
+ }
+ OS.SetWindowLong (hwndText, OS.GWL_STYLE, bits1);
+ OS.SetWindowLong (hwndText, OS.GWL_EXSTYLE, bits);
+ RECT rect = new RECT ();
+ OS.GetWindowRect (handle, rect);
+ int width = rect.right - rect.left, height = rect.bottom - rect.top;
+ OS.SetWindowPos (handle, 0, 0, 0, width - 1, height - 1, OS.SWP_NOMOVE | OS.SWP_NOZORDER);
+ OS.SetWindowPos (handle, 0, 0, 0, width, height, OS.SWP_NOMOVE | OS.SWP_NOZORDER);
+}
+
String verifyText (String string, int start, int end, Event keyEvent) {
Event event = new Event ();
event.text = string;