Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Custom widget with ScrollBar
Custom widget with ScrollBar [message #451561] Thu, 03 March 2005 06:12 Go to next message
Eclipse UserFriend
Originally posted by: jverano.usinet.org

I'm trying to create a custom widget that paints a list of custom rendered
items. I would like to show a vertical scrollbar (anchored to the right)
that defines the vertical window in which a subset of my custom items are
shown.

I cannot use JFace, GEF, Draw2D, etc and must only use SWT.

How do I do this?
Re: Custom widget with ScrollBar [message #451607 is a reply to message #451561] Thu, 03 March 2005 09:42 Go to previous messageGo to next message
Simone Gianni is currently offline Simone GianniFriend
Messages: 29
Registered: July 2009
Junior Member
Why not implement the computeSize() method of your custom widget and
then wrap it in a ScrolledComposite? That way you hav to do nothing and
obtain also horizontal scrolling. You can also investigate the interface
of Scrollable and try to customize your component behaviour when scrolled.

Simone

Jake Verano wrote:
>
> I'm trying to create a custom widget that paints a list of custom
> rendered items. I would like to show a vertical scrollbar (anchored to
> the right) that defines the vertical window in which a subset of my
> custom items are shown.
>
> I cannot use JFace, GEF, Draw2D, etc and must only use SWT.
>
> How do I do this?
>
Re: Custom widget with ScrollBar [message #451614 is a reply to message #451561] Thu, 03 March 2005 12:05 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Your custom widget should subclass either Canvas or Composite. Create your
custom widget with the style SWT.V_SCROLL and then manage your scrollbar.
Below are some examples.

Scrolling with Canvas:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet48.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup


Scrolling with Composite:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet9.java?rev=HEAD&am p;content-type=text/vnd.viewcvs-markup


"Jake Verano" <jverano@usinet.org> wrote in message
news:d069sf$kfb$1@www.eclipse.org...
>
> I'm trying to create a custom widget that paints a list of custom rendered
> items. I would like to show a vertical scrollbar (anchored to the right)
> that defines the vertical window in which a subset of my custom items are
> shown.
>
> I cannot use JFace, GEF, Draw2D, etc and must only use SWT.
>
> How do I do this?
>
Previous Topic:Getting the index of the checked element?
Next Topic:OleAutomation with Excel
Goto Forum:
  


Current Time: Thu Apr 25 05:29:34 GMT 2024

Powered by FUDForum. Page generated in 0.02681 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top