public abstract class Control extends Widget implements Drawable
Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified.
IMPORTANT: This class is intended to be subclassed only within the SWT implementation.
Modifier and Type | Field and Description |
---|---|
(package private) Accessible |
accessible |
(package private) int |
background |
(package private) Image |
backgroundImage |
(package private) Cursor |
cursor |
(package private) int |
drawCount |
(package private) Font |
font |
(package private) int |
foreground |
int |
handle
the handle to the OS resource
(Warning: This field is platform dependent)
IMPORTANT: This field is not part of the SWT
public API.
|
(package private) java.lang.Object |
layoutData |
(package private) Menu |
menu |
(package private) Composite |
parent |
(package private) Region |
region |
(package private) java.lang.String |
toolTipText |
CANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE
Constructor and Description |
---|
Control()
Prevents uninitialized instances from being created outside the package.
|
Control(Composite parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
void |
addControlListener(ControlListener listener)
Adds the listener to the collection of listeners who will
be notified when the control is moved or resized, by sending
it one of the messages defined in the
ControlListener
interface. |
void |
addDragDetectListener(DragDetectListener listener)
Adds the listener to the collection of listeners who will
be notified when a drag gesture occurs, by sending it
one of the messages defined in the
DragDetectListener
interface. |
void |
addFocusListener(FocusListener listener)
Adds the listener to the collection of listeners who will
be notified when the control gains or loses focus, by sending
it one of the messages defined in the
FocusListener
interface. |
void |
addGestureListener(GestureListener listener)
Adds the listener to the collection of listeners who will
be notified when gesture events are generated for the control,
by sending it one of the messages defined in the
GestureListener interface. |
void |
addHelpListener(HelpListener listener)
Adds the listener to the collection of listeners who will
be notified when help events are generated for the control,
by sending it one of the messages defined in the
HelpListener interface. |
void |
addKeyListener(KeyListener listener)
Adds the listener to the collection of listeners who will
be notified when keys are pressed and released on the system keyboard, by sending
it one of the messages defined in the
KeyListener
interface. |
void |
addMenuDetectListener(MenuDetectListener listener)
Adds the listener to the collection of listeners who will
be notified when the platform-specific context menu trigger
has occurred, by sending it one of the messages defined in
the
MenuDetectListener interface. |
void |
addMouseListener(MouseListener listener)
Adds the listener to the collection of listeners who will
be notified when mouse buttons are pressed and released, by sending
it one of the messages defined in the
MouseListener
interface. |
void |
addMouseMoveListener(MouseMoveListener listener)
Adds the listener to the collection of listeners who will
be notified when the mouse moves, by sending it one of the
messages defined in the
MouseMoveListener
interface. |
void |
addMouseTrackListener(MouseTrackListener listener)
Adds the listener to the collection of listeners who will
be notified when the mouse passes or hovers over controls, by sending
it one of the messages defined in the
MouseTrackListener
interface. |
void |
addMouseWheelListener(MouseWheelListener listener)
Adds the listener to the collection of listeners who will
be notified when the mouse wheel is scrolled, by sending
it one of the messages defined in the
MouseWheelListener interface. |
void |
addPaintListener(PaintListener listener)
Adds the listener to the collection of listeners who will
be notified when the receiver needs to be painted, by sending it
one of the messages defined in the
PaintListener
interface. |
void |
addTouchListener(TouchListener listener)
Adds the listener to the collection of listeners who will
be notified when touch events occur, by sending it
one of the messages defined in the
TouchListener
interface. |
void |
addTraverseListener(TraverseListener listener)
Adds the listener to the collection of listeners who will
be notified when traversal events occur, by sending it
one of the messages defined in the
TraverseListener
interface. |
(package private) int |
binarySearch(int[] indices,
int start,
int end,
int index) |
(package private) int |
borderHandle() |
(package private) void |
checkBackground() |
(package private) void |
checkBorder() |
(package private) void |
checkBuffered() |
(package private) void |
checkComposited() |
(package private) void |
checkGesture() |
(package private) boolean |
checkHandle(int hwnd) |
(package private) void |
checkMirrored() |
Point |
computeSize(int wHint,
int hHint)
Returns the preferred size of the receiver.
|
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Returns the preferred size of the receiver.
|
(package private) Widget |
computeTabGroup() |
(package private) Widget[] |
computeTabList() |
(package private) Control |
computeTabRoot() |
(package private) void |
createHandle() |
(package private) void |
createWidget() |
(package private) int |
defaultBackground() |
(package private) int |
defaultFont() |
(package private) int |
defaultForeground() |
(package private) void |
deregister() |
(package private) void |
destroyWidget()
Destroys the widget in the operating system and releases
the widget's handle.
|
boolean |
dragDetect(Event event)
Detects a drag and drop gesture.
|
(package private) boolean |
dragDetect(int button,
int count,
int stateMask,
int x,
int y) |
boolean |
dragDetect(MouseEvent event)
Detects a drag and drop gesture.
|
(package private) void |
drawBackground(int hDC) |
(package private) void |
drawBackground(int hDC,
RECT rect) |
(package private) void |
drawBackground(int hDC,
RECT rect,
int pixel,
int tx,
int ty) |
(package private) void |
drawImageBackground(int hDC,
int hwnd,
int hBitmap,
RECT rect,
int tx,
int ty) |
(package private) void |
drawThemeBackground(int hDC,
int hwnd,
RECT rect) |
(package private) void |
enableDrag(boolean enabled) |
(package private) void |
enableWidget(boolean enabled) |
(package private) void |
fillBackground(int hDC,
int pixel,
RECT rect) |
(package private) void |
fillImageBackground(int hDC,
Control control,
RECT rect,
int tx,
int ty) |
(package private) void |
fillThemeBackground(int hDC,
Control control,
RECT rect) |
(package private) Control |
findBackgroundControl() |
(package private) int |
findBrush(int value,
int lbStyle) |
(package private) Cursor |
findCursor() |
(package private) Control |
findImageControl() |
(package private) Menu[] |
findMenus(Control control) |
(package private) char |
findMnemonic(java.lang.String string) |
(package private) Control |
findThemeControl() |
(package private) void |
fixChildren(Shell newShell,
Shell oldShell,
Decorations newDecorations,
Decorations oldDecorations,
Menu[] menus) |
(package private) void |
fixFocus(Control focusControl) |
boolean |
forceFocus()
Forces the receiver to have the keyboard focus, causing
all keyboard events to be delivered to it.
|
(package private) void |
forceResize() |
Accessible |
getAccessible()
Returns the accessible object for the receiver.
|
Color |
getBackground()
Returns the receiver's background color.
|
Image |
getBackgroundImage()
Returns the receiver's background image.
|
(package private) int |
getBackgroundPixel() |
int |
getBorderWidth()
Returns the receiver's border width.
|
Rectangle |
getBounds()
Returns a rectangle describing the receiver's size and location
relative to its parent (or its display if its parent is null),
unless the receiver is a shell.
|
(package private) java.lang.String |
getClipboardText() |
(package private) int |
getCodePage() |
Cursor |
getCursor()
Returns the receiver's cursor, or null if it has not been set.
|
boolean |
getDragDetect()
Returns
true if the receiver is detecting
drag gestures, and false otherwise. |
(package private) boolean |
getDrawing() |
boolean |
getEnabled()
Returns
true if the receiver is enabled, and
false otherwise. |
Font |
getFont()
Returns the font that the receiver will use to paint textual information.
|
Color |
getForeground()
Returns the foreground color that the receiver will use to draw.
|
(package private) int |
getForegroundPixel() |
java.lang.Object |
getLayoutData()
Returns layout data which is associated with the receiver.
|
Point |
getLocation()
Returns a point describing the receiver's location relative
to its parent (or its display if its parent is null), unless
the receiver is a shell.
|
Menu |
getMenu()
Returns the receiver's pop up menu if it has one, or null
if it does not.
|
Monitor |
getMonitor()
Returns the receiver's monitor.
|
int |
getOrientation()
Returns the orientation of the receiver, which will be one of the
constants
SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT . |
Composite |
getParent()
Returns the receiver's parent, which must be a
Composite
or null when the receiver is a shell that was created with null or
a display for a parent. |
(package private) Control[] |
getPath() |
Region |
getRegion()
Returns the region that defines the shape of the control,
or null if the control has the default shape.
|
Shell |
getShell()
Returns the receiver's shell.
|
Point |
getSize()
Returns a point describing the receiver's size.
|
java.lang.String |
getToolTipText()
Returns the receiver's tool tip text, or null if it has
not been set.
|
boolean |
getTouchEnabled()
Returns
true if this control is set to send touch events, or
false if it is set to send gesture events instead. |
boolean |
getVisible()
Returns
true if the receiver is visible, and
false otherwise. |
(package private) boolean |
hasCursor() |
(package private) boolean |
hasFocus() |
void |
internal_dispose_GC(int hDC,
GCData data)
Invokes platform specific functionality to dispose a GC handle.
|
int |
internal_new_GC(GCData data)
Invokes platform specific functionality to allocate a new GC handle.
|
(package private) boolean |
isActive() |
boolean |
isEnabled()
Returns
true if the receiver is enabled and all
ancestors up to and including the receiver's nearest ancestor
shell are enabled. |
(package private) boolean |
isFocusAncestor(Control control) |
boolean |
isFocusControl()
Returns
true if the receiver has the user-interface
focus, and false otherwise. |
boolean |
isReparentable()
Returns
true if the underlying operating
system supports this reparenting, otherwise false |
(package private) boolean |
isShowing() |
(package private) boolean |
isTabGroup() |
(package private) boolean |
isTabItem() |
boolean |
isVisible()
Returns
true if the receiver is visible and all
ancestors up to and including the receiver's nearest ancestor
shell are visible. |
(package private) void |
mapEvent(int hwnd,
Event event) |
(package private) void |
markLayout(boolean changed,
boolean all) |
(package private) Decorations |
menuShell() |
(package private) boolean |
mnemonicHit(char key) |
(package private) boolean |
mnemonicMatch(char key) |
void |
moveAbove(Control control)
Moves the receiver above the specified control in the
drawing order.
|
void |
moveBelow(Control control)
Moves the receiver below the specified control in the
drawing order.
|
(package private) Accessible |
new_Accessible(Control control) |
(package private) GC |
new_GC(GCData data) |
void |
pack()
Causes the receiver to be resized to its preferred size.
|
void |
pack(boolean changed)
Causes the receiver to be resized to its preferred size.
|
boolean |
print(GC gc)
Prints the receiver and all children.
|
(package private) void |
printWidget(int hwnd,
int hdc,
GC gc) |
void |
redraw()
Causes the entire bounds of the receiver to be marked
as needing to be redrawn.
|
(package private) void |
redraw(boolean all) |
void |
redraw(int x,
int y,
int width,
int height,
boolean all)
Causes the rectangular area of the receiver specified by
the arguments to be marked as needing to be redrawn.
|
(package private) boolean |
redrawChildren() |
(package private) void |
register() |
(package private) void |
releaseHandle() |
(package private) void |
releaseParent() |
(package private) void |
releaseWidget() |
void |
removeControlListener(ControlListener listener)
Removes the listener from the collection of listeners who will
be notified when the control is moved or resized.
|
void |
removeDragDetectListener(DragDetectListener listener)
Removes the listener from the collection of listeners who will
be notified when a drag gesture occurs.
|
void |
removeFocusListener(FocusListener listener)
Removes the listener from the collection of listeners who will
be notified when the control gains or loses focus.
|
void |
removeGestureListener(GestureListener listener)
Removes the listener from the collection of listeners who will
be notified when gesture events are generated for the control.
|
void |
removeHelpListener(HelpListener listener)
Removes the listener from the collection of listeners who will
be notified when the help events are generated for the control.
|
void |
removeKeyListener(KeyListener listener)
Removes the listener from the collection of listeners who will
be notified when keys are pressed and released on the system keyboard.
|
void |
removeMenuDetectListener(MenuDetectListener listener)
Removes the listener from the collection of listeners who will
be notified when the platform-specific context menu trigger has
occurred.
|
void |
removeMouseListener(MouseListener listener)
Removes the listener from the collection of listeners who will
be notified when mouse buttons are pressed and released.
|
void |
removeMouseMoveListener(MouseMoveListener listener)
Removes the listener from the collection of listeners who will
be notified when the mouse moves.
|
void |
removeMouseTrackListener(MouseTrackListener listener)
Removes the listener from the collection of listeners who will
be notified when the mouse passes or hovers over controls.
|
void |
removeMouseWheelListener(MouseWheelListener listener)
Removes the listener from the collection of listeners who will
be notified when the mouse wheel is scrolled.
|
void |
removePaintListener(PaintListener listener)
Removes the listener from the collection of listeners who will
be notified when the receiver needs to be painted.
|
void |
removeTouchListener(TouchListener listener)
Removes the listener from the collection of listeners who will
be notified when touch events occur.
|
void |
removeTraverseListener(TraverseListener listener)
Removes the listener from the collection of listeners who will
be notified when traversal events occur.
|
(package private) boolean |
sendFocusEvent(int type) |
(package private) boolean |
sendGestureEvent(GESTUREINFO gi) |
(package private) void |
sendMove() |
(package private) void |
sendResize() |
(package private) void |
sendTouchEvent(TOUCHINPUT[] touchInput) |
(package private) void |
setBackground() |
void |
setBackground(Color color)
Sets the receiver's background color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setBackgroundImage(Image image)
Sets the receiver's background image to the image specified
by the argument, or to the default system color for the control
if the argument is null.
|
(package private) void |
setBackgroundImage(int hBitmap) |
(package private) void |
setBackgroundPixel(int pixel) |
void |
setBounds(int x,
int y,
int width,
int height)
Sets the receiver's size and location to the rectangular
area specified by the arguments.
|
(package private) void |
setBounds(int x,
int y,
int width,
int height,
int flags) |
(package private) void |
setBounds(int x,
int y,
int width,
int height,
int flags,
boolean defer) |
void |
setBounds(Rectangle rect)
Sets the receiver's size and location to the rectangular
area specified by the argument.
|
void |
setCapture(boolean capture)
If the argument is
true , causes the receiver to have
all mouse events delivered to it until the method is called with
false as the argument. |
(package private) void |
setCursor() |
void |
setCursor(Cursor cursor)
Sets the receiver's cursor to the cursor specified by the
argument, or to the default cursor for that kind of control
if the argument is null.
|
(package private) void |
setDefaultFont() |
void |
setDragDetect(boolean dragDetect)
Sets the receiver's drag detect state.
|
void |
setEnabled(boolean enabled)
Enables the receiver if the argument is
true ,
and disables it otherwise. |
boolean |
setFocus()
Causes the receiver to have the keyboard focus,
such that all keyboard events will be delivered to it.
|
void |
setFont(Font font)
Sets the font that the receiver will use to paint textual information
to the font specified by the argument, or to the default font for that
kind of control if the argument is null.
|
void |
setForeground(Color color)
Sets the receiver's foreground color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
(package private) void |
setForegroundPixel(int pixel) |
void |
setLayoutData(java.lang.Object layoutData)
Sets the layout data associated with the receiver to the argument.
|
void |
setLocation(int x,
int y)
Sets the receiver's location to the point specified by
the arguments which are relative to the receiver's
parent (or its display if its parent is null), unless
the receiver is a shell.
|
void |
setLocation(Point location)
Sets the receiver's location to the point specified by
the arguments which are relative to the receiver's
parent (or its display if its parent is null), unless
the receiver is a shell.
|
void |
setMenu(Menu menu)
Sets the receiver's pop up menu to the argument.
|
void |
setOrientation(int orientation)
Sets the orientation of the receiver, which must be one
of the constants
SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT . |
boolean |
setParent(Composite parent)
Changes the parent of the widget to be the one provided if
the underlying operating system supports this feature.
|
(package private) boolean |
setRadioFocus(boolean tabbing) |
(package private) boolean |
setRadioSelection(boolean value) |
void |
setRedraw(boolean redraw)
If the argument is
false , causes subsequent drawing
operations in the receiver to be ignored. |
void |
setRegion(Region region)
Sets the shape of the control to the region specified
by the argument.
|
(package private) boolean |
setSavedFocus() |
void |
setSize(int width,
int height)
Sets the receiver's size to the point specified by the arguments.
|
void |
setSize(Point size)
Sets the receiver's size to the point specified by the argument.
|
(package private) boolean |
setTabItemFocus() |
(package private) void |
setToolTipText(Shell shell,
java.lang.String string) |
void |
setToolTipText(java.lang.String string)
Sets the receiver's tool tip text to the argument, which
may be null indicating that the default tool tip for the
control will be shown.
|
void |
setTouchEnabled(boolean enabled)
Sets whether this control should send touch events (by default controls do not).
|
void |
setVisible(boolean visible)
Marks the receiver as visible if the argument is
true ,
and marks it invisible otherwise. |
(package private) void |
showWidget(boolean visible) |
(package private) void |
sort(int[] items) |
(package private) void |
subclass() |
Point |
toControl(int x,
int y)
Returns a point which is the result of converting the
argument, which is specified in display relative coordinates,
to coordinates relative to the receiver.
|
Point |
toControl(Point point)
Returns a point which is the result of converting the
argument, which is specified in display relative coordinates,
to coordinates relative to the receiver.
|
Point |
toDisplay(int x,
int y)
Returns a point which is the result of converting the
argument, which is specified in coordinates relative to
the receiver, to display relative coordinates.
|
Point |
toDisplay(Point point)
Returns a point which is the result of converting the
argument, which is specified in coordinates relative to
the receiver, to display relative coordinates.
|
(package private) int |
topHandle() |
(package private) boolean |
translateAccelerator(MSG msg) |
(package private) boolean |
translateMnemonic(Event event,
Control control) |
(package private) boolean |
translateMnemonic(MSG msg) |
(package private) boolean |
translateTraversal(MSG msg) |
(package private) boolean |
traverse(Event event) |
boolean |
traverse(int traversal)
Based on the argument, perform one of the expected platform
traversal action.
|
(package private) boolean |
traverse(int traversal,
char character,
int keyCode,
int keyLocation,
int stateMask,
boolean doit) |
boolean |
traverse(int traversal,
Event event)
Performs a platform traversal action corresponding to a
KeyDown event. |
boolean |
traverse(int traversal,
KeyEvent event)
Performs a platform traversal action corresponding to a
KeyDown event. |
(package private) boolean |
traverseEscape() |
(package private) boolean |
traverseGroup(boolean next) |
(package private) boolean |
traverseItem(boolean next) |
(package private) boolean |
traverseMnemonic(char key) |
(package private) boolean |
traversePage(boolean next) |
(package private) boolean |
traverseReturn() |
(package private) void |
unsubclass() |
void |
update()
Forces all outstanding paint requests for the widget
to be processed before this method returns.
|
(package private) void |
update(boolean all) |
(package private) void |
updateBackgroundColor() |
(package private) void |
updateBackgroundImage() |
(package private) void |
updateBackgroundMode() |
(package private) void |
updateFont(Font oldFont,
Font newFont) |
(package private) void |
updateImages() |
(package private) void |
updateLayout(boolean resize,
boolean all) |
(package private) void |
updateOrientation() |
(package private) CREATESTRUCT |
widgetCreateStruct() |
(package private) int |
widgetExtStyle() |
(package private) int |
widgetParent() |
(package private) int |
widgetStyle() |
(package private) abstract TCHAR |
windowClass() |
(package private) abstract int |
windowProc() |
(package private) int |
windowProc(int hwnd,
int msg,
int wParam,
int lParam) |
(package private) LRESULT |
WM_ACTIVATE(int wParam,
int lParam) |
(package private) LRESULT |
WM_CAPTURECHANGED(int wParam,
int lParam) |
(package private) LRESULT |
WM_CHANGEUISTATE(int wParam,
int lParam) |
(package private) LRESULT |
WM_CHAR(int wParam,
int lParam) |
(package private) LRESULT |
WM_CLEAR(int wParam,
int lParam) |
(package private) LRESULT |
WM_CLOSE(int wParam,
int lParam) |
(package private) LRESULT |
WM_COMMAND(int wParam,
int lParam) |
(package private) LRESULT |
WM_CONTEXTMENU(int wParam,
int lParam) |
(package private) LRESULT |
WM_CTLCOLOR(int wParam,
int lParam) |
(package private) LRESULT |
WM_CUT(int wParam,
int lParam) |
(package private) LRESULT |
WM_DESTROY(int wParam,
int lParam) |
(package private) LRESULT |
WM_DRAWITEM(int wParam,
int lParam) |
(package private) LRESULT |
WM_ENDSESSION(int wParam,
int lParam) |
(package private) LRESULT |
WM_ENTERIDLE(int wParam,
int lParam) |
(package private) LRESULT |
WM_ERASEBKGND(int wParam,
int lParam) |
(package private) LRESULT |
WM_GESTURE(int wParam,
int lParam) |
(package private) LRESULT |
WM_GETDLGCODE(int wParam,
int lParam) |
(package private) LRESULT |
WM_GETFONT(int wParam,
int lParam) |
(package private) LRESULT |
WM_GETMINMAXINFO(int wParam,
int lParam) |
(package private) LRESULT |
WM_GETOBJECT(int wParam,
int lParam) |
(package private) LRESULT |
WM_HELP(int wParam,
int lParam) |
(package private) LRESULT |
WM_HOTKEY(int wParam,
int lParam) |
(package private) LRESULT |
WM_HSCROLL(int wParam,
int lParam) |
(package private) LRESULT |
WM_IME_CHAR(int wParam,
int lParam) |
(package private) LRESULT |
WM_IME_COMPOSITION_START(int wParam,
int lParam) |
(package private) LRESULT |
WM_IME_COMPOSITION(int wParam,
int lParam) |
(package private) LRESULT |
WM_IME_ENDCOMPOSITION(int wParam,
int lParam) |
(package private) LRESULT |
WM_INITMENUPOPUP(int wParam,
int lParam) |
(package private) LRESULT |
WM_INPUTLANGCHANGE(int wParam,
int lParam) |
(package private) LRESULT |
WM_KEYDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_KEYUP(int wParam,
int lParam) |
(package private) LRESULT |
WM_KILLFOCUS(int wParam,
int lParam) |
(package private) LRESULT |
WM_LBUTTONDBLCLK(int wParam,
int lParam) |
(package private) LRESULT |
WM_LBUTTONDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_LBUTTONUP(int wParam,
int lParam) |
(package private) LRESULT |
WM_MBUTTONDBLCLK(int wParam,
int lParam) |
(package private) LRESULT |
WM_MBUTTONDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_MBUTTONUP(int wParam,
int lParam) |
(package private) LRESULT |
WM_MEASUREITEM(int wParam,
int lParam) |
(package private) LRESULT |
WM_MENUCHAR(int wParam,
int lParam) |
(package private) LRESULT |
WM_MENUSELECT(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOUSEACTIVATE(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOUSEHOVER(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOUSEHWHEEL(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOUSELEAVE(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOUSEMOVE(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOUSEWHEEL(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOVE(int wParam,
int lParam) |
(package private) LRESULT |
WM_NCACTIVATE(int wParam,
int lParam) |
(package private) LRESULT |
WM_NCCALCSIZE(int wParam,
int lParam) |
(package private) LRESULT |
WM_NCHITTEST(int wParam,
int lParam) |
(package private) LRESULT |
WM_NCLBUTTONDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_NCPAINT(int wParam,
int lParam) |
(package private) LRESULT |
WM_NOTIFY(int wParam,
int lParam) |
(package private) LRESULT |
WM_PAINT(int wParam,
int lParam) |
(package private) LRESULT |
WM_PALETTECHANGED(int wParam,
int lParam) |
(package private) LRESULT |
WM_PARENTNOTIFY(int wParam,
int lParam) |
(package private) LRESULT |
WM_PASTE(int wParam,
int lParam) |
(package private) LRESULT |
WM_PRINT(int wParam,
int lParam) |
(package private) LRESULT |
WM_PRINTCLIENT(int wParam,
int lParam) |
(package private) LRESULT |
WM_QUERYENDSESSION(int wParam,
int lParam) |
(package private) LRESULT |
WM_QUERYNEWPALETTE(int wParam,
int lParam) |
(package private) LRESULT |
WM_QUERYOPEN(int wParam,
int lParam) |
(package private) LRESULT |
WM_RBUTTONDBLCLK(int wParam,
int lParam) |
(package private) LRESULT |
WM_RBUTTONDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_RBUTTONUP(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETCURSOR(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETFOCUS(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETFONT(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETREDRAW(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETTINGCHANGE(int wParam,
int lParam) |
(package private) LRESULT |
WM_SHOWWINDOW(int wParam,
int lParam) |
(package private) LRESULT |
WM_SIZE(int wParam,
int lParam) |
(package private) LRESULT |
WM_SYSCHAR(int wParam,
int lParam) |
(package private) LRESULT |
WM_SYSCOLORCHANGE(int wParam,
int lParam) |
(package private) LRESULT |
WM_SYSCOMMAND(int wParam,
int lParam) |
(package private) LRESULT |
WM_SYSKEYDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_SYSKEYUP(int wParam,
int lParam) |
(package private) LRESULT |
WM_TABLET_FLICK(int wParam,
int lParam) |
(package private) LRESULT |
WM_TIMER(int wParam,
int lParam) |
(package private) LRESULT |
WM_TOUCH(int wParam,
int lParam) |
(package private) LRESULT |
WM_UNDO(int wParam,
int lParam) |
(package private) LRESULT |
WM_UNINITMENUPOPUP(int wParam,
int lParam) |
(package private) LRESULT |
WM_UPDATEUISTATE(int wParam,
int lParam) |
(package private) LRESULT |
WM_VSCROLL(int wParam,
int lParam) |
(package private) LRESULT |
WM_WINDOWPOSCHANGED(int wParam,
int lParam) |
(package private) LRESULT |
WM_WINDOWPOSCHANGING(int wParam,
int lParam) |
(package private) LRESULT |
WM_XBUTTONDBLCLK(int wParam,
int lParam) |
(package private) LRESULT |
WM_XBUTTONDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_XBUTTONUP(int wParam,
int lParam) |
(package private) LRESULT |
wmColorChild(int wParam,
int lParam) |
(package private) LRESULT |
wmCommandChild(int wParam,
int lParam) |
(package private) LRESULT |
wmDrawChild(int wParam,
int lParam) |
(package private) LRESULT |
wmMeasureChild(int wParam,
int lParam) |
(package private) LRESULT |
wmNotify(NMHDR hdr,
int wParam,
int lParam) |
(package private) LRESULT |
wmNotifyChild(NMHDR hdr,
int wParam,
int lParam) |
(package private) LRESULT |
wmScrollChild(int wParam,
int lParam) |
_addListener, addDisposeListener, addListener, callWindowProc, checkBits, checkOpened, checkOrientation, checkParent, checkSubclass, checkWidget, DeferWindowPos, dispose, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getName, getNameText, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, notifyListeners, postEvent, postEvent, release, releaseChildren, removeDisposeListener, removeListener, removeListener, reskin, reskinChildren, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, setTabGroupFocus, SetWindowPos, showMenu, showMenu, toString, updateMenuLocation, wmCaptureChanged, wmChar, wmContextMenu, wmIMEChar, wmKeyDown, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmNCPaint, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyDown, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUp
public int handle
IMPORTANT: This field is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code.
Composite parent
Cursor cursor
Menu menu
java.lang.String toolTipText
java.lang.Object layoutData
Accessible accessible
Image backgroundImage
Region region
Font font
int drawCount
int foreground
int background
Control()
public Control(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 constructjava.lang.IllegalArgumentException
- SWTException
- SWT.BORDER
,
SWT.LEFT_TO_RIGHT
,
SWT.RIGHT_TO_LEFT
,
Widget.checkSubclass()
,
Widget.getStyle()
public void addControlListener(ControlListener listener)
ControlListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- ControlListener
,
removeControlListener(org.eclipse.swt.events.ControlListener)
public void addDragDetectListener(DragDetectListener listener)
DragDetectListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- DragDetectListener
,
removeDragDetectListener(org.eclipse.swt.events.DragDetectListener)
public void addFocusListener(FocusListener listener)
FocusListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- FocusListener
,
removeFocusListener(org.eclipse.swt.events.FocusListener)
public void addGestureListener(GestureListener listener)
GestureListener
interface.
NOTE: If setTouchEnabled(true)
has previously been
invoked on the receiver then setTouchEnabled(false)
must be invoked on it to specify that gesture events should be
sent instead of touch events.
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- GestureListener
,
removeGestureListener(org.eclipse.swt.events.GestureListener)
,
setTouchEnabled(boolean)
public void addHelpListener(HelpListener listener)
HelpListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- HelpListener
,
removeHelpListener(org.eclipse.swt.events.HelpListener)
public void addKeyListener(KeyListener listener)
KeyListener
interface.
When a key listener is added to a control, the control will take part in widget traversal. By default, all traversal keys (such as the tab key and so on) are delivered to the control. In order for a control to take part in traversal, it should listen for traversal events. Otherwise, the user can traverse into a control but not out. Note that native controls such as table and tree implement key traversal in the operating system. It is not necessary to add traversal listeners for these controls, unless you want to override the default traversal.
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- KeyListener
,
removeKeyListener(org.eclipse.swt.events.KeyListener)
public void addMenuDetectListener(MenuDetectListener listener)
MenuDetectListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- MenuDetectListener
,
removeMenuDetectListener(org.eclipse.swt.events.MenuDetectListener)
public void addMouseListener(MouseListener listener)
MouseListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseListener
,
removeMouseListener(org.eclipse.swt.events.MouseListener)
public void addMouseTrackListener(MouseTrackListener listener)
MouseTrackListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseTrackListener
,
removeMouseTrackListener(org.eclipse.swt.events.MouseTrackListener)
public void addMouseMoveListener(MouseMoveListener listener)
MouseMoveListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseMoveListener
,
removeMouseMoveListener(org.eclipse.swt.events.MouseMoveListener)
public void addMouseWheelListener(MouseWheelListener listener)
MouseWheelListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseWheelListener
,
removeMouseWheelListener(org.eclipse.swt.events.MouseWheelListener)
public void addPaintListener(PaintListener listener)
PaintListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- PaintListener
,
removePaintListener(org.eclipse.swt.events.PaintListener)
public void addTouchListener(TouchListener listener)
TouchListener
interface.
NOTE: You must also call setTouchEnabled(true)
to
specify that touch events should be sent, which will cause gesture
events to not be sent.
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- TouchListener
,
removeTouchListener(org.eclipse.swt.events.TouchListener)
,
setTouchEnabled(boolean)
public void addTraverseListener(TraverseListener listener)
TraverseListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- TraverseListener
,
removeTraverseListener(org.eclipse.swt.events.TraverseListener)
int binarySearch(int[] indices, int start, int end, int index)
int borderHandle()
void checkBackground()
void checkBorder()
void checkBuffered()
void checkComposited()
boolean checkHandle(int hwnd)
void checkMirrored()
public Point computeSize(int wHint, int hHint)
The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT
is passed for the hint.
wHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)SWTException
- Layout
,
getBorderWidth()
,
getBounds()
,
getSize()
,
pack(boolean)
,
"computeTrim, getClientArea for controls that implement them"public Point computeSize(int wHint, int hHint, boolean changed)
The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT
is passed for the hint.
If the changed flag is true
, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false
, so layout
manager caches can be retained.
wHint
- 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
otherwiseSWTException
- Layout
,
getBorderWidth()
,
getBounds()
,
getSize()
,
pack(boolean)
,
"computeTrim, getClientArea for controls that implement them"Widget computeTabGroup()
Control computeTabRoot()
Widget[] computeTabList()
void createHandle()
void checkGesture()
void createWidget()
int defaultBackground()
int defaultFont()
int defaultForeground()
void deregister()
void destroyWidget()
Widget
When a widget is destroyed in the operating system, its
descendants are also destroyed by the operating system.
This means that it is only necessary to call destroyWidget
on the root of the widget tree.
This method is called after releaseWidget()
.
See also releaseChild()
, releaseWidget()
and releaseHandle()
.
destroyWidget
in class Widget
Widget.dispose()
public boolean dragDetect(Event event)
By default, a drag is detected when the gesture
occurs anywhere within the client area of a control.
Some controls, such as tables and trees, override this
behavior. In addition to the operating system specific
drag gesture, they require the mouse to be inside an
item. Custom widget writers can use setDragDetect
to disable the default detection, listen for mouse down,
and then call dragDetect()
from within the
listener to conditionally detect a drag.
event
- the mouse down eventtrue
if the gesture occurred, and false
otherwise.java.lang.IllegalArgumentException
- SWTException
- DragDetectListener
,
addDragDetectListener(org.eclipse.swt.events.DragDetectListener)
,
getDragDetect()
,
setDragDetect(boolean)
public boolean dragDetect(MouseEvent event)
By default, a drag is detected when the gesture
occurs anywhere within the client area of a control.
Some controls, such as tables and trees, override this
behavior. In addition to the operating system specific
drag gesture, they require the mouse to be inside an
item. Custom widget writers can use setDragDetect
to disable the default detection, listen for mouse down,
and then call dragDetect()
from within the
listener to conditionally detect a drag.
event
- the mouse down eventtrue
if the gesture occurred, and false
otherwise.java.lang.IllegalArgumentException
- SWTException
- DragDetectListener
,
addDragDetectListener(org.eclipse.swt.events.DragDetectListener)
,
getDragDetect()
,
setDragDetect(boolean)
boolean dragDetect(int button, int count, int stateMask, int x, int y)
void drawBackground(int hDC)
void drawBackground(int hDC, RECT rect)
void drawBackground(int hDC, RECT rect, int pixel, int tx, int ty)
void drawImageBackground(int hDC, int hwnd, int hBitmap, RECT rect, int tx, int ty)
void drawThemeBackground(int hDC, int hwnd, RECT rect)
void enableDrag(boolean enabled)
void enableWidget(boolean enabled)
void fillBackground(int hDC, int pixel, RECT rect)
Control findBackgroundControl()
int findBrush(int value, int lbStyle)
Cursor findCursor()
Control findImageControl()
Control findThemeControl()
char findMnemonic(java.lang.String string)
void fixChildren(Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu[] menus)
void fixFocus(Control focusControl)
public boolean forceFocus()
true
if the control got focus, and false
if it was unable to.SWTException
- setFocus()
void forceResize()
public Accessible getAccessible()
If this is the first time this object is requested, then the object is created and returned. The object returned by getAccessible() does not need to be disposed.
SWTException
- Accessible.addAccessibleListener(org.eclipse.swt.accessibility.AccessibleListener)
,
Accessible.addAccessibleControlListener(org.eclipse.swt.accessibility.AccessibleControlListener)
public Color getBackground()
Note: This operation is a hint and may be overridden by the platform. For example, on some versions of Windows the background of a TabFolder, is a gradient rather than a solid color.
SWTException
- public Image getBackgroundImage()
SWTException
- int getBackgroundPixel()
public int getBorderWidth()
SWTException
- public Rectangle getBounds()
SWTException
- int getCodePage()
java.lang.String getClipboardText()
public Cursor getCursor()
When the mouse pointer passes over a control its appearance is changed to match the control's cursor.
null
SWTException
- public boolean getDragDetect()
true
if the receiver is detecting
drag gestures, and false
otherwise.SWTException
- boolean getDrawing()
public boolean getEnabled()
true
if the receiver is enabled, and
false
otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.SWTException
- isEnabled()
public Font getFont()
SWTException
- public Color getForeground()
SWTException
- int getForegroundPixel()
public java.lang.Object getLayoutData()
SWTException
- public Point getLocation()
SWTException
- public Menu getMenu()
getMenu
in class Widget
SWTException
- public Monitor getMonitor()
SWTException
- public int getOrientation()
SWT.LEFT_TO_RIGHT
or SWT.RIGHT_TO_LEFT
.SWTException
- public Composite getParent()
Composite
or null when the receiver is a shell that was created with null or
a display for a parent.SWTException
- Control[] getPath()
public Region getRegion()
SWTException
- public Shell getShell()
SWTException
- getParent()
public Point getSize()
SWTException
- public java.lang.String getToolTipText()
SWTException
- public boolean getTouchEnabled()
true
if this control is set to send touch events, or
false
if it is set to send gesture events instead. This method
also returns false
if a touch-based input device is not detected
(this can be determined with Display#getTouchEnabled()
). Use
setTouchEnabled(boolean)
to switch the events that a control sends
between touch events and gesture events.true
if the control is set to send touch events, or false
otherwiseSWTException
- setTouchEnabled(boolean)
,
Display.getTouchEnabled()
public boolean getVisible()
true
if the receiver is visible, and
false
otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.
SWTException
- boolean hasCursor()
boolean hasFocus()
public int internal_new_GC(GCData data)
IMPORTANT: This method is not part of the public
API for Control
. It is marked public only so that it
can be shared within the packages provided by SWT. It is not
available on all platforms, and should never be called from
application code.
internal_new_GC
in interface Drawable
data
- the platform specific GC datapublic void internal_dispose_GC(int hDC, GCData data)
IMPORTANT: This method is not part of the public
API for Control
. It is marked public only so that it
can be shared within the packages provided by SWT. It is not
available on all platforms, and should never be called from
application code.
internal_dispose_GC
in interface Drawable
hDC
- the platform specific GC handledata
- the platform specific GC databoolean isActive()
public boolean isEnabled()
true
if the receiver is enabled and all
ancestors up to and including the receiver's nearest ancestor
shell are enabled. Otherwise, false
is returned.
A disabled control is typically not selectable from the user
interface and draws with an inactive or "grayed" look.SWTException
- getEnabled()
public boolean isFocusControl()
true
if the receiver has the user-interface
focus, and false
otherwise.SWTException
- boolean isFocusAncestor(Control control)
public boolean isReparentable()
true
if the underlying operating
system supports this reparenting, otherwise false
true
if the widget can be reparented, otherwise false
SWTException
- boolean isShowing()
boolean isTabGroup()
boolean isTabItem()
public boolean isVisible()
true
if the receiver is visible and all
ancestors up to and including the receiver's nearest ancestor
shell are visible. Otherwise, false
is returned.SWTException
- getVisible()
void markLayout(boolean changed, boolean all)
Decorations menuShell()
boolean mnemonicHit(char key)
boolean mnemonicMatch(char key)
public void moveAbove(Control control)
control
- the sibling control (or null)java.lang.IllegalArgumentException
- SWTException
- moveBelow(org.eclipse.swt.widgets.Control)
,
Composite.getChildren()
public void moveBelow(Control control)
control
- the sibling control (or null)java.lang.IllegalArgumentException
- SWTException
- moveAbove(org.eclipse.swt.widgets.Control)
,
Composite.getChildren()
Accessible new_Accessible(Control control)
public void pack()
SWTException
- computeSize(int, int, boolean)
public void pack(boolean changed)
If the changed flag is true
, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false
, so layout
manager caches can be retained.
changed
- whether or not the receiver's contents have changedSWTException
- computeSize(int, int, boolean)
public boolean print(GC gc)
gc
- the gc where the drawing occurstrue
if the operation was successful and false
otherwisejava.lang.IllegalArgumentException
- SWTException
- void printWidget(int hwnd, int hdc, GC gc)
public void redraw()
SWTException
- update()
,
PaintListener
,
SWT.Paint
,
SWT.NO_BACKGROUND
,
SWT.NO_REDRAW_RESIZE
,
SWT.NO_MERGE_PAINTS
,
SWT.DOUBLE_BUFFERED
void redraw(boolean all)
public void redraw(int x, int y, int width, int height, boolean all)
all
flag is true
, any
children of the receiver which intersect with the specified
area will also paint their intersecting areas. If the
all
flag is false
, the children
will not be painted.x
- the x coordinate of the area to drawy
- the y coordinate of the area to drawwidth
- the width of the area to drawheight
- the height of the area to drawall
- true
if children should redraw, and false
otherwiseSWTException
- update()
,
PaintListener
,
SWT.Paint
,
SWT.NO_BACKGROUND
,
SWT.NO_REDRAW_RESIZE
,
SWT.NO_MERGE_PAINTS
,
SWT.DOUBLE_BUFFERED
boolean redrawChildren()
void register()
void releaseHandle()
releaseHandle
in class Widget
void releaseParent()
releaseParent
in class Widget
void releaseWidget()
releaseWidget
in class Widget
public void removeControlListener(ControlListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- ControlListener
,
addControlListener(org.eclipse.swt.events.ControlListener)
public void removeDragDetectListener(DragDetectListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- DragDetectListener
,
addDragDetectListener(org.eclipse.swt.events.DragDetectListener)
public void removeFocusListener(FocusListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- FocusListener
,
addFocusListener(org.eclipse.swt.events.FocusListener)
public void removeGestureListener(GestureListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- GestureListener
,
addGestureListener(org.eclipse.swt.events.GestureListener)
public void removeHelpListener(HelpListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- HelpListener
,
addHelpListener(org.eclipse.swt.events.HelpListener)
public void removeKeyListener(KeyListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- KeyListener
,
addKeyListener(org.eclipse.swt.events.KeyListener)
public void removeMenuDetectListener(MenuDetectListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- MenuDetectListener
,
addMenuDetectListener(org.eclipse.swt.events.MenuDetectListener)
public void removeMouseTrackListener(MouseTrackListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseTrackListener
,
addMouseTrackListener(org.eclipse.swt.events.MouseTrackListener)
public void removeMouseListener(MouseListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseListener
,
addMouseListener(org.eclipse.swt.events.MouseListener)
public void removeMouseMoveListener(MouseMoveListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseMoveListener
,
addMouseMoveListener(org.eclipse.swt.events.MouseMoveListener)
public void removeMouseWheelListener(MouseWheelListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseWheelListener
,
addMouseWheelListener(org.eclipse.swt.events.MouseWheelListener)
public void removePaintListener(PaintListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- PaintListener
,
addPaintListener(org.eclipse.swt.events.PaintListener)
public void removeTouchListener(TouchListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- TouchListener
,
addTouchListener(org.eclipse.swt.events.TouchListener)
public void removeTraverseListener(TraverseListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- TraverseListener
,
addTraverseListener(org.eclipse.swt.events.TraverseListener)
void showWidget(boolean visible)
boolean sendFocusEvent(int type)
sendFocusEvent
in class Widget
boolean sendGestureEvent(GESTUREINFO gi)
void sendMove()
void sendResize()
void sendTouchEvent(TOUCHINPUT[] touchInput)
void setBackground()
public void setBackground(Color color)
Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.
color
- the new color (or null)java.lang.IllegalArgumentException
- SWTException
- public void setBackgroundImage(Image image)
Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.
image
- the new image (or null)java.lang.IllegalArgumentException
- SWTException
- void setBackgroundImage(int hBitmap)
void setBackgroundPixel(int pixel)
public void setBounds(int x, int y, int width, int height)
x
and
y
arguments are relative to the receiver's
parent (or its display if its parent is null), unless
the receiver is a shell. In this case, the x
and y
arguments are relative to the display.
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
x
- the new x coordinate for the receivery
- the new y coordinate for the receiverwidth
- the new width for the receiverheight
- the new height for the receiverSWTException
- void setBounds(int x, int y, int width, int height, int flags)
void setBounds(int x, int y, int width, int height, int flags, boolean defer)
public void setBounds(Rectangle rect)
x
and
y
fields of the rectangle are relative to
the receiver's parent (or its display if its parent is null).
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
rect
- the new bounds for the receiverSWTException
- public void setCapture(boolean capture)
true
, causes the receiver to have
all mouse events delivered to it until the method is called with
false
as the argument. Note that on some platforms,
a mouse button must currently be down for capture to be assigned.capture
- true
to capture the mouse, and false
to release itSWTException
- void setCursor()
public void setCursor(Cursor cursor)
When the mouse pointer passes over a control its appearance is changed to match the control's cursor.
cursor
- the new cursor (or null)java.lang.IllegalArgumentException
- SWTException
- void setDefaultFont()
public void setDragDetect(boolean dragDetect)
true
, the receiver will detect drag gestures,
otherwise these gestures will be ignored.dragDetect
- the new drag detect stateSWTException
- public void setEnabled(boolean enabled)
true
,
and disables it otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.enabled
- the new enabled stateSWTException
- public boolean setFocus()
true
if the control got focus, and false
if it was unable to.SWTException
- forceFocus()
public void setFont(Font font)
font
- the new font (or null)java.lang.IllegalArgumentException
- SWTException
- public void setForeground(Color color)
Note: This operation is a hint and may be overridden by the platform.
color
- the new color (or null)java.lang.IllegalArgumentException
- SWTException
- void setForegroundPixel(int pixel)
public void setLayoutData(java.lang.Object layoutData)
layoutData
- the new layout data for the receiver.SWTException
- public void setLocation(int x, int y)
x
- the new x coordinate for the receivery
- the new y coordinate for the receiverSWTException
- public void setLocation(Point location)
location
- the new location for the receiverSWTException
- public void setMenu(Menu menu)
Note: Disposing of a control that has a pop up menu will dispose of the menu. To avoid this behavior, set the menu to null before the control is disposed.
menu
- the new pop up menujava.lang.IllegalArgumentException
- SWTException
- public void setOrientation(int orientation)
SWT.LEFT_TO_RIGHT
or SWT.RIGHT_TO_LEFT
.
orientation
- new orientation styleSWTException
- boolean setRadioFocus(boolean tabbing)
boolean setRadioSelection(boolean value)
public void setRedraw(boolean redraw)
false
, causes subsequent drawing
operations in the receiver to be ignored. No drawing of any kind
can occur in the receiver until the flag is set to true.
Graphics operations that occurred while the flag was
false
are lost. When the flag is set to true
,
the entire widget is marked as needing to be redrawn. Nested calls
to this method are stacked.
Note: This operation is a hint and may not be supported on some platforms or for some widgets.
redraw
- the new redraw stateSWTException
- redraw(int, int, int, int, boolean)
,
update()
public void setRegion(Region region)
region
- the region that defines the shape of the control (or null)java.lang.IllegalArgumentException
- SWTException
- boolean setSavedFocus()
public void setSize(int width, int height)
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
width
- the new width for the receiverheight
- the new height for the receiverSWTException
- public void setSize(Point size)
Note: Attempting to set the width or height of the receiver to a negative number will cause them to be set to zero instead.
size
- the new size for the receiverjava.lang.IllegalArgumentException
- SWTException
- boolean setTabItemFocus()
setTabItemFocus
in class Widget
public void setToolTipText(java.lang.String string)
The mnemonic indicator (character '&') is not displayed in a tool tip. To display a single '&' in the tool tip, the character '&' can be escaped by doubling it in the string.
string
- the new tool tip text (or null)SWTException
- void setToolTipText(Shell shell, java.lang.String string)
public void setTouchEnabled(boolean enabled)
false
causes the receiver to send gesture events
instead. No exception is thrown if a touch-based input device is not
detected (this can be determined with Display#getTouchEnabled()
).enabled
- the new touch-enabled stateSWTException
- Display.getTouchEnabled()
public void setVisible(boolean visible)
true
,
and marks it invisible otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
visible
- the new visibility stateSWTException
- void sort(int[] items)
void subclass()
public Point toControl(int x, int y)
x
- the x coordinate to be translatedy
- the y coordinate to be translatedSWTException
- public Point toControl(Point point)
point
- the point to be translated (must not be null)java.lang.IllegalArgumentException
- SWTException
- public Point toDisplay(int x, int y)
x
- the x coordinate to be translatedy
- the y coordinate to be translatedSWTException
- public Point toDisplay(Point point)
point
- the point to be translated (must not be null)java.lang.IllegalArgumentException
- SWTException
- int topHandle()
boolean translateAccelerator(MSG msg)
boolean translateMnemonic(MSG msg)
boolean translateTraversal(MSG msg)
boolean traverse(Event event)
public boolean traverse(int traversal)
SWT.TRAVERSE_ESCAPE
, SWT.TRAVERSE_RETURN
,
SWT.TRAVERSE_TAB_NEXT
, SWT.TRAVERSE_TAB_PREVIOUS
,
SWT.TRAVERSE_ARROW_NEXT
, SWT.TRAVERSE_ARROW_PREVIOUS
,
SWT.TRAVERSE_PAGE_NEXT
and SWT.TRAVERSE_PAGE_PREVIOUS
.traversal
- the type of traversalSWTException
- public boolean traverse(int traversal, Event event)
KeyDown
event.
Valid traversal values are
SWT.TRAVERSE_NONE
, SWT.TRAVERSE_MNEMONIC
,
SWT.TRAVERSE_ESCAPE
, SWT.TRAVERSE_RETURN
,
SWT.TRAVERSE_TAB_NEXT
, SWT.TRAVERSE_TAB_PREVIOUS
,
SWT.TRAVERSE_ARROW_NEXT
, SWT.TRAVERSE_ARROW_PREVIOUS
,
SWT.TRAVERSE_PAGE_NEXT
and SWT.TRAVERSE_PAGE_PREVIOUS
.
If traversal
is SWT.TRAVERSE_NONE
then the Traverse
event is created with standard values based on the KeyDown event. If
traversal
is one of the other traversal constants then the Traverse
event is created with this detail, and its doit
is taken from the
KeyDown event.
traversal
- the type of traversal, or SWT.TRAVERSE_NONE
to compute
this from event
event
- the KeyDown eventtrue
if the traversal succeededjava.lang.IllegalArgumentException
- SWTException
- public boolean traverse(int traversal, KeyEvent event)
KeyDown
event.
Valid traversal values are
SWT.TRAVERSE_NONE
, SWT.TRAVERSE_MNEMONIC
,
SWT.TRAVERSE_ESCAPE
, SWT.TRAVERSE_RETURN
,
SWT.TRAVERSE_TAB_NEXT
, SWT.TRAVERSE_TAB_PREVIOUS
,
SWT.TRAVERSE_ARROW_NEXT
, SWT.TRAVERSE_ARROW_PREVIOUS
,
SWT.TRAVERSE_PAGE_NEXT
and SWT.TRAVERSE_PAGE_PREVIOUS
.
If traversal
is SWT.TRAVERSE_NONE
then the Traverse
event is created with standard values based on the KeyDown event. If
traversal
is one of the other traversal constants then the Traverse
event is created with this detail, and its doit
is taken from the
KeyDown event.
traversal
- the type of traversal, or SWT.TRAVERSE_NONE
to compute
this from event
event
- the KeyDown eventtrue
if the traversal succeededjava.lang.IllegalArgumentException
- SWTException
- boolean traverse(int traversal, char character, int keyCode, int keyLocation, int stateMask, boolean doit)
boolean traverseEscape()
boolean traverseGroup(boolean next)
boolean traverseItem(boolean next)
boolean traverseMnemonic(char key)
boolean traversePage(boolean next)
boolean traverseReturn()
void unsubclass()
public void update()
Note: This method does not cause a redraw.
SWTException
- redraw()
,
redraw(int, int, int, int, boolean)
,
PaintListener
,
SWT.Paint
void update(boolean all)
void updateBackgroundColor()
void updateBackgroundImage()
void updateBackgroundMode()
void updateImages()
void updateLayout(boolean resize, boolean all)
void updateOrientation()
CREATESTRUCT widgetCreateStruct()
int widgetExtStyle()
int widgetParent()
int widgetStyle()
public boolean setParent(Composite parent)
true
if the parent is successfully changed.parent
- the new parent for the control.true
if the parent is changed and false
otherwise.java.lang.IllegalArgumentException
- null
SWTException
- abstract TCHAR windowClass()
abstract int windowProc()
int windowProc(int hwnd, int msg, int wParam, int lParam)
LRESULT WM_ACTIVATE(int wParam, int lParam)
LRESULT WM_CAPTURECHANGED(int wParam, int lParam)
LRESULT WM_CHANGEUISTATE(int wParam, int lParam)
LRESULT WM_CHAR(int wParam, int lParam)
LRESULT WM_CLEAR(int wParam, int lParam)
LRESULT WM_CLOSE(int wParam, int lParam)
LRESULT WM_COMMAND(int wParam, int lParam)
LRESULT WM_CONTEXTMENU(int wParam, int lParam)
LRESULT WM_CTLCOLOR(int wParam, int lParam)
LRESULT WM_CUT(int wParam, int lParam)
LRESULT WM_DESTROY(int wParam, int lParam)
LRESULT WM_DRAWITEM(int wParam, int lParam)
LRESULT WM_ENDSESSION(int wParam, int lParam)
LRESULT WM_ENTERIDLE(int wParam, int lParam)
LRESULT WM_ERASEBKGND(int wParam, int lParam)
LRESULT WM_GESTURE(int wParam, int lParam)
LRESULT WM_GETDLGCODE(int wParam, int lParam)
LRESULT WM_GETFONT(int wParam, int lParam)
LRESULT WM_GETOBJECT(int wParam, int lParam)
LRESULT WM_GETMINMAXINFO(int wParam, int lParam)
LRESULT WM_HOTKEY(int wParam, int lParam)
LRESULT WM_HELP(int wParam, int lParam)
LRESULT WM_HSCROLL(int wParam, int lParam)
LRESULT WM_IME_CHAR(int wParam, int lParam)
LRESULT WM_IME_COMPOSITION(int wParam, int lParam)
LRESULT WM_IME_COMPOSITION_START(int wParam, int lParam)
LRESULT WM_IME_ENDCOMPOSITION(int wParam, int lParam)
LRESULT WM_UNINITMENUPOPUP(int wParam, int lParam)
LRESULT WM_INITMENUPOPUP(int wParam, int lParam)
LRESULT WM_INPUTLANGCHANGE(int wParam, int lParam)
LRESULT WM_KEYDOWN(int wParam, int lParam)
LRESULT WM_KEYUP(int wParam, int lParam)
LRESULT WM_KILLFOCUS(int wParam, int lParam)
LRESULT WM_LBUTTONDBLCLK(int wParam, int lParam)
LRESULT WM_LBUTTONDOWN(int wParam, int lParam)
LRESULT WM_LBUTTONUP(int wParam, int lParam)
LRESULT WM_MBUTTONDBLCLK(int wParam, int lParam)
LRESULT WM_MBUTTONDOWN(int wParam, int lParam)
LRESULT WM_MBUTTONUP(int wParam, int lParam)
LRESULT WM_MEASUREITEM(int wParam, int lParam)
LRESULT WM_MENUCHAR(int wParam, int lParam)
LRESULT WM_MENUSELECT(int wParam, int lParam)
LRESULT WM_MOUSEACTIVATE(int wParam, int lParam)
LRESULT WM_MOUSEHOVER(int wParam, int lParam)
LRESULT WM_MOUSELEAVE(int wParam, int lParam)
LRESULT WM_MOUSEMOVE(int wParam, int lParam)
LRESULT WM_MOUSEWHEEL(int wParam, int lParam)
LRESULT WM_MOUSEHWHEEL(int wParam, int lParam)
LRESULT WM_MOVE(int wParam, int lParam)
LRESULT WM_NCACTIVATE(int wParam, int lParam)
LRESULT WM_NCCALCSIZE(int wParam, int lParam)
LRESULT WM_NCHITTEST(int wParam, int lParam)
LRESULT WM_NCLBUTTONDOWN(int wParam, int lParam)
LRESULT WM_NCPAINT(int wParam, int lParam)
LRESULT WM_NOTIFY(int wParam, int lParam)
LRESULT WM_PAINT(int wParam, int lParam)
LRESULT WM_PALETTECHANGED(int wParam, int lParam)
LRESULT WM_PARENTNOTIFY(int wParam, int lParam)
LRESULT WM_PASTE(int wParam, int lParam)
LRESULT WM_PRINT(int wParam, int lParam)
LRESULT WM_PRINTCLIENT(int wParam, int lParam)
LRESULT WM_QUERYENDSESSION(int wParam, int lParam)
LRESULT WM_QUERYNEWPALETTE(int wParam, int lParam)
LRESULT WM_QUERYOPEN(int wParam, int lParam)
LRESULT WM_RBUTTONDBLCLK(int wParam, int lParam)
LRESULT WM_RBUTTONDOWN(int wParam, int lParam)
LRESULT WM_RBUTTONUP(int wParam, int lParam)
LRESULT WM_SETCURSOR(int wParam, int lParam)
LRESULT WM_SETFOCUS(int wParam, int lParam)
LRESULT WM_SETTINGCHANGE(int wParam, int lParam)
LRESULT WM_SETFONT(int wParam, int lParam)
LRESULT WM_SETREDRAW(int wParam, int lParam)
LRESULT WM_SHOWWINDOW(int wParam, int lParam)
LRESULT WM_SIZE(int wParam, int lParam)
LRESULT WM_SYSCHAR(int wParam, int lParam)
LRESULT WM_SYSCOLORCHANGE(int wParam, int lParam)
LRESULT WM_SYSCOMMAND(int wParam, int lParam)
LRESULT WM_SYSKEYDOWN(int wParam, int lParam)
LRESULT WM_SYSKEYUP(int wParam, int lParam)
LRESULT WM_TABLET_FLICK(int wParam, int lParam)
LRESULT WM_TOUCH(int wParam, int lParam)
LRESULT WM_TIMER(int wParam, int lParam)
LRESULT WM_UNDO(int wParam, int lParam)
LRESULT WM_UPDATEUISTATE(int wParam, int lParam)
LRESULT WM_VSCROLL(int wParam, int lParam)
LRESULT WM_WINDOWPOSCHANGED(int wParam, int lParam)
LRESULT WM_WINDOWPOSCHANGING(int wParam, int lParam)
LRESULT WM_XBUTTONDBLCLK(int wParam, int lParam)
LRESULT WM_XBUTTONDOWN(int wParam, int lParam)
LRESULT WM_XBUTTONUP(int wParam, int lParam)
LRESULT wmColorChild(int wParam, int lParam)
LRESULT wmCommandChild(int wParam, int lParam)
LRESULT wmDrawChild(int wParam, int lParam)
LRESULT wmMeasureChild(int wParam, int lParam)
LRESULT wmScrollChild(int wParam, int lParam)