Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Custom widget with ScrollBar
Custom widget with ScrollBar [message #451561] Thu, 03 March 2005 01: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 04:42 Go to previous messageGo to next message
Eclipse UserFriend
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 07:05 Go to previous message
Eclipse UserFriend
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: Tue Jul 01 05:33:04 EDT 2025

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

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

Back to the top