Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich2007-08-31 20:41:05 +0000
committerFelipe Heidrich2007-08-31 20:41:05 +0000
commitfd48f1038f78b11a089cce1dff82a2e75ba45935 (patch)
tree9403d2057022813919d7f3001bc81cb5c478de79
parentf2fdacc1748ba70c63b400772bf7b53217fb343f (diff)
downloadeclipse.platform.swt-fd48f1038f78b11a089cce1dff82a2e75ba45935.tar.gz
eclipse.platform.swt-fd48f1038f78b11a089cce1dff82a2e75ba45935.tar.xz
eclipse.platform.swt-fd48f1038f78b11a089cce1dff82a2e75ba45935.zip
Bug 199156 - ExpandBar does not scroll properly
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java
index 336d9cf98c..568421ea3c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java
@@ -560,6 +560,42 @@ void showItem (ExpandItem item) {
layoutItems (index + 1, true);
}
+void showFocus (boolean up) {
+ RECT rect = new RECT();
+ OS.GetClientRect (handle, rect);
+ int height = rect.bottom - rect.top;
+ int updateY = 0;
+ if (up) {
+ if (focusItem.y < 0) {
+ updateY = Math.min (yCurrentScroll, -focusItem.y);
+ }
+ } else {
+ int itemHeight = focusItem.y + getBandHeight ();
+ if (focusItem.expanded) {
+ if (height >= getBandHeight () + focusItem.height) {
+ itemHeight += focusItem.height;
+ }
+ }
+ if (itemHeight > height) {
+ updateY = height - itemHeight;
+ }
+ }
+ if (updateY != 0) {
+ yCurrentScroll = Math.max (0, yCurrentScroll - updateY);
+ if ((style & SWT.V_SCROLL) != 0) {
+ SCROLLINFO info = new SCROLLINFO ();
+ info.cbSize = SCROLLINFO.sizeof;
+ info.fMask = OS.SIF_POS;
+ info.nPos = yCurrentScroll;
+ OS.SetScrollInfo (handle, OS.SB_VERT, info, true);
+ }
+ OS.ScrollWindowEx (handle, 0, updateY, null, null, 0, null, OS.SW_SCROLLCHILDREN | OS.SW_INVALIDATE);
+ for (int i = 0; i < itemCount; i++) {
+ items [i].y += updateY;
+ }
+ }
+}
+
TCHAR windowClass () {
return display.windowClass;
}
@@ -587,6 +623,7 @@ LRESULT WM_KEYDOWN (int /*long*/ wParam, int /*long*/ lParam) {
focusItem.redraw (true);
focusItem = items [focusIndex - 1];
focusItem.redraw (true);
+ showFocus (true);
return LRESULT.ZERO;
}
break;
@@ -597,6 +634,7 @@ LRESULT WM_KEYDOWN (int /*long*/ wParam, int /*long*/ lParam) {
focusItem.redraw (true);
focusItem = items [focusIndex + 1];
focusItem.redraw (true);
+ showFocus (false);
return LRESULT.ZERO;
}
break;

Back to the top