SWT standalone scroll widget

Is there a way to create a “standalone” scrollbar in SWT? I would like to have a scrollbar in which I have complete control over myself and use it to control the contents of another widget in a way that is not possible with the “built-in” scrollbars in table widgets, for example.

+3
source share
4 answers

I agree that you probably can't get the scroll alone, but I worked with it with Canvas (or ScrolledComposite) and then set the contents of this composite text to the exact same size as ScrolledComposite.getClientArea (). This may require a little tweaking, and you need to make sure that the content component changes with ScrolledComposite, but should be possible.

You can then get the ScrolledComposite scrollbars and use them independently of the ScrolledComposite.

+2
source

, . jni- , , . , , . Draw2D, . FigueCanvas eith a XYLayout ColumnLayout ( , ) .

0

!

ScrolledComposite ScrollBars, setLocation (int, int) , .

If you override this function to really set the location (0,0), the internal control will no longer scroll.

0
source

Source: https://habr.com/ru/post/1721907/


All Articles