Is there a way to create a "standalone" scrollbar in SWT? I would like to have a scrollbar which I have full control over myself and use it to control the contents of another widget in a way which isn't possible with the "built-in" scrollbars in the Table widget, for example.
相关问题
- SWT table: how to set/get “focused” row
- Scroll bar not appearing?
- leafletjs adding scrollable pop up?
- How to hide the scroll bar and with the content ra
- ListView in a metro app does not get its vertical
相关文章
- How best to use ViewerFilter on a TreeViewer?
- Remove scrollbar from android support design navig
- Always show scrollbar for ListView
- Deploying an SWT application on Java Webstart
- How do I make it possible to resize a composite by
- python tkinter scrollbar and text widget issues
- Tkinter Canvas & Scrollbar
- how to enable vertical scrollbar of an edittext pr
You can use the SWT
Slider
widget for this purpose. SWT Snippet number 17 for code Example: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet17.javaI agree that you probably can't get a scrollbar alone, but I've worked around that with using a Canvas ( or ScrolledComposite ) and then set the content of that composite to exactly the same size as the ScrolledComposite.getClientArea(). That may require a bit fine tuning and you have to make sure that the content component resizes together with the ScrolledComposite, but should be possible.
You can then get the Scrollbars of the ScrolledComposite and use them independently of the ScrolledComposite.
There is a better solution!
If you use a ScrolledComposite and use the ScrollBars, the setLocation(int,int) function is called of the internal control to adjust it to the scrollbar position.
If you override this function to really set the location to (0,0), the internal control will not be scrolled anymore.
No, I don't think so. If you look at the jni call for the table, you'll see that it's just a flag into the native call. I'm pretty sure that you can't do what you ask. You could however use Draw2D to get this done fairly quickly. Create a
FigueCanvas
with eith anXYLayout
or aColumnLayout
(I think that's what it's called) and off you go.