|
Re: Scrollable views [message #466193 is a reply to message #466156] |
Wed, 04 January 2006 19:06 |
Luis Reyes Messages: 14 Registered: July 2009 |
Junior Member |
|
|
in the createCrontol() change the parent to a scrollcomposite. create a
regular composite, and set the scroll composite to listen for changes in
composite. use the regular composite to draw everything on it.
EXAMPLE
public void createPartControl(Composite parent) {
new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
Composite container = new Composite(scrolledComposite, SWT.NONE);
ScrolledComposite scrolledComposite;
scrolledComposite.setExpandVertical(true);
scrolledComposite.setExpandHorizontal(true);
/*set the size, that when the view is this size,
the scrollbars should appear
NOTE: the next two lines are only use if expand
horizontal or vertical are used.*/
scrolledComposite.setMinHeight(600);
scrolledComposite.setMinWidth(350);
/*now we need to the tell the scrollbarcontainer
* to listen for changes in the size of container
* NOTE:if you call this method before setting the
* above params, the widget will not show, until after
* the view is manually resized by the user*/
scrolledComposite.setContent(container);
Button button = new Button(container, SWT.NONE);
button.setText("Test Button");
..
....
......
you get the idea, i guess. Good luck.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03313 seconds