java.lang.Object | +--org.eclipse.swt.widgets.Widget | +--org.eclipse.swt.widgets.Control | +--org.eclipse.swt.widgets.Slider
Safe: Instances of this class are selectable user interface objects that represent a range of positive, numeric values.
At any given moment, a given slider will have a single selection that is considered to be its value, which is constrained to be within the range of values the slider represents (that is, between its minimum and maximum values).
Typically, sliders will be made up of five areas:
HORIZONTAL
(which have a left facing button for decrementing the value and a
right facing button for incrementing it) or VERTICAL
(which have an upward facing button for decrementing the value
and a downward facing buttons for incrementing it).
On some platforms, the size of the slider's thumb can be varied relative to the magnitude of the range of values it represents (that is, relative to the difference between its maximum and minimum values). Typically, this is used to indicate some proportional value such as the ratio of the visible area of a document to the total amount of space that it would take to display it. SWT supports setting the thumb size even if the underlying platform does not, but in this case the appearance of the slider will not change.
Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
IMPORTANT: This class is not intended to be subclassed.
ScrollBarACCENTS, accessible, background, drawCount, foreground, handle, hCursor, layoutData, menu, parent, toolTipText
CANVAS, COMCTL32_MAJOR, COMCTL32_MINOR, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, DISPOSED, eventTable, HIDDEN, keys, MAJOR, MINOR, Mnemonic, state, style, values
Slider(Composite parent,
int style)
void
addSelectionListener(SelectionListener listener)
SelectionListener
interface.
int
getIncrement()
int
getPageIncrement()
int
getThumb()
void
removeSelectionListener(SelectionListener listener)
void
setIncrement(int value)
void
setMaximum(int value)
void
setMinimum(int value)
void
setPageIncrement(int value)
void
setSelection(int value)
void
setThumb(int value)
void
setValues(int selection,
int minimum,
int maximum,
int thumb,
int increment,
int pageIncrement)
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, checkOrientation, computeSize, computeTabGroup, computeTabList, computeTabRoot, createHandle, defaultFont, deregister, destroyWidget, drawBackground, drawBackground, findBrush, findCursor, findMnemonic, fixFocus, forceFocus, forceResize, getAccessible, getBackground, getBackgroundPixel, getBorderWidth, getBounds, getCodePage, getDisplay, getFont, getForeground, getForegroundPixel, getLayoutData, getLocation, getMenu, getParent, getPath, getShell, getSize, getToolTipText, getVisible, hasCursor, hasFocus, internal_dispose_GC, internal_new_GC, isActive, isDisposed, isEnabled, isFocusAncestor, isFocusControl, isReparentable, isShowing, isTabGroup, isTabItem, isVisible, menuShell, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, new_Accessible, pack, pack, redraw, redraw, register, releaseHandle, releaseWidget, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, setBackground, setBackgroundPixel, setBounds, setBounds, setCapture, setCursor, setDefaultFont, setFocus, setFont, setForeground, setForegroundPixel, setLayoutData, setLocation, setLocation, setMenu, setParent, setRadioFocus, setRadioSelection, setRedraw, setSavedFocus, setSize, setSize, setTabGroupFocus, setTabItemFocus, setToolTipText, setVisible, sort, subclass, toControl, toControl, toDisplay, toDisplay, transferActive, transferFocus, translateAccelerator, translateMnemonic, translateMnemonic, translateTraversal, traverse, traverse, traverseEscape, traverseGroup, traverseItem, traverseMnemonic, traversePage, traverseReturn, unsubclass, update, update, updateFont, windowProc, WM_ACTIVATE, WM_CHAR, WM_CLEAR, WM_CLOSE, WM_COMMAND, WM_CONTEXTMENU, WM_CTLCOLOR, WM_CUT, WM_DESTROY, WM_DRAWITEM, WM_ENDSESSION, WM_ERASEBKGND, WM_GETDLGCODE, WM_GETFONT, WM_GETOBJECT, WM_HELP, WM_HOTKEY, WM_HSCROLL, WM_IME_CHAR, WM_IME_COMPOSITION, WM_INITMENUPOPUP, WM_KEYDOWN, WM_KEYUP, WM_KILLFOCUS, WM_LBUTTONUP, WM_MBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MEASUREITEM, WM_MENUCHAR, WM_MENUSELECT, WM_MOUSEACTIVATE, WM_MOUSEHOVER, WM_MOUSELEAVE, WM_MOUSEMOVE, WM_MOUSEWHEEL, WM_MOVE, WM_NCACTIVATE, WM_NCCALCSIZE, WM_NCHITTEST, WM_NOTIFY, WM_PAINT, WM_PALETTECHANGED, WM_PASTE, WM_PRINTCLIENT, WM_QUERYENDSESSION, WM_QUERYNEWPALETTE, WM_QUERYOPEN, WM_RBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SETCURSOR, WM_SETFOCUS, WM_SETFONT, WM_SETREDRAW, WM_SETTINGCHANGE, WM_SHOWWINDOW, WM_SIZE, WM_SYSCHAR, WM_SYSCOLORCHANGE, WM_SYSCOMMAND, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_TIMER, WM_UNDO, WM_VSCROLL, WM_WINDOWPOSCHANGING, wmColorChild, wmCommandChild, wmDrawChild, wmMeasureChild, wmNotifyChild
addDisposeListener, addListener, checkBits, checkParent, checkSubclass, checkWidget, dispose, error, filters, getData, getData, getName, getNameText, getStyle, hooks, isListening, isValidSubclass, isValidThread, mbcsToWcs, mbcsToWcs, notifyListeners, postEvent, postEvent, releaseChild, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, toString, wcsToMbcs, wcsToMbcs
int increment
int pageIncrement
static final int ScrollBarProc
static final org.eclipse.swt.internal.win32.TCHAR ScrollBarClass
public Slider(Composite parent, int style)
The style value is either one of the style constants defined in
class SWT which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int "|" operator) two or more
of those SWT style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent - a composite control which will be the parent of the new instance (cannot be null)style - the style of control to constructSWT.HORIZONTAL,
SWT.VERTICAL,
Widget.checkSubclass(),
Widget.getStyle()public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
When widgetSelected is called, the event object detail field contains one of the following values:
0 - for the end of a drag.
SWT.DRAG.
SWT.HOME.
SWT.END.
SWT.ARROW_DOWN.
SWT.ARROW_UP.
SWT.PAGE_DOWN.
SWT.PAGE_UP.
widgetDefaultSelected is not called.
listener - the listener which should be notifiedSelectionListener,
removeSelectionListener(org.eclipse.swt.events.SelectionListener),
SelectionEventint callWindowProc(int msg, int wParam, int lParam)
callWindowProc in class Controlstatic int checkStyle(int style)
public Point computeSize(int wHint, int hHint, boolean changed)
computeSize in class ControlwHint - the width hint (can be SWT.DEFAULT)hHint - the height hint (can be SWT.DEFAULT)changed - true if the control's contents have changed, and false otherwise
Layout,
Control.getBorderWidth(),
Control.getBounds(),
Control.getSize(),
Control.pack(),
"computeTrim, getClientArea for controls that implement them"void createWidget()
createWidget in class Controlint defaultBackground()
defaultBackground in class Controlint defaultForeground()
defaultForeground in class Controlpublic boolean getEnabled()
getEnabled in class ControlControl.isEnabled()public int getIncrement()
public int getMaximum()
public int getMinimum()
public int getPageIncrement()
public int getSelection()
public int getThumb()
public void removeSelectionListener(SelectionListener listener)
listener - the listener which should no longer be notifiedSelectionListener,
addSelectionListener(org.eclipse.swt.events.SelectionListener)void setBounds(int x, int y, int width, int height, int flags)
public void setEnabled(boolean enabled)
setEnabled in class Controlenabled - the new enabled statepublic void setIncrement(int value)
value - the new increment (must be greater than zero)public void setMaximum(int value)
value - the new maximum (must be zero or greater)public void setMinimum(int value)
value - the new minimum (must be zero or greater)public void setPageIncrement(int value)
public void setSelection(int value)
value - the new selection (must be zero or greater)public void setThumb(int value)
value - the new thumb value (must be at least one)ScrollBarpublic void setValues(int selection, int minimum, int maximum, int thumb, int increment, int pageIncrement)
Note: This is equivalent to setting the values individually using the appropriate methods, but may be implemented in a more efficient fashion on some platforms.
selection - the new selection valueminimum - the new minimum valuemaximum - the new maximum valuethumb - the new thumb valueincrement - the new increment valuepageIncrement - the new pageIncrement valueint widgetExtStyle()
widgetExtStyle in class Controlint widgetStyle()
widgetStyle in class Controlorg.eclipse.swt.internal.win32.TCHAR windowClass()
windowClass in class Controlint windowProc()
windowProc in class Controlorg.eclipse.swt.internal.win32.LRESULT WM_LBUTTONDBLCLK(int wParam, int lParam)
WM_LBUTTONDBLCLK in class Controlorg.eclipse.swt.internal.win32.LRESULT WM_LBUTTONDOWN(int wParam, int lParam)
WM_LBUTTONDOWN in class Controlorg.eclipse.swt.internal.win32.LRESULT wmScrollChild(int wParam, int lParam)
wmScrollChild in class Control