Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Slider, Scrollbar(Problems in SWT)
Slider, Scrollbar [message #1701349] Sun, 12 July 2015 11:31 Go to next message
Andrzej Borucki is currently offline Andrzej BoruckiFriend
Messages: 13
Registered: August 2013
Junior Member
I do
        Slider slider = new Slider (shell, SWT.HORIZONTAL);
	Rectangle clientArea = shell.getClientArea ();
	slider.setBounds (clientArea.x + 30, clientArea.y + 30, 200, 32);

I see only square thumb, left and right arrow, but not see bar. I want, thumb should be narrow, narrowing at bottom at point to bar where maybe was graduation.

I try scrollbar
	Scrollbar scrollbar = new Scrollbar (Scrollbar.HORIZONTAL);
	Rectangle clientArea = shell.getClientArea ();
	scrollbar.setBounds (clientArea.x + 30, clientArea.y + 30, 200, 32);

But in internet samples scrollbar is get only from compound object, not created.
For example
ScrollBar vbar=scomp.getVerticalBar()

http://www.programcreek.com/java-api-examples/index.php?api=org.eclipse.swt.widgets.ScrollBar

I want do two things: one is bar with slider to points position in playback.
Second is drawing area with scrollbars which can be repaint by me if scrollbars moved.
Re: Slider, Scrollbar [message #1701472 is a reply to message #1701349] Mon, 13 July 2015 14:51 Go to previous message
Eclipse UserFriend
For your playback scrubber, I think you want a Scale. You'll likely want to eventually build your own custom widget.

For the drawing area, you can use a Canvas with H_SCROLL and V_SCROLL.

The Slider's thumb is automatically sized based on the gap between and increment. We don't have control over the size.

ScrollBars are created to wrap the sliders in existing native components; they aren't created programmatically.

Hope that helps.

Brian.
Previous Topic:Label with WRAP causes WizardPage to grab all the vertical screen space (Mac/Windows incomatibility)
Next Topic:StyleRange Persistence
Goto Forum:
  


Current Time: Tue Mar 19 10:21:57 GMT 2024

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

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

Back to the top