diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-08-08 10:23:59 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-08-08 10:23:59 -0400 |
commit | 27e4e4382fd0d1ea5096b74264f64b5ca0207625 (patch) | |
tree | f0ff4b9f9ebc20b778f8cf271dce1bf72f20fac9 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt | |
parent | 37911e0ffd8884382e7030a0b8c6d0f4e7752bc6 (diff) | |
download | eclipse.platform.swt-27e4e4382fd0d1ea5096b74264f64b5ca0207625.tar.gz eclipse.platform.swt-27e4e4382fd0d1ea5096b74264f64b5ca0207625.tar.xz eclipse.platform.swt-27e4e4382fd0d1ea5096b74264f64b5ca0207625.zip |
fix: use helper instead of OS native. And fix helpers to call OS.GTK_WIDGET_UNSET_FLAGS when parameter is false
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java | 2 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java | 24 |
2 files changed, 21 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java index 697d33939f..c08b0f3994 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java @@ -370,7 +370,7 @@ void redrawBackgroundImage () { void redrawWidget (int x, int y, int width, int height, boolean redrawAll, boolean all, boolean trim) { super.redrawWidget (x, y, width, height, redrawAll, all, trim); - if (!OS.gtk_widget_get_realized (handle)) return; + if (!gtk_widget_get_realized (handle)) return; if (!trim) return; int /*long*/ topHandle = topHandle (), paintHandle = paintHandle (); if (topHandle == paintHandle) return; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index e69adb80a7..9b944e5b4e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -1750,7 +1750,11 @@ void gtk_widget_set_can_default (int /*long*/ widget, boolean can_default) { if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { OS.gtk_widget_set_can_default (widget, can_default); } else { - OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_DEFAULT); + if (can_default) { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_DEFAULT); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_CAN_DEFAULT); + } } } @@ -1758,7 +1762,11 @@ void gtk_widget_set_can_focus (int /*long*/ widget, boolean can_focus) { if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { OS.gtk_widget_set_can_focus (widget, can_focus); } else { - OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_FOCUS); + if (can_focus) { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_FOCUS); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_CAN_FOCUS); + } } } @@ -1766,7 +1774,11 @@ void gtk_widget_set_mapped (int /*long*/ widget, boolean mapped) { if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { OS.gtk_widget_set_mapped (widget, mapped); } else { - OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED); + if (mapped) { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_MAPPED); + } } } @@ -1774,7 +1786,11 @@ void gtk_widget_set_visible (int /*long*/ widget, boolean visible) { if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { OS.gtk_widget_set_visible (widget,visible); } else { - OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_VISIBLE); + if (visible) { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_VISIBLE); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_VISIBLE); + } } } |