diff options
author | Silenio Quarti | 2002-02-15 17:23:23 +0000 |
---|---|---|
committer | Silenio Quarti | 2002-02-15 17:23:23 +0000 |
commit | ed14b21fb9a158afaf8778b900fb426d9a5bc9ea (patch) | |
tree | 171f9f9db833e1415cd2ac5a7a70aa54ab1940b1 | |
parent | 43f1ad48453b5f9a5daf71f87f8d8e7938e20f82 (diff) | |
download | eclipse.platform.swt-ed14b21fb9a158afaf8778b900fb426d9a5bc9ea.tar.gz eclipse.platform.swt-ed14b21fb9a158afaf8778b900fb426d9a5bc9ea.tar.xz eclipse.platform.swt-ed14b21fb9a158afaf8778b900fb426d9a5bc9ea.zip |
*** empty log message ***
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java | 12 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Slider.java | 8 |
2 files changed, 16 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java index aa4397edf8..db6841f47b 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java @@ -96,7 +96,16 @@ public Point computeSize (int wHint, int hHint, boolean changed) { PhDim_t dim = new PhDim_t();
if (!OS.PtWidgetIsRealized (handle)) OS.PtExtentWidget (handle);
OS.PtWidgetPreferredSize(handle, dim);
- int width = dim.w * 7; int height = dim.h;
+ /*
+ * Feature in Photon. The preferred size of PtSlider is only the
+ * handle size. Add extra space for the rest.
+ */
+ int width, height;
+ if ((style & SWT.HORIZONTAL) != 0) {
+ width = dim.w * 7; height = dim.h * 2;
+ } else {
+ width = dim.w * 2; height = dim.h * 7;
+ }
if (wHint != SWT.DEFAULT || hHint != SWT.DEFAULT) {
PhRect_t rect = new PhRect_t ();
PhArea_t area = new PhArea_t ();
@@ -216,6 +225,7 @@ public int getSelection () { }
void hookEvents () {
+ super.hookEvents ();
int windowProc = getDisplay ().windowProc;
OS.PtAddCallback (handle, OS.Pt_CB_SLIDER_MOVE, windowProc, SWT.Selection);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Slider.java index 5cb9b2cdf2..d88bef3337 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Slider.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Slider.java @@ -135,10 +135,11 @@ public void addSelectionListener (SelectionListener listener) { public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
- //NOT DONE - hard coding value to be the same as list's scrollbars
- int width = 17, height = 100;
+ Display display = getDisplay ();
+ int border = getBorderWidth () * 2;
+ int width = display.SCROLLBAR_WIDTH + border, height = width * 5;
if ((style & SWT.HORIZONTAL) != 0) {
- width = 100; height = 17;
+ height = display.SCROLLBAR_HEIGHT + border; width = height * 5;
}
if (wHint != SWT.DEFAULT || hHint != SWT.DEFAULT) {
PhRect_t rect = new PhRect_t ();
@@ -282,6 +283,7 @@ public int getThumb () { return args [1];
}
void hookEvents () {
+ super.hookEvents ();
int windowProc = getDisplay ().windowProc;
OS.PtAddCallback (handle, OS.Pt_CB_SCROLL_MOVE, windowProc, SWT.Selection);
}
|