Scrollbars in Composite? [message #79519] |
Thu, 27 March 2008 13:16  |
Eclipse User |
|
|
|
Hi,
I'm trying to implement a console view where text can be appended, but
the Composite.getVerticalBar() method seems to be missing from RAP. Any
ideas?
Thanks,
Mike
|
|
|
|
|
Re: Scrollbars in Composite? [message #80214 is a reply to message #79654] |
Mon, 31 March 2008 05:46   |
Eclipse User |
|
|
|
Thanks, I've tried to wrap the Text widget in a ScrolledComposite and it
looks fine but I have no control over the scroll bars e.g.
scroller.getVerticalBar().setOrigin() has no effect. My code for setting
it up is as follows:
public void createPartControl(Composite parent) {
parent.setLayout(new FillLayout());
scroller = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
console = new Text(scroller, SWT.WRAP);
scroller.setContent(console);
scroller.setExpandHorizontal(true);
scroller.setExpandVertical(true);
}
Frank Appel wrote:
> Hi,
>
> unfortunately this is not available from the current Composite
> implementation. Feel free to file a feature request. One thing I could
> think of is to use the ScrolledComposite since this implements
> getVerticalBar() but I don't know whether this fits your needs, though.
>
>
> Ciao
> Frank
>
>
> -----Ursprüngliche Nachricht-----
> Von: Mike Wrighton [mailto:mike.wrighton@googlemail.com]
> Bereitgestellt: Donnerstag, 27. März 2008 18:17
> Bereitgestellt in: eclipse.technology.rap
> Unterhaltung: Scrollbars in Composite?
> Betreff: Scrollbars in Composite?
>
>
> Hi,
>
> I'm trying to implement a console view where text can be appended, but
> the Composite.getVerticalBar() method seems to be missing from RAP. Any
> ideas?
>
> Thanks,
> Mike
>
|
|
|
Re: Scrollbars in Composite? [message #80257 is a reply to message #80214] |
Mon, 31 March 2008 07:21  |
Eclipse User |
|
|
|
Originally posted by: rherrmann.innoopract.com
Hi Mike,
the getVerticalBar#setOrigin method isn't implemented yet. I guess
you tried ScrolledComposite#setOrigin(x,y).
I did some investigations with code, based your snippet, but also
couldn't get it to do what I wanted to.
parent.setLayout( new FillLayout() );
scroller = new ScrolledComposite( parent, SWT.H_SCROLL
| SWT.V_SCROLL );
scroller.addControlListener( new ControlAdapter() {
public void controlResized( ControlEvent e ) {
Rectangle parentBounds = scroller.getClientArea();
scroller.setMinSize( parent.computeSize( parentBounds.width,
SWT.DEFAULT ) );
}
} );
console = new Text( scroller, SWT.WRAP );
String text = "";
for( int i = 0; i < 400; i++ ) {
text += "line" + i + "\n";
}
console.setText( text );
scroller.setContent( console );
scroller.setExpandHorizontal( true );
scroller.setExpandVertical( true );
scroller.setOrigin( 0, 200 );
The setOrigin() call seems to be ignored at all, and the text widget
starts to scroll by itself from time to time, but I haven't had the
time to dig deeper into this.
I you have a snippet that works properly on SWT, but doesn't do its
job in RAP, feel free to file a bug.
Cheers,
Rüdiger
Mike Wrighton wrote:
> Thanks, I've tried to wrap the Text widget in a ScrolledComposite and it
> looks fine but I have no control over the scroll bars e.g.
> scroller.getVerticalBar().setOrigin() has no effect. My code for setting
> it up is as follows:
>
> public void createPartControl(Composite parent) {
> parent.setLayout(new FillLayout());
> scroller = new ScrolledComposite(parent, SWT.H_SCROLL |
> SWT.V_SCROLL);
> console = new Text(scroller, SWT.WRAP);
> scroller.setContent(console);
> scroller.setExpandHorizontal(true);
> scroller.setExpandVertical(true);
> }
>
>
>
> Frank Appel wrote:
>> Hi,
>>
>> unfortunately this is not available from the current Composite
>> implementation. Feel free to file a feature request. One thing I could
>> think of is to use the ScrolledComposite since this implements
>> getVerticalBar() but I don't know whether this fits your needs, though.
>>
>>
>> Ciao
>> Frank
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Mike Wrighton [mailto:mike.wrighton@googlemail.com]
>> Bereitgestellt: Donnerstag, 27. März 2008 18:17
>> Bereitgestellt in: eclipse.technology.rap
>> Unterhaltung: Scrollbars in Composite?
>> Betreff: Scrollbars in Composite?
>>
>>
>> Hi,
>>
>> I'm trying to implement a console view where text can be appended, but
>> the Composite.getVerticalBar() method seems to be missing from RAP. Any
>> ideas?
>>
>> Thanks,
>> Mike
>>
|
|
|
Powered by
FUDForum. Page generated in 0.05823 seconds