summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Barnes <krbarnes>2007-03-14 21:28:20 +0000
committerKevin Barnes <krbarnes>2007-03-14 21:28:20 +0000
commit6792575e9ebdb961dabdb7dc271f66f85beb9c8c (patch)
tree06ba0bc5f0ca3b6692cce690342cfb192632e511
parent3f5a4e4f5d672d8a0d0ada50a923d1d07dab435e (diff)
downloadeclipse.platform.swt-6792575e9ebdb961dabdb7dc271f66f85beb9c8c.tar.gz
eclipse.platform.swt-6792575e9ebdb961dabdb7dc271f66f85beb9c8c.tar.xz
eclipse.platform.swt-6792575e9ebdb961dabdb7dc271f66f85beb9c8c.zip
ScrollBar visibility
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.wpf.OS.properties8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os.cpp22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.cpp6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Composite.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Scrollable.java10
7 files changed, 56 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.wpf.OS.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.wpf.OS.properties
index 072b521898..6967df61dd 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.wpf.OS.properties
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.wpf.OS.properties
@@ -2316,6 +2316,14 @@ OS_ScrollBar_typeid=accessor=ScrollBar::typeid,flags=const gcobject
OS_ScrollEventArgs_ScrollEventType=flags=getter
OS_ScrollEventArgs_ScrollEventType_0=cast=ScrollEventArgs^,flags=gcobject
+OS_ScrollViewer_SetHorizontalScrollBarVisibility=accessor=ScrollViewer::SetHorizontalScrollBarVisibility
+OS_ScrollViewer_SetHorizontalScrollBarVisibility_0=cast=(DependencyObject^),flags=gcobject
+OS_ScrollViewer_SetHorizontalScrollBarVisibility_1=cast=(ScrollBarVisibility)
+
+OS_ScrollViewer_SetVerticalScrollBarVisibility=accessor=ScrollViewer::SetVerticalScrollBarVisibility
+OS_ScrollViewer_SetVerticalScrollBarVisibility_0=cast=(DependencyObject^),flags=gcobject
+OS_ScrollViewer_SetVerticalScrollBarVisibility_1=cast=(ScrollBarVisibility)
+
OS_ScrollViewer_typeid=accessor=ScrollViewer::typeid,flags=const gcobject
OS_SelectionChangedEventArgs_AddedItems=flags=gcobject getter
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os.cpp
index 79aec5cdf4..c753639a5e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os.cpp
@@ -8354,6 +8354,28 @@ JNIEXPORT jint JNICALL OS_NATIVE(ScrollEventArgs_1ScrollEventType)
}
#endif
+#ifndef NO_ScrollViewer_1SetHorizontalScrollBarVisibility
+extern "C" JNIEXPORT void JNICALL OS_NATIVE(ScrollViewer_1SetHorizontalScrollBarVisibility)(JNIEnv *env, jclass that, jint arg0, jint arg1);
+JNIEXPORT void JNICALL OS_NATIVE(ScrollViewer_1SetHorizontalScrollBarVisibility)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ OS_NATIVE_ENTER(env, that, ScrollViewer_1SetHorizontalScrollBarVisibility_FUNC);
+ ScrollViewer::SetHorizontalScrollBarVisibility((DependencyObject^)TO_OBJECT(arg0), (ScrollBarVisibility)arg1);
+ OS_NATIVE_EXIT(env, that, ScrollViewer_1SetHorizontalScrollBarVisibility_FUNC);
+}
+#endif
+
+#ifndef NO_ScrollViewer_1SetVerticalScrollBarVisibility
+extern "C" JNIEXPORT void JNICALL OS_NATIVE(ScrollViewer_1SetVerticalScrollBarVisibility)(JNIEnv *env, jclass that, jint arg0, jint arg1);
+JNIEXPORT void JNICALL OS_NATIVE(ScrollViewer_1SetVerticalScrollBarVisibility)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ OS_NATIVE_ENTER(env, that, ScrollViewer_1SetVerticalScrollBarVisibility_FUNC);
+ ScrollViewer::SetVerticalScrollBarVisibility((DependencyObject^)TO_OBJECT(arg0), (ScrollBarVisibility)arg1);
+ OS_NATIVE_EXIT(env, that, ScrollViewer_1SetVerticalScrollBarVisibility_FUNC);
+}
+#endif
+
#ifndef NO_ScrollViewer_1typeid
extern "C" JNIEXPORT jint JNICALL OS_NATIVE(ScrollViewer_1typeid)(JNIEnv *env, jclass that);
JNIEXPORT jint JNICALL OS_NATIVE(ScrollViewer_1typeid)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.cpp
index a377cc2857..32bd0621ea 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.cpp
@@ -14,8 +14,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1181;
-int OS_nativeFunctionCallCount[1181];
+int OS_nativeFunctionCount = 1183;
+int OS_nativeFunctionCallCount[1183];
char * OS_nativeFunctionNames[] = {
"AccessText_1AccessKey",
"AccessText_1Text",
@@ -702,6 +702,8 @@ char * OS_nativeFunctionNames[] = {
"ScrollBar_1ViewportSize__ID",
"ScrollBar_1typeid",
"ScrollEventArgs_1ScrollEventType",
+ "ScrollViewer_1SetHorizontalScrollBarVisibility",
+ "ScrollViewer_1SetVerticalScrollBarVisibility",
"ScrollViewer_1typeid",
"SelectionChangedEventArgs_1AddedItems",
"SelectionChangedEventArgs_1RemovedItems",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.h
index a0f7b8a0f6..e28843f27e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library/os_stats.h
@@ -710,6 +710,8 @@ typedef enum {
ScrollBar_1ViewportSize__ID_FUNC,
ScrollBar_1typeid_FUNC,
ScrollEventArgs_1ScrollEventType_FUNC,
+ ScrollViewer_1SetHorizontalScrollBarVisibility_FUNC,
+ ScrollViewer_1SetVerticalScrollBarVisibility_FUNC,
ScrollViewer_1typeid_FUNC,
SelectionChangedEventArgs_1AddedItems_FUNC,
SelectionChangedEventArgs_1RemovedItems_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java
index f2649cb089..40ce30d32c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java
@@ -325,6 +325,9 @@ public class OS extends C {
public static final int DispatcherPriority_Normal = 9;
public static final int DispatcherPriority_Send = 10;
+ public static final int ScrollBarVisibility_Disabled = 0;
+ public static final int ScrollBarVisibility_Auto = 1;
+ public static final int ScrollBarVisibility_Hidden = 2;
public static final int ScrollBarVisibility_Visible = 3;
public static final int FocusNavigationDirection_Next = 0;
@@ -1082,7 +1085,9 @@ public static final native double ScrollBar_ViewportSize(int sender);
public static final native void ScrollBar_ViewportSize(int sender, double value);
public static final native int ScrollBar_typeid();
public static final native int ScrollEventArgs_ScrollEventType(int sender);
-public static final native int ScrollViewer_typeid ();
+public static final native void ScrollViewer_SetVerticalScrollBarVisibility(int sender, int visibility);
+public static final native void ScrollViewer_SetHorizontalScrollBarVisibility(int sender, int visibility);
+public static final native int ScrollViewer_typeid();
public static final native void Selector_IsSynchronizedWithCurrentItem(int sender, boolean value);
public static final native int Selector_SelectedIndex(int sender);
public static final native void Selector_SelectedIndex(int sender, int value);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Composite.java
index a82202fb5c..2ed76f02bb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Composite.java
@@ -377,6 +377,10 @@ Menu [] findMenus (Control control) {
return result;
}
+void fixScrollbarVisibility () {
+ //no subclass of Composite needs this fix
+}
+
void fixTabList (Control control) {
if (tabList == null) return;
int count = 0;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Scrollable.java
index ce4f60c447..4e677b363c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Scrollable.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Scrollable.java
@@ -119,6 +119,7 @@ void createWidget () {
super.createWidget ();
if ((style & SWT.H_SCROLL) != 0) horizontalBar = createScrollBar (SWT.H_SCROLL);
if ((style & SWT.V_SCROLL) != 0) verticalBar = createScrollBar (SWT.V_SCROLL);
+ fixScrollbarVisibility ();
}
void deregister () {
@@ -141,6 +142,15 @@ int findScrollViewer (int current, int scrollViewerType) {
return 0;
}
+void fixScrollbarVisibility () {
+ if ((style & SWT.H_SCROLL) == 0) {
+ OS.ScrollViewer_SetHorizontalScrollBarVisibility (handle, OS.ScrollBarVisibility_Hidden);
+ }
+ if ((style & SWT.V_SCROLL) == 0) {
+ OS.ScrollViewer_SetVerticalScrollBarVisibility (handle, OS.ScrollBarVisibility_Hidden);
+ }
+}
+
/**
* Returns a rectangle which describes the area of the
* receiver which is capable of displaying data (that is,