Bug 4462 - ScrollBar - vbar.setMaximum does not work after hbar is hidden (and vice versa) (1FIG5CG)
Summary: ScrollBar - vbar.setMaximum does not work after hbar is hidden (and vice vers...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P4 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-11 14:17 EDT by Knut Radloff CLA
Modified: 2002-03-07 10:30 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Knut Radloff CLA 2001-10-11 14:17:11 EDT
Execute the following code:

Shell shell = new Shell(SWT.MENU | SWT.RESIZE | SWT.TITLE | SWT.V_SCROLL | SWT.H_SCROLL);
ScrollBar hbar = shell.getHorizontalBar();
ScrollBar vbar = shell.getVerticalBar();

hbar.setMaximum(0);
System.out.println("hbar.getMaximum() " + hbar.getMaximum());
hbar.setVisible(false);	// comment out this line and vbar.setMaximum works

vbar.setMaximum(0);		// this call has no effect
System.out.println("vbar.getMaximum() " + vbar.getMaximum());
vbar.setMaximum(0);		// second call works
System.out.println("vbar.getMaximum() " + vbar.getMaximum());


The first call to vbar.setMaximum(0) has no effect unless the horizontal scroll bar is visible.

NOTES:

	McQ (29/11/2000 10:10:36 AM) -
		Not sure what's going on here. If it's an o/s limitation, you're probably just stuck.
		If it's something we are doing wrong, then we should fix it. SN to investigate.
Comment 1 DJ Houghton CLA 2001-10-29 16:15:13 EST
PRODUCT VERSION:
swt 0.29

Comment 2 Steve Northover CLA 2001-12-20 13:35:53 EST
No longer appears to be happening.  KR, can you confirm?  Here is the code that 
I'm using:

package steve;

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

public class PR_4462 {

public static void main(String arguments[]) {
Shell shell = new Shell(SWT.MENU | SWT.RESIZE | SWT.TITLE | SWT.V_SCROLL | 
SWT.H_SCROLL);
ScrollBar hbar = shell.getHorizontalBar();
ScrollBar vbar = shell.getVerticalBar();
hbar.setMaximum(25);
System.out.println("hbar.getMaximum() " + hbar.getMaximum());
hbar.setVisible(false);	// comment out this line and vbar.setMaximum works
vbar.setMaximum(50);		// this call has no effect
System.out.println("vbar.getMaximum() " + vbar.getMaximum());
vbar.setMaximum(33);		// second call works
System.out.println("vbar.getMaximum() " + vbar.getMaximum());
}


}
Comment 3 Knut Radloff CLA 2001-12-21 09:52:46 EST
Verified fixed
Comment 4 Steve Northover CLA 2002-01-02 11:59:56 EST
Verified by KR.