summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/photon
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2002-02-15 23:18:50 +0000
committerSilenio Quarti <silenio>2002-02-15 23:18:50 +0000
commit669aa79bbcd4353e06074577f8637728b10fbac1 (patch)
tree079300c59321ae624f61142357928e0d3d3084fe /bundles/org.eclipse.swt/Eclipse SWT/photon
parent06722a42482c77bd0654d09cae2dfcf35d2371c5 (diff)
downloadeclipse.platform.swt-669aa79bbcd4353e06074577f8637728b10fbac1.tar.gz
eclipse.platform.swt-669aa79bbcd4353e06074577f8637728b10fbac1.tar.xz
eclipse.platform.swt-669aa79bbcd4353e06074577f8637728b10fbac1.zip
computeSize
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/photon')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java30
1 files changed, 18 insertions, 12 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
index d3354a1074..83f85ac45b 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
@@ -155,24 +155,30 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
width = dim.w; height = dim.h;
if (wHint != SWT.DEFAULT || hHint != SWT.DEFAULT) {
int [] args = {
- OS.Pt_ARG_MARGIN_WIDTH, 0, 0, // 1
- OS.Pt_ARG_MARGIN_HEIGHT, 0, 0, // 4
- OS.Pt_ARG_MARGIN_LEFT, 0, 0, // 7
- OS.Pt_ARG_MARGIN_RIGHT, 0, 0, // 10
- OS.Pt_ARG_MARGIN_TOP, 0, 0, // 13
- OS.Pt_ARG_MARGIN_BOTTOM, 0, 0, // 16
+ OS.Pt_ARG_MARGIN_LEFT, 0, 0, // 1
+ OS.Pt_ARG_MARGIN_RIGHT, 0, 0, // 4
+ OS.Pt_ARG_MARGIN_TOP, 0, 0, // 7
+ OS.Pt_ARG_MARGIN_BOTTOM, 0, 0, // 10
+// OS.Pt_ARG_MARGIN_WIDTH, 0, 0, // 13
+// OS.Pt_ARG_MARGIN_HEIGHT, 0, 0, // 16
};
OS.PtGetResources (handle, args.length / 3, args);
- PhRect_t rect = new PhRect_t ();
PhArea_t area = new PhArea_t ();
- rect.lr_x = (short) (wHint - 1);
- rect.lr_y = (short) (hHint - 1);
- OS.PtSetAreaFromWidgetCanvas (handle, rect, area);
+ area.size_w = (short) wHint;
+ area.size_h = (short) hHint;
+
+ /*
+ * This code is intentionally commented. Bug compatible with Windows.
+ */
+// PhRect_t rect = new PhRect_t ();
+// rect.lr_x = (short) (wHint - 1);
+// rect.lr_y = (short) (hHint - 1);
+// OS.PtSetAreaFromWidgetCanvas (handle, rect, area);
if (wHint != SWT.DEFAULT) {
- width = area.size_w + (args [1] * 2) + args [7] + args [10];
+ width = area.size_w + /*(args [13] * 2)*/ + args [1] + args [4];
}
if (hHint != SWT.DEFAULT) {
- height = area.size_h + (args [4] * 2) + args [13] + args [16];
+ height = area.size_h + /*(args [16] * 2)*/ + args [7] + args [10];
}
}
return new Point (width, height);