summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2006-03-10 19:02:42 +0000
committerFelipe Heidrich <fheidric>2006-03-10 19:02:42 +0000
commitf520a8dcf7987a68442ef89495b4518db5c9b2f5 (patch)
tree89dd969b9f1419fcc5408c169c155c65f16cfe3c /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java
parentf583b5839f2635fb53b19da7580dac5cb0826fec (diff)
downloadeclipse.platform.swt-f520a8dcf7987a68442ef89495b4518db5c9b2f5.tar.gz
eclipse.platform.swt-f520a8dcf7987a68442ef89495b4518db5c9b2f5.tar.xz
eclipse.platform.swt-f520a8dcf7987a68442ef89495b4518db5c9b2f5.zip
always use high level api to assure multiple handle widgets also work
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java22
1 files changed, 10 insertions, 12 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java
index 2e41919f64..3cbc725058 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandItem.java
@@ -376,30 +376,28 @@ void releaseWidget () {
void setBounds (int x, int y, int width, int height, boolean move, boolean size) {
redraw (true);
int headerHeight = ExpandBar.HEADER_HEIGHT;
- int flags = OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE | OS.SWP_NOSIZE | OS.SWP_NOMOVE;
if (move) {
if (imageHeight > headerHeight) {
y += (imageHeight - headerHeight);
}
this.x = x;
this.y = y;
- flags &= ~OS.SWP_NOMOVE;
redraw (true);
}
if (size) {
this.width = width;
this.height = height;
- flags &= ~OS.SWP_NOSIZE;
redraw (true);
}
if (control != null && !control.isDisposed ()) {
- int hwnd = control.handle;
if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) {
x += BORDER;
width = Math.max (0, width - BORDER * 2);
height = Math.max (0, height - BORDER);
}
- SetWindowPos (hwnd, 0, x, y + headerHeight, width, height, flags);
+ if (move && size) control.setBounds (x, y + headerHeight, width, height);
+ if (move && !size) control.setLocation (x, y + headerHeight);
+ if (!move && size) control.setSize (width, height);
}
}
@@ -425,15 +423,15 @@ public void setControl (Control control) {
}
this.control = control;
if (control != null) {
- int hwnd = control.handle;
- OS.ShowWindow (hwnd, expanded ? OS.SW_SHOW : OS.SW_HIDE);
- int flags = OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE;
+ int headerHeight = ExpandBar.HEADER_HEIGHT;
+ control.setVisible (expanded);
if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) {
- x += BORDER;
- width = Math.max (0, width - BORDER * 2);
- height = Math.max (0, height - BORDER);
+ int width = Math.max (0, this.width - BORDER * 2);
+ int height = Math.max (0, this.height - BORDER);
+ control.setBounds (x + BORDER, y + headerHeight, width, height);
+ } else {
+ control.setBounds (x, y + headerHeight, width, height);
}
- SetWindowPos (hwnd, 0, x, y + ExpandBar.HEADER_HEIGHT, width, height, flags);
}
}