Class Control
- All Implemented Interfaces:
Drawable
- Direct Known Subclasses:
Button, Label, Link, ProgressBar, Sash, Scale, Scrollable, Slider
- Styles:
- BORDER
- LEFT_TO_RIGHT, RIGHT_TO_LEFT, FLIP_TEXT_DIRECTION
- Events:
- DragDetect, FocusIn, FocusOut, Help, KeyDown, KeyUp, MenuDetect, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, MouseWheel, MouseHorizontalWheel, MouseVerticalWheel, Move, Paint, Resize, Traverse
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Accessible(package private) booleanTrue if GTK has autoscaled this Control, meaning SWT does not need to do any manual scaling.(package private) int(package private) Image(package private) booleanCache the NO_BACKGROUND flag as it gets removed automatically in Composite.(package private) booleanFlag to check the scale factor upon the first drawing of this Control.(package private) String(package private) String(package private) Cursor(package private) static final boolean(package private) LinkedList<Event> (package private) long(package private) int(package private) boolean(package private) long(package private) long(package private) long(package private) long(package private) Font(package private) static Callback(package private) static Callback(package private) static Callback(package private) static Callback(package private) static Callback(package private) long(package private) Control(package private) PointPoint for storing the (x, y) coordinate of the last input (click/scroll/etc.).(package private) Object(package private) Menu(package private) static booleanBug 541635, 515396: GTK Wayland only flag to keep track whether mouse is currently pressed or released for DND.(package private) long(package private) Composite(package private) long(package private) long(package private) Region(package private) longThe handle to the Region, which is neccessary in the case thatregionis disposed before this Control.(package private) long(package private) String(package private) longFields inherited from class Widget
ACTIVATE, ACTIVATE_INVERSE, AUTO_TEXT_DIRECTION, BACKGROUND, BACKSPACE, BACKSPACE_INVERSE, BUTTON_PRESS_EVENT, BUTTON_PRESS_EVENT_INVERSE, BUTTON_RELEASE_EVENT, BUTTON_RELEASE_EVENT_INVERSE, CANVAS, CHANGE_VALUE, CHANGED, CHECK_SUBWINDOW, CLICKED, CLOSE_REQUEST, COMMIT, COMPUTE_SIZE, CONFIGURE_EVENT, COPY_CLIPBOARD, COPY_CLIPBOARD_INVERSE, CREATE_MENU_PROXY, CUT_CLIPBOARD, CUT_CLIPBOARD_INVERSE, data, DAY_SELECTED, DAY_SELECTED_DOUBLE_CLICK, DECELERATE, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_FROM_CURSOR, DELETE_FROM_CURSOR_INVERSE, DELETE_RANGE, DELETE_TEXT, DIRECTION_CHANGED, DISABLED, display, DISPOSE_SENT, DISPOSED, DPI_CHANGED, DRAG_DETECT, DRAW, ENTER, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPAND_COLLAPSE_CURSOR_ROW, EXPOSE_EVENT, EXPOSE_EVENT_INVERSE, FOCUS, FOCUS_IN, FOCUS_IN_EVENT, FOCUS_OUT, FOCUS_OUT_EVENT, FONT, FOREGROUND, FOREIGN_HANDLE, gdkSeatGrabPrepareFunc, GESTURE_PRESSED, GESTURE_RELEASED, GRAB_FOCUS, handle, HANDLE, HAS_AUTO_DIRECTION, HIDDEN, HIDE, ICON_RELEASE, IM_UPDATE, INPUT, INSERT_TEXT, IS_ACTIVE, KEY_CHECK_SUBWINDOW, KEY_GTK_CSS, KEY_PRESS_EVENT, KEY_PRESSED, KEY_RELEASE_EVENT, KEY_RELEASED, KEYED_DATA, LAST_SIGNAL, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, LEAVE, LEAVE_NOTIFY_EVENT, MAP, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MONTH_CHANGED, MOTION, MOTION_INVERSE, MOTION_NOTIFY_EVENT, MOTION_NOTIFY_EVENT_INVERSE, MOVE_CURSOR, MOVE_CURSOR_INVERSE, MOVE_FOCUS, MOVED, NOTIFY_DEFAULT_HEIGHT, NOTIFY_DEFAULT_WIDTH, NOTIFY_MAXIMIZED, NOTIFY_STATE, OBSCURED, OUTPUT, PARENT_BACKGROUND, PASTE_CLIPBOARD, PASTE_CLIPBOARD_INVERSE, POPPED_UP, POPULATE_POPUP, POPUP_MENU, PREEDIT_CHANGED, REALIZE, RELEASED, RESIZED, ROW_ACTIVATED, ROW_DELETED, ROW_HAS_CHILD_TOGGLED, ROW_INSERTED, SCROLL, SCROLL_BEGIN, SCROLL_CHILD, SCROLL_END, SCROLL_EVENT, SELECT, SELECTION_DONE, SHOW, SHOW_HELP, SIZE_ALLOCATE, SIZE_ALLOCATE_GTK4, SKIN_NEEDED, START_INTERACTIVE_SEARCH, state, STATUS_ICON_POPUP_MENU, style, STYLE_UPDATED, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TEXT_BUFFER_INSERT_TEXT, THEME_BACKGROUND, TOGGLED, UNMAP, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, WINDOW_STATE_EVENT, ZERO_HEIGHT, ZERO_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Accessible(package private) Shellprivate void_setBackground(Color color) voidaddControlListener(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 theControlListenerinterface.voidaddDragDetectListener(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 theDragDetectListenerinterface.voidaddFocusListener(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 theFocusListenerinterface.voidaddGestureListener(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 theGestureListenerinterface.voidaddHelpListener(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 theHelpListenerinterface.voidaddKeyListener(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 theKeyListenerinterface.voidaddMenuDetectListener(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 theMenuDetectListenerinterface.voidaddMouseListener(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 theMouseListenerinterface.voidaddMouseMoveListener(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 theMouseMoveListenerinterface.voidaddMouseTrackListener(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 theMouseTrackListenerinterface.voidaddMouseWheelListener(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 theMouseWheelListenerinterface.voidaddPaintListener(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 thePaintListenerinterface.(package private) voidaddRelation(Control control) voidaddTouchListener(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 theTouchListenerinterface.voidaddTraverseListener(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 theTraverseListenerinterface.(package private) voidadjustChildClipping(long widget) Allows Controls to adjust the clipping of themselves or their children.(package private) voidcairoClipRegion(long cairo) Convenience method that applies a region to the Control using cairo_clip.(package private) voidcairoCopyRegion(Region region) Copies the region at the Cairo level, as we need to re-use these resources after the Region object is disposed.(package private) void(package private) void(package private) void(package private) void(package private) void(package private) boolean(package private) void(package private) PointcomputeNativeSize(long h, int wHint, int hHint, boolean changed) computeSize(int wHint, int hHint) Returns the preferred size (in points) of the receiver.computeSize(int wHint, int hHint, boolean changed) Returns the preferred size (in points) of the receiver.(package private) PointcomputeSizeInPixels(int wHint, int hHint) (package private) PointcomputeSizeInPixels(int wHint, int hHint, boolean changed) (package private) Widget(package private) Widget[](package private) Controlprivate void(package private) booleancontainedInRegion(int x, int y) Convenience method for checking whether an (x, y) coordinate is in the set region.(package private) voidcreateWidget(int index) (package private) GdkRGBA(package private) Font(package private) void(package private) void(package private) booleandragDetect(int x, int y, boolean filter, boolean dragOnTimeout, boolean[] consume) (package private) booleandragDetect(int button, int count, int stateMask, int x, int y) booleandragDetect(MouseEvent event) Detects a drag and drop gesture.booleandragDetect(Event event) Detects a drag and drop gesture.(package private) voiddrawBackground(Control control, long gdkResource, long cr, int x, int y, int width, int height) (package private) booleandrawGripper(GC gc, int x, int y, int width, int height, boolean vertical) (package private) voiddrawWidget(GC gc) (package private) voidenableWidget(boolean enabled) (package private) long(package private) long(package private) long(package private) long(package private) booleanfilterKey(long event) (package private) Control(package private) Menu[](package private) voidfixChildren(Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu[] menus) (package private) void(package private) static intfixGdkEventTypeValues(int eventType) GdkEventType constants different on GTK4 and GTK3.(package private) voidfixModal(long group, long modalGroup) (package private) voidIn some situations, a control has a non-standard parent GdkWindow (Note gDk, not gTk).(package private) voidfixStyle()(package private) voidfixStyle(long handle) (package private) void(package private) long(package private) longbooleanForces the receiver to have the keyboard focus, causing all keyboard events to be delivered to it.(package private) booleanforceFocus(long focusHandle) (package private) void(package private) static voidgestureBeginProc(long gesture, long sequence, long user_data) (package private) static voidgestureEndProc(long gesture, long sequence, long user_data) (package private) longReturns the accessible object for the receiver.Returns the receiver's background color.(package private) GdkRGBAReturns the receiver's background image.(package private) GdkRGBA(package private) GdkRGBAintReturns the receiver's border width in points.(package private) intReturns a rectangle describing the receiver's size and location in points relative to its parent (or its display if its parent is null), unless the receiver is a shell.(package private) Rectangle(package private) int(package private) GdkRGBA(package private) GdkRGBA(package private) static ControlgetControl(long handle) (package private) PointGTK4 only function to replace gdk_surface_get_originReturns the receiver's cursor, or null if it has not been set.booleanReturnstrueif the receiver is detecting drag gestures, andfalseotherwise.booleanReturnstrueif the receiver is enabled, andfalseotherwise.getFont()Returns the font that the receiver will use to paint textual information.(package private) longReturns the foreground color that the receiver will use to draw.(package private) GdkRGBA(package private) PointReturns layout data which is associated with the receiver.Returns a point describing the receiver's location relative to its parent in points (or its display if its parent is null), unless the receiver is a shell.(package private) PointgetMenu()Returns the receiver's pop up menu if it has one, or null if it does not.Returns the receiver's monitor.intReturns the orientation of the receiver, which will be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.Returns the receiver's parent, which must be aCompositeor null when the receiver is a shell that was created with null or a display for a parent.(package private) Control[]getPath()Returns the region that defines the shape of the control, or null if the control has the default shape.getShell()Returns the receiver's shell.getSize()Returns a point describing the receiver's size in points.(package private) Point(package private) PointGets the position of the top left corner of the control in root window (display) coordinates.intReturns the text direction of the receiver, which will be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.(package private) PointgetThickness(long widget) Returns the receiver's tool tip text, or null if it has not been set.booleanReturnstrueif this control is set to send touch events, orfalseif it is set to send gesture events instead.booleanReturnstrueif the receiver is visible, andfalseotherwise.(package private) PointGets the position of the top left corner of the control in root window (display) coordinates.(package private) longgtk_button_press_event(long widget, long event) (package private) longgtk_button_press_event(long widget, long event, boolean sendMouseDown) (package private) longgtk_button_release_event(long widget, long event) (package private) longgtk_commit(long imcontext, long text) (package private) voidgtk_css_provider_load_from_css(long context, String css) (package private) longgtk_draw(long widget, long cairo) (package private) longgtk_enter_notify_event(long widget, long event) (package private) longgtk_focus(long widget, long directionType) (package private) longgtk_focus_in_event(long widget, long event) (package private) longgtk_focus_out_event(long widget, long event) (package private) intgtk_gesture_press_event(long gesture, int n_press, double x, double y, long event) Handling multi-press event on GTK4(package private) intgtk_gesture_release_event(long gesture, int n_press, double x, double y, long event) (package private) voidgtk_label_set_align(long label, float xAlign, float yAlign) (package private) longgtk_leave_notify_event(long widget, long event) (package private) longgtk_mnemonic_activate(long widget, long arg1) (package private) longgtk_motion_notify_event(long widget, long event) (package private) longgtk_preedit_changed(long imcontext) (package private) longgtk_realize(long widget) (package private) longgtk_scroll_event(long widget, long eventPtr) (package private) voidgtk_style_context_get_border(long context, int state, GtkBorder padding) (package private) voidgtk_style_context_get_padding(long context, int state, GtkBorder padding) (package private) longgtk_style_updated(long widget) (package private) longgtk_unrealize(long widget) (package private) static voidgtk_widget_reparent(Control control, long newParentHandle) Native gtkwidget re-parenting in SWT on Gtk3 needs to be handled in a special way because some controls have non-standard GdkWindow as parents.(package private) voidgtk_widget_set_align(long widget, int hAlign, int vAlign) Not direct gtk api, but useful to have them combined as they are usually called together.(package private) longgtk3_event_after(long widget, long gdkEvent) (package private) longgtk3_key_press_event(long widget, long event) (package private) longgtk3_key_release_event(long widget, long event) (package private) longgtk3_popup_menu(long widget) (package private) longgtk3_show_help(long widget, long helpType) (package private) void(package private) voidgtk4_enter_event(long controller, double x, double y, long event) (package private) voidgtk4_focus_enter_event(long controller, long event) (package private) voidgtk4_focus_leave_event(long controller, long event) (package private) voidgtk4_focus_window_event(long handle, long event) (package private) booleangtk4_key_press_event(long controller, int keyval, int keycode, int state, long event) (package private) voidgtk4_key_release_event(long controller, int keyval, int keycode, int state, long event) (package private) voidgtk4_leave_event(long controller, long event) (package private) voidgtk4_motion_event(long controller, double x, double y, long event) (package private) booleangtk4_scroll_event(long controller, double dx, double dy, long event) (package private) booleanhasFocus()(package private) voidprivate voidhookKeyboardAndFocusSignals(long focusHandle) private voidhookMouseSignals(long eventHandle) private void(package private) booleanprivate voidhookWidgetSignals(long focusHandle) (package private) longhoverProc(long widget) (package private) longimHandle()voidinternal_dispose_GC(long hDC, GCData data) Invokes platform specific functionality to dispose a GC handle.longinternal_new_GC(GCData data) Invokes platform specific functionality to allocate a new GC handle.(package private) booleanisActive()booleanReturnstrueiff coordinates can be auto-scaled on this drawable andfalseif not.(package private) booleanbooleanReturnstrueif the receiver is enabled and all ancestors up to and including the receiver's nearest ancestor shell are enabled.(package private) booleanisFocusAncestor(Control control) booleanReturnstrueif the receiver has the user-interface focus, andfalseotherwise.(package private) booleanisFocusHandle(long widget) booleanReturnstrueif the underlying operating system supports this reparenting, otherwisefalse(package private) boolean(package private) boolean(package private) booleanbooleanReturnstrueif the receiver is visible and all ancestors up to and including the receiver's nearest ancestor shell are visible.(package private) static voidmagnifyProc(long gesture, double zoom, long user_data) (package private) voidmarkLayout(boolean changed, boolean all) (package private) Decorations(package private) booleanmnemonicHit(char key) (package private) booleanmnemonicMatch(char key) voidMoves the receiver above the specified control in the drawing order.voidMoves the receiver below the specified control in the drawing order.(package private) voidmoveChildren(int oldWidth) (package private) voidmoveHandle(int x, int y) (package private) booleanWidgets with unusual bounds calculation behavior can override this method to returntrueif the widget must be visible during call tosetInitialBounds().voidpack()Causes the receiver to be resized to its preferred size.voidpack(boolean changed) Causes the receiver to be resized to its preferred size.(package private) long(package private) long(package private) longbooleanPrints the receiver and all children.(package private) voidprintWidget(GC gc, long drawable, int depth, int x, int y) (package private) voidprintWindow(boolean first, Control control, GC gc, long drawable, int depth, long window, int x, int y) voidredraw()Causes the entire bounds of the receiver to be marked as needing to be redrawn.(package private) voidredraw(boolean all) voidredraw(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) void(package private) voidredrawWidget(int x, int y, int width, int height, boolean redrawAll, boolean all, boolean trim) (package private) voidregister()(package private) voidrelease(boolean destroy) (package private) void(package private) void(package private) voidvoidremoveControlListener(ControlListener listener) Removes the listener from the collection of listeners who will be notified when the control is moved or resized.voidremoveDragDetectListener(DragDetectListener listener) Removes the listener from the collection of listeners who will be notified when a drag gesture occurs.voidremoveFocusListener(FocusListener listener) Removes the listener from the collection of listeners who will be notified when the control gains or loses focus.voidremoveGestureListener(GestureListener listener) Removes the listener from the collection of listeners who will be notified when gesture events are generated for the control.voidremoveHelpListener(HelpListener listener) Removes the listener from the collection of listeners who will be notified when the help events are generated for the control.voidremoveKeyListener(KeyListener listener) Removes the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.voidremoveMenuDetectListener(MenuDetectListener listener) Removes the listener from the collection of listeners who will be notified when the platform-specific context menu trigger has occurred.voidremoveMouseListener(MouseListener listener) Removes the listener from the collection of listeners who will be notified when mouse buttons are pressed and released.voidremoveMouseMoveListener(MouseMoveListener listener) Removes the listener from the collection of listeners who will be notified when the mouse moves.voidremoveMouseTrackListener(MouseTrackListener listener) Removes the listener from the collection of listeners who will be notified when the mouse passes or hovers over controls.voidremoveMouseWheelListener(MouseWheelListener listener) Removes the listener from the collection of listeners who will be notified when the mouse wheel is scrolled.voidremovePaintListener(PaintListener listener) Removes the listener from the collection of listeners who will be notified when the receiver needs to be painted.(package private) voidvoidremoveTouchListener(TouchListener listener) Removes the listener from the collection of listeners who will be notified when touch events occur.voidremoveTraverseListener(TraverseListener listener) Removes the listener from the collection of listeners who will be notified when traversal events occur.voidRequests that this control and all of its ancestors be repositioned by their layouts at the earliest opportunity.(package private) PointresizeCalculationsGTK3(long widget, int width, int height) (package private) voidresizeHandle(int width, int height) (package private) voidrestackWindow(long window, long sibling, boolean above) GTK3 only, do not call on GTK4.(package private) static voidrotateProc(long gesture, double angle, double angle_delta, long user_data) (package private) booleansendDragEvent(int button, int stateMask, int x, int y, boolean isStateMask) (package private) voidsendFocusEvent(int type) (package private) booleansendGestureEvent(int stateMask, int detail, int x, int y, double delta) (package private) booleansendGestureEvent(int stateMask, int detail, int x, int y, double xDirection, double yDirection) (package private) booleansendGestureEvent(int stateMask, int detail, int x, int y, double rotation, int xDirection, int yDirection, double magnification) (package private) booleansendHelpEvent(long helpType) (package private) boolean(package private) booleansendMouseEvent(int type, int button, int time, double x, double y, boolean is_hint, int state) (package private) booleansendMouseEvent(int type, int button, int count, int detail, boolean send, int time, double x, double y, boolean is_hint, int state) private booleansendOrPost(int type, Event event) (package private) voidvoidsetBackground(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.(package private) voidsetBackgroundGdkRGBA(long context, long handle, GdkRGBA rgba) (package private) voidsetBackgroundGdkRGBA(long handle, GdkRGBA rgba) (package private) voidsetBackgroundGdkRGBA(GdkRGBA rgba) voidsetBackgroundImage(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) voidsetBackgroundSurface(Image image) voidsetBounds(int x, int y, int width, int height) Sets the receiver's size and location in points to the rectangular area specified by the arguments.(package private) intsetBounds(int x, int y, int width, int height, boolean move, boolean resize) voidSets the receiver's size and location in points to the rectangular area specified by the argument.(package private) voidsetBoundsInPixels(int x, int y, int width, int height) (package private) voidsetBoundsInPixels(Rectangle rect) voidsetCapture(boolean capture) If the argument istrue, causes the receiver to have all mouse events delivered to it until the method is called withfalseas the argument.(package private) voidsetCursor(long cursor) voidSets 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.voidsetDragDetect(boolean dragDetect) Sets the receiver's drag detect state.private voidvoidsetEnabled(boolean enabled) Enables the receiver if the argument istrue, and disables it otherwise.booleansetFocus()Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.voidSets 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.(package private) voidsetFontDescription(long font) voidsetForeground(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) voidsetForegroundGdkRGBA(long handle, GdkRGBA rgba) (package private) voidsetForegroundGdkRGBA(GdkRGBA rgba) (package private) voidvoidsetLayoutData(Object layoutData) Sets the layout data associated with the receiver to the argument.voidsetLocation(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.voidsetLocation(Point location) Sets the receiver's location to the point specified by the argument which is relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell.(package private) voidsetLocationInPixels(int x, int y) (package private) voidsetLocationInPixels(Point location) voidSets the receiver's pop up menu to the argument.(package private) voidsetOrientation(boolean create) voidsetOrientation(int orientation) Sets the orientation of the receiver, which must be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.booleanChanges the parent of the widget to be the one provided.(package private) void(package private) voidsetParentGdkResource(Control child) (package private) booleansetRadioSelection(boolean value) voidsetRedraw(boolean redraw) If the argument isfalse, causes subsequent drawing operations in the receiver to be ignored.voidSets the shape of the control to the region specified by the argument.(package private) voidprivate void- TODO: Panning gesture requires a GtkOrientation object.
voidsetSize(int width, int height) Sets the receiver's size to the point specified by the arguments.voidSets the receiver's size to the point specified by the argument.(package private) voidsetSizeInPixels(int width, int height) (package private) voidsetSizeInPixels(Point size) (package private) booleansetTabItemFocus(boolean next) voidsetTextDirection(int textDirection) Sets the base text direction (a.k.a.voidsetToolTipText(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.(package private) voidsetToolTipText(Shell shell, String newString) voidsetTouchEnabled(boolean enabled) Sets whether this control should send touch events (by default controls do not).voidsetVisible(boolean visible) Marks the receiver as visible if the argument istrue, and marks it invisible otherwise.(package private) voidprivate void(package private) void(package private) void(package private) booleanshowMenu(int x, int y) (package private) booleanshowMenu(int x, int y, int detail) (package private) void(package private) voidsort(int[] items) (package private) static voidswipeProc(long gesture, double velocity_x, double velocity_y, long user_data) 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.Returns a point which is the result of converting the argument, which is specified in display relative coordinates, to coordinates relative to the receiver.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.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) PointtoDisplayInPixels(int x, int y) (package private) long(package private) booleantranslateMnemonic(int keyval, long event) (package private) booleantranslateMnemonic(Event event, Control control) (package private) booleantranslateTraversal(long event) (package private) inttraversalCode(int key, long event) booleantraverse(int traversal) Based on the argument, perform one of the expected platform traversal action.(package private) booleantraverse(int traversal, char character, int keyCode, int keyLocation, int stateMask, boolean doit) booleanPerforms a platform traversal action corresponding to aKeyDownevent.booleanPerforms a platform traversal action corresponding to aKeyDownevent.(package private) boolean(package private) boolean(package private) booleantraverseGroup(boolean next) (package private) booleantraverseItem(boolean next) (package private) booleantraverseMnemonic(char key) (package private) booleantraversePage(boolean next) (package private) booleanvoidupdate()Forces all outstanding paint requests for the widget to be processed before this method returns.(package private) voidupdate(boolean all, boolean flush) (package private) void(package private) voidupdateLayout(boolean all) (package private) boolean(package private) longwindowProc(long handle, long arg0, long user_data) Methods inherited from class Widget
_addListener, addDisposeListener, addListener, addTypedListener, cellDataProc, checkBits, checkOpen, checkOrientation, checkParent, checkSubclass, checkWidget, convertPangoFontDescriptionToCss, createHandle, cssHandle, dispose, dpiChanged, enterMotionProc, error, filterProc, filters, fixMnemonic, fixMnemonic, fixMnemonic, focusProc, fontHeight, gdk_event_free, gdk_event_get_state, gdk_event_get_surface_or_window, gdk_pointer_grab, gdk_pointer_ungrab, gdk_surface_get_size, gdk_window_get_size, GdkSeatGrabPrepareFunc, gesturePressReleaseProc, getData, getData, getDisplay, getListeners, getName, getNameText, getStyle, getTypedListeners, gtk_activate, gtk_adjustment_get, gtk_box_new, gtk_box_pack_end, gtk_box_set_child_packing, gtk_cell_renderer_get_preferred_size, gtk_change_value, gtk_changed, gtk_clicked, gtk_close_request, gtk_configure_event, gtk_container_get_border_width_or_margin, gtk_container_set_border_width, gtk_create_menu_proxy, gtk_day_selected, gtk_day_selected_double_click, gtk_delete_event, gtk_delete_range, gtk_delete_text, gtk_expand_collapse_cursor_row, gtk_grab_focus, gtk_hide, gtk_icon_release, gtk_input, gtk_insert_text, gtk_map, gtk_map_event, gtk_menu_popped_up, gtk_month_changed, gtk_move_focus, gtk_output, gtk_populate_popup, gtk_row_activated, gtk_row_has_child_toggled, gtk_scroll_child, gtk_select, gtk_selection_done, gtk_show, gtk_size_allocate, gtk_start_interactive_search, gtk_status_icon_popup_menu, gtk_switch_page, gtk_test_collapse_row, gtk_test_expand_row, gtk_text_buffer_insert_text, gtk_timer, gtk_toggled, gtk_tree_view_column_cell_get_position, gtk_unmap, gtk_unmap_event, gtk_value_changed, gtk_widget_get_preferred_size, gtk_widget_get_surface, gtk_widget_get_window, gtk_widget_hide, gtk_widget_show, gtk_widget_size_allocate, gtk_window_state_event, hooks, isAutoDirection, isDisposed, isListening, isValidSubclass, isValidThread, keyPressReleaseProc, leaveProc, mnemonicHit, mnemonicMatch, notifyCreationTracker, notifyDisposalTracker, notifyListeners, notifyProc, notifyState, postEvent, postEvent, releaseChildren, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, rendererGetPreferredWidthProc, rendererRenderProc, rendererSnapshotProc, reskin, reskinChildren, reskinWidget, scrollProc, sendEvent, sendEvent, sendEvent, sendEvent, sendIMKeyEvent, sendKeyEvent, sendSelectionEvent, sendSelectionEvent, setButtonState, setData, setData, setFontDescription, setInputState, setKeyState, setLocationState, setTabGroupFocus, setToolTipText, shellMapProc, sizeAllocateProc, sizeRequestProc, snapshotToDraw, timerProc, toString, translateTraversal, windowActiveProc, windowProc, windowProc, windowProc, windowProc
-
Field Details
-
DISABLE_EMOJI
static final boolean DISABLE_EMOJI -
fixedHandle
long fixedHandle -
firstFixedHandle
long firstFixedHandle -
keyController
long keyController -
redrawWindow
long redrawWindow -
enableWindow
long enableWindow -
provider
long provider -
drawCount
int drawCount -
backgroundAlpha
int backgroundAlpha -
dragGesture
long dragGesture -
zoomGesture
long zoomGesture -
rotateGesture
long rotateGesture -
panGesture
long panGesture -
parent
Composite parent -
cursor
Cursor cursor -
backgroundImage
Image backgroundImage -
font
Font font -
region
Region region -
eventRegion
long eventRegion -
regionHandle
long regionHandleThe handle to the Region, which is neccessary in the case thatregionis disposed before this Control. -
toolTipText
String toolTipText -
layoutData
Object layoutData -
accessible
Accessible accessible -
labelRelation
Control labelRelation -
cssBackground
String cssBackground -
cssForeground
String cssForeground -
drawRegion
boolean drawRegion -
cachedNoBackground
boolean cachedNoBackgroundCache the NO_BACKGROUND flag as it gets removed automatically in Composite. Only relevant for GTK3.10+ as we need it for Cairo setRegion() functionality. See bug 475784. -
lastInput
Point lastInputPoint for storing the (x, y) coordinate of the last input (click/scroll/etc.). This is useful for checking input event coordinates in methods that act on input, but do not receive coordinates (like gtk_clicked, for example). See bug 529431. -
dragDetectionQueue
LinkedList<Event> dragDetectionQueue -
gestureZoom
-
gestureRotation
-
gestureSwipe
-
gestureBegin
-
gestureEnd
-
mouseDown
static boolean mouseDownBug 541635, 515396: GTK Wayland only flag to keep track whether mouse is currently pressed or released for DND. -
checkScaleFactor
boolean checkScaleFactorFlag to check the scale factor upon the first drawing of this Control. This is done by checking the scale factor of the Cairo surface in gtk_draw(). Doing so provides an accurate scale factor, and will determine if this Control needs to be scaled manually by SWT. See bug 507020. -
autoScale
boolean autoScaleTrue if GTK has autoscaled this Control, meaning SWT does not need to do any manual scaling. See bug 507020.
-
-
Constructor Details
-
Control
Control() -
Control
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.The style value is either one of the style constants defined in class
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
parent- a composite control which will be the parent of the new instance (cannot be null)style- the style of control to construct- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
- See Also:
-
-
Method Details
-
defaultFont
Font defaultFont() -
defaultBackground
GdkRGBA defaultBackground() -
deregister
void deregister()- Overrides:
deregisterin classWidget
-
drawBackground
void drawBackground(Control control, long gdkResource, long cr, int x, int y, int width, int height) -
drawGripper
-
drawWidget
-
enableWidget
void enableWidget(boolean enabled) -
enterExitHandle
long enterExitHandle() -
eventHandle
long eventHandle() -
eventWindow
long eventWindow() -
eventSurface
long eventSurface() -
fixGdkEventTypeValues
static int fixGdkEventTypeValues(int eventType) GdkEventType constants different on GTK4 and GTK3. This checks for GTK versions and return the correct constants defined in GDK.java- Returns:
- constant defined
-
fixFocus
-
fixStyle
void fixStyle() -
fixStyle
void fixStyle(long handle) -
focusHandle
long focusHandle() -
fontHandle
long fontHandle() -
gestureHandle
long gestureHandle() -
getOrientation
public int getOrientation()Returns the orientation of the receiver, which will be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.- Returns:
- the orientation style
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.7
-
getTextDirection
public int getTextDirection()Returns the text direction of the receiver, which will be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.- Returns:
- the text direction style
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.102
-
hasFocus
boolean hasFocus() -
hookEvents
void hookEvents()- Overrides:
hookEventsin classWidget
-
hookKeyboardAndFocusSignals
private void hookKeyboardAndFocusSignals(long focusHandle) -
hookMouseSignals
private void hookMouseSignals(long eventHandle) -
hookWidgetSignals
private void hookWidgetSignals(long focusHandle) -
hookPaintSignals
private void hookPaintSignals() -
connectIMSignals
private void connectIMSignals() -
hooksPaint
boolean hooksPaint() -
hoverProc
-
topHandle
-
paintHandle
long paintHandle() -
paintWindow
long paintWindow()- Overrides:
paintWindowin classWidget
-
paintSurface
long paintSurface()- Overrides:
paintSurfacein classWidget
-
print
Prints the receiver and all children.- Parameters:
gc- the gc where the drawing occurs- Returns:
trueif the operation was successful andfalseotherwise- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the gc is null
- ERROR_INVALID_ARGUMENT - if the gc has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.4
-
printWidget
-
printWindow
-
computeSize
Returns the preferred size (in points) of the receiver.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.DEFAULTis passed for the hint.- Parameters:
wHint- the width hint (can beSWT.DEFAULT)hHint- the height hint (can beSWT.DEFAULT)- Returns:
- the preferred size of the control
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
computeSizeInPixels
-
computeTabGroup
Widget computeTabGroup() -
computeTabList
Widget[] computeTabList() -
computeTabRoot
Control computeTabRoot() -
checkBuffered
void checkBuffered() -
checkBackground
void checkBackground() -
checkBorder
void checkBorder() -
checkMirrored
void checkMirrored() -
containedInRegion
boolean containedInRegion(int x, int y) Convenience method for checking whether an (x, y) coordinate is in the set region. Only relevant for GTK3.10+.- Parameters:
x- an x coordinatey- a y coordinate- Returns:
- true if the coordinate (x, y) is in the region, false otherwise
-
createWidget
void createWidget(int index) - Overrides:
createWidgetin classWidget
-
computeSize
Returns the preferred size (in points) of the receiver.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.DEFAULTis 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 befalse, so layout manager caches can be retained.- Parameters:
wHint- the width hint (can beSWT.DEFAULT)hHint- the height hint (can beSWT.DEFAULT)changed-trueif the control's contents have changed, andfalseotherwise- Returns:
- the preferred size of the control.
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
computeSizeInPixels
-
computeNativeSize
-
forceResize
void forceResize() -
getAccessible
Returns the accessible object for the receiver.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.
- Returns:
- the accessible object
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 2.0
- See Also:
-
_getAccessible
Accessible _getAccessible() -
getBounds
Returns a rectangle describing the receiver's size and location in points relative to its parent (or its display if its parent is null), unless the receiver is a shell. In this case, the location is relative to the display.- Returns:
- the receiver's bounding rectangle
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getBoundsInPixels
Rectangle getBoundsInPixels() -
setBounds
Sets the receiver's size and location in points to the rectangular area specified by the argument. Thexandyfields 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.
Note: On GTK, attempting to set the width or height of the receiver to a number higher or equal 2^14 will cause them to be set to (2^14)-1 instead.
- Parameters:
rect- the new bounds for the receiver- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setBoundsInPixels
-
setBounds
public void setBounds(int x, int y, int width, int height) Sets the receiver's size and location in points to the rectangular area specified by the arguments. Thexandyarguments are relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell. In this case, thexandyarguments 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.
Note: On GTK, attempting to set the width or height of the receiver to a number higher or equal 2^14 will cause them to be set to (2^14)-1 instead.
- Parameters:
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 receiver- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setBoundsInPixels
void setBoundsInPixels(int x, int y, int width, int height) -
markLayout
void markLayout(boolean changed, boolean all) -
moveHandle
void moveHandle(int x, int y) -
resizeHandle
void resizeHandle(int width, int height) -
resizeCalculationsGTK3
-
setBounds
int setBounds(int x, int y, int width, int height, boolean move, boolean resize) -
getLocation
Returns a point describing the receiver's location relative to its parent in points (or its display if its parent is null), unless the receiver is a shell. In this case, the point is usually relative to the display.Warning: When executing this operation on a shell, it may not yield a value with the expected meaning on some platforms. For example, executing this operation on a shell when the environment uses the Wayland protocol, the result is not a coordinate relative to the display. It will not change when moving the shell.
- Returns:
- the receiver's location
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getLocationInPixels
Point getLocationInPixels() -
setLocation
Sets the receiver's location to the point specified by the argument which is relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell. In this case, the point is relative to the display.Warning: When executing this operation on a shell, it may not have the intended effect on some platforms. For example, executing this operation on a shell when the environment uses the Wayland protocol, nothing will happen.
- Parameters:
location- the new location for the receiver- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setLocationInPixels
-
setLocation
public 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. In this case, the point is relative to the display.Warning: When executing this operation on a shell, it may not have the intended effect on some platforms. For example, executing this operation on a shell when the environment uses the Wayland protocol, nothing will happen.
- Parameters:
x- the new x coordinate for the receivery- the new y coordinate for the receiver- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setLocationInPixels
void setLocationInPixels(int x, int y) -
getSize
Returns a point describing the receiver's size in points. The x coordinate of the result is the width of the receiver. The y coordinate of the result is the height of the receiver.- Returns:
- the receiver's size
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getSizeInPixels
Point getSizeInPixels() -
setSize
Sets the receiver's size to the point specified by the argument.Note: Attempting to set the width or height of the receiver to a negative number will cause them to be set to zero instead.
Note: On GTK, attempting to set the width or height of the receiver to a number higher or equal 2^14 will cause them to be set to (2^14)-1 instead.
- Parameters:
size- the new size in points for the receiver- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the point is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setSizeInPixels
-
setRegion
Sets the shape of the control to the region specified by the argument. When the argument is null, the default shape of the control is restored.- Parameters:
region- the region that defines the shape of the control (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the region has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.4
-
setRelations
void setRelations() -
setSize
public void setSize(int width, int height) Sets the receiver's size to the point specified by the arguments.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.
Note: On GTK, attempting to set the width or height of the receiver to a number higher or equal 2^14 will cause them to be set to (2^14)-1 instead.
- Parameters:
width- the new width in points for the receiverheight- the new height in points for the receiver- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setSizeInPixels
void setSizeInPixels(int width, int height) -
isActive
-
isAutoScalable
public boolean isAutoScalable()Description copied from interface:DrawableReturnstrueiff coordinates can be auto-scaled on this drawable andfalseif not. E.g. aGCmethod should not auto-scale the bounds of a figure drawn on a Printer device, but it may have to auto-scale when drawing on a high-DPI Display monitor.- Specified by:
isAutoScalablein interfaceDrawable- Returns:
trueif auto-scaling is enabled for this drawable
-
isDescribedByLabel
boolean isDescribedByLabel() -
isFocusHandle
boolean isFocusHandle(long widget) -
moveAbove
Moves the receiver above the specified control in the drawing order. If the argument is null, then the receiver is moved to the top of the drawing order. The control at the top of the drawing order will not be covered by other controls even if they occupy intersecting areas.- Parameters:
control- the sibling control (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the control has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
moveBelow
Moves the receiver below the specified control in the drawing order. If the argument is null, then the receiver is moved to the bottom of the drawing order. The control at the bottom of the drawing order will be covered by all other controls which occupy intersecting areas.- Parameters:
control- the sibling control (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the control has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
moveChildren
void moveChildren(int oldWidth) -
pack
public void pack()Causes the receiver to be resized to its preferred size. For a composite, this involves computing the preferred size from its layout, if there is one.- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
pack
public void pack(boolean changed) Causes the receiver to be resized to its preferred size. For a composite, this involves computing the preferred size from its layout, if there is one.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 befalse, so layout manager caches can be retained.- Parameters:
changed- whether or not the receiver's contents have changed- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
setLayoutData
Sets the layout data associated with the receiver to the argument.- Parameters:
layoutData- the new layout data for the receiver.- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
toControl
Returns a point which is the result of converting the argument, which is specified in display relative coordinates, to coordinates relative to the receiver.NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use
Display.map(Control, Control, Rectangle).- Parameters:
x- the x coordinate in points to be translatedy- the y coordinate in points to be translated- Returns:
- the translated coordinates
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 2.1
-
toControl
Returns a point which is the result of converting the argument, which is specified in display relative coordinates, to coordinates relative to the receiver.NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use
Display.map(Control, Control, Rectangle).- Parameters:
point- the point to be translated (must not be null)- Returns:
- the translated coordinates
- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the point is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
toDisplay
Returns a point which is the result of converting the argument, which is specified in coordinates relative to the receiver, to display relative coordinates.NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use
Display.map(Control, Control, Rectangle).- Parameters:
x- the x coordinate to be translatedy- the y coordinate to be translated- Returns:
- the translated coordinates
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 2.1
-
toDisplayInPixels
-
toDisplay
Returns a point which is the result of converting the argument, which is specified in coordinates relative to the receiver, to display relative coordinates.NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use
Display.map(Control, Control, Rectangle).- Parameters:
point- the point to be translated (must not be null)- Returns:
- the translated coordinates
- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the point is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getControlOrigin
Point getControlOrigin()GTK4 only function to replace gdk_surface_get_origin- Returns:
- the origin of the Control's SWTFixed container relative to the Shell
-
addControlListener
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 theControlListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
addDragDetectListener
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 theDragDetectListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
- See Also:
-
addFocusListener
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 theFocusListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
addGestureListener
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 theGestureListenerinterface.NOTE: If
setTouchEnabled(true)has previously been invoked on the receiver thensetTouchEnabled(false)must be invoked on it to specify that gesture events should be sent instead of touch events.Warning: This API is currently only implemented on Windows and Cocoa. SWT doesn't send Gesture or Touch events on GTK.
- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.7
- See Also:
-
addHelpListener
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 theHelpListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
addKeyListener
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 theKeyListenerinterface.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.
- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
addMenuDetectListener
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 theMenuDetectListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
- See Also:
-
addMouseListener
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 theMouseListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
addMouseMoveListener
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 theMouseMoveListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
addMouseTrackListener
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 theMouseTrackListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
addMouseWheelListener
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 theMouseWheelListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
- See Also:
-
addPaintListener
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 thePaintListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
adjustChildClipping
void adjustChildClipping(long widget) Allows Controls to adjust the clipping of themselves or their children.- Parameters:
widget- the handle to the widget
-
addRelation
-
addTouchListener
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 theTouchListenerinterface.NOTE: You must also call
setTouchEnabled(true)to specify that touch events should be sent, which will cause gesture events to not be sent.Warning: This API is currently only implemented on Windows and Cocoa. SWT doesn't send Gesture or Touch events on GTK.
- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.7
- See Also:
-
addTraverseListener
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 theTraverseListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeControlListener
Removes the listener from the collection of listeners who will be notified when the control is moved or resized.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeDragDetectListener
Removes the listener from the collection of listeners who will be notified when a drag gesture occurs.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
- See Also:
-
removeFocusListener
Removes the listener from the collection of listeners who will be notified when the control gains or loses focus.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeGestureListener
Removes the listener from the collection of listeners who will be notified when gesture events are generated for the control.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.7
- See Also:
-
removeHelpListener
Removes the listener from the collection of listeners who will be notified when the help events are generated for the control.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeKeyListener
Removes the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeMenuDetectListener
Removes the listener from the collection of listeners who will be notified when the platform-specific context menu trigger has occurred.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
- See Also:
-
removeMouseListener
Removes the listener from the collection of listeners who will be notified when mouse buttons are pressed and released.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeMouseMoveListener
Removes the listener from the collection of listeners who will be notified when the mouse moves.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeMouseTrackListener
Removes the listener from the collection of listeners who will be notified when the mouse passes or hovers over controls.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeMouseWheelListener
Removes the listener from the collection of listeners who will be notified when the mouse wheel is scrolled.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
- See Also:
-
removePaintListener
Removes the listener from the collection of listeners who will be notified when the receiver needs to be painted.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
removeRelation
void removeRelation() -
removeTouchListener
Removes the listener from the collection of listeners who will be notified when touch events occur.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.7
- See Also:
-
removeTraverseListener
Removes the listener from the collection of listeners who will be notified when traversal events occur.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
dragDetect
Detects a drag and drop gesture. This method is used to detect a drag gesture when called from within a mouse down listener.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
setDragDetectto disable the default detection, listen for mouse down, and then calldragDetect()from within the listener to conditionally detect a drag.- Parameters:
event- the mouse down event- Returns:
trueif the gesture occurred, andfalseotherwise.- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT if the event is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
- See Also:
-
dragDetect
Detects a drag and drop gesture. This method is used to detect a drag gesture when called from within a mouse down listener.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
setDragDetectto disable the default detection, listen for mouse down, and then calldragDetect()from within the listener to conditionally detect a drag.- Parameters:
event- the mouse down event- Returns:
trueif the gesture occurred, andfalseotherwise.- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT if the event is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
- See Also:
-
dragDetect
boolean dragDetect(int button, int count, int stateMask, int x, int y) -
dragDetect
boolean dragDetect(int x, int y, boolean filter, boolean dragOnTimeout, boolean[] consume) -
filterKey
boolean filterKey(long event) -
findBackgroundControl
Control findBackgroundControl() -
findMenus
-
fixChildren
void fixChildren(Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu[] menus) -
fixParentGdkResource
void fixParentGdkResource()In some situations, a control has a non-standard parent GdkWindow (Note gDk, not gTk). E.g, an TreeEditor who's parent is a Tree should have the Tree Viewer's inner bin as parent window. Note, composites should treat this differently and take child controls into consideration. -
gtk_widget_reparent
Native gtkwidget re-parenting in SWT on Gtk3 needs to be handled in a special way because some controls have non-standard GdkWindow as parents. (E.g ControlEditors), and other controls like TabItem and ExpandBar use reparenting to preserve proper hierarchy for correct event traversal (like dnd). Note, GdkWindows != GtkWindows. You should never call gtk_widget_reparent() directly or reparent widgets outside this method, otherwise you can break TabItem/TreeEditors.- Parameters:
control- that should be reparented.newParentHandle- pointer/handle to the new GtkWidget parent.
-
fixModal
void fixModal(long group, long modalGroup) -
forceFocus
public boolean forceFocus()Forces the receiver to have the keyboard focus, causing all keyboard events to be delivered to it.- Returns:
trueif the control got focus, andfalseif it was unable to.- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
forceFocus
boolean forceFocus(long focusHandle) -
getBackground
Returns the receiver's background color.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.
- Returns:
- the background color
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getBackgroundGdkRGBA
GdkRGBA getBackgroundGdkRGBA() -
getBackgroundImage
Returns the receiver's background image.- Returns:
- the background image
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.2
-
getContextBackgroundGdkRGBA
GdkRGBA getContextBackgroundGdkRGBA() -
getContextColorGdkRGBA
GdkRGBA getContextColorGdkRGBA() -
getBgGdkRGBA
GdkRGBA getBgGdkRGBA() -
getBaseGdkRGBA
GdkRGBA getBaseGdkRGBA() -
getBorderWidth
public int getBorderWidth()Returns the receiver's border width in points.- Returns:
- the border width
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getBorderWidthInPixels
int getBorderWidthInPixels() -
getClientWidth
int getClientWidth() -
getCursor
Returns the receiver's cursor, or null if it has not been set.When the mouse pointer passes over a control its appearance is changed to match the control's cursor.
- Returns:
- the receiver's cursor or
null - Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
-
getDragDetect
public boolean getDragDetect()Returnstrueif the receiver is detecting drag gestures, andfalseotherwise.- Returns:
- the receiver's drag detect state
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
-
getEnabled
public boolean getEnabled()Returnstrueif the receiver is enabled, andfalseotherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.- Returns:
- the receiver's enabled state
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
getFont
Returns the font that the receiver will use to paint textual information.- Returns:
- the receiver's font
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getFontDescription
long getFontDescription()- Returns:
- A newly allocated
PangoFontDescription*, caller must free it withOS.pango_font_description_free(long).
-
getForeground
Returns the foreground color that the receiver will use to draw.- Returns:
- the receiver's foreground color
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getForegroundGdkRGBA
GdkRGBA getForegroundGdkRGBA() -
getIMCaretPos
Point getIMCaretPos() -
getLayoutData
Returns layout data which is associated with the receiver.- Returns:
- the receiver's layout data
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getMenu
Returns the receiver's pop up menu if it has one, or null if it does not. All controls may optionally have a pop up menu that is displayed when the user requests one for the control. The sequence of key strokes, button presses and/or button releases that are used to request a pop up menu is platform specific.- Returns:
- the receiver's menu
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getMonitor
Returns the receiver's monitor.- Returns:
- the receiver's monitor
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.0
-
getParent
Returns the receiver's parent, which must be aCompositeor null when the receiver is a shell that was created with null or a display for a parent.- Returns:
- the receiver's parent
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getPath
Control[] getPath() -
getRegion
Returns the region that defines the shape of the control, or null if the control has the default shape.- Returns:
- the region that defines the shape of the shell (or null)
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.4
-
getShell
Returns the receiver's shell. For all controls other than shells, this simply returns the control's nearest ancestor shell. Shells return themselves, even if they are children of other shells.- Returns:
- the receiver's shell
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
_getShell
Shell _getShell() -
getToolTipText
Returns the receiver's tool tip text, or null if it has not been set.- Returns:
- the receiver's tool tip text
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getTouchEnabled
public boolean getTouchEnabled()Returnstrueif this control is set to send touch events, orfalseif it is set to send gesture events instead. This method also returnsfalseif a touch-based input device is not detected (this can be determined withDisplay#getTouchEnabled()). UsesetTouchEnabled(boolean)to switch the events that a control sends between touch events and gesture events.- Returns:
trueif the control is set to send touch events, orfalseotherwise- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.7
- See Also:
-
getVisible
public boolean getVisible()Returnstrueif the receiver is visible, andfalseotherwise.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.
- Returns:
- the receiver's visibility state
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getThickness
-
gtk_style_context_get_padding
-
gtk_style_context_get_border
-
gtk_gesture_press_event
int gtk_gesture_press_event(long gesture, int n_press, double x, double y, long event) Handling multi-press event on GTK4- Overrides:
gtk_gesture_press_eventin classWidget- Parameters:
gesture- the corresponding controller responsible for capturing the eventn_press- how many touch/button presses happened with this onex- the x coordinate, in widget allocation coordinatesy- the y coordinate, in widget allocation coordinatesevent- the GdkEvent captured
-
gtk_gesture_release_event
int gtk_gesture_release_event(long gesture, int n_press, double x, double y, long event) - Overrides:
gtk_gesture_release_eventin classWidget- Parameters:
gesture- the corresponding controller responsible for capturing the eventn_press- how many touch/button presses happened with this onex- the x coordinate, in widget allocation coordinatesy- the y coordinate, in widget allocation coordinatesevent- the GdkEvent captured
-
gtk_button_press_event
long gtk_button_press_event(long widget, long event) - Overrides:
gtk_button_press_eventin classWidget
-
wantDragDropDetection
boolean wantDragDropDetection() -
gtk_button_press_event
long gtk_button_press_event(long widget, long event, boolean sendMouseDown) -
gtk_button_release_event
long gtk_button_release_event(long widget, long event) - Overrides:
gtk_button_release_eventin classWidget
-
gtk_commit
long gtk_commit(long imcontext, long text) - Overrides:
gtk_commitin classWidget
-
gtk4_enter_event
void gtk4_enter_event(long controller, double x, double y, long event) - Overrides:
gtk4_enter_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventx- x coordinate of pointer locationy- y coordinate of pointer locationevent- the GdkEvent captured
-
gtk_enter_notify_event
long gtk_enter_notify_event(long widget, long event) - Overrides:
gtk_enter_notify_eventin classWidget
-
checkSubwindow
boolean checkSubwindow() -
gtk3_event_after
long gtk3_event_after(long widget, long gdkEvent) - Overrides:
gtk3_event_afterin classWidget
-
cairoCopyRegion
Copies the region at the Cairo level, as we need to re-use these resources after the Region object is disposed.- Parameters:
region- the Region object to copy to this Control
-
cairoDisposeRegion
void cairoDisposeRegion() -
cairoClipRegion
void cairoClipRegion(long cairo) Convenience method that applies a region to the Control using cairo_clip.- Parameters:
cairo- the cairo context to apply the region to
-
gtk4_draw
-
gtk_draw
-
gtk_focus
-
gtk_focus_in_event
long gtk_focus_in_event(long widget, long event) - Overrides:
gtk_focus_in_eventin classWidget
-
gtk4_focus_enter_event
void gtk4_focus_enter_event(long controller, long event) - Overrides:
gtk4_focus_enter_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventevent- the GdkEvent captured
-
gtk4_focus_window_event
void gtk4_focus_window_event(long handle, long event) - Overrides:
gtk4_focus_window_eventin classWidget- Parameters:
handle- the handle of the window that caused the eventevent- the type of event, should be FocusIn or FocusOut
-
gtk_focus_out_event
long gtk_focus_out_event(long widget, long event) - Overrides:
gtk_focus_out_eventin classWidget
-
gtk4_focus_leave_event
void gtk4_focus_leave_event(long controller, long event) - Overrides:
gtk4_focus_leave_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventevent- the GdkEvent captured
-
gtk4_key_press_event
boolean gtk4_key_press_event(long controller, int keyval, int keycode, int state, long event) - Overrides:
gtk4_key_press_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventkeyval- the pressed keykeycode- raw code of the pressed keystate- the bitmask, representing the state of the modifier keys and pointer buttonsevent- the GdkEvent captured- Returns:
- TRUE if the event has been fully/properly handled, otherwise FALSE
-
gtk3_key_press_event
long gtk3_key_press_event(long widget, long event) - Overrides:
gtk3_key_press_eventin classWidget
-
gtk4_key_release_event
void gtk4_key_release_event(long controller, int keyval, int keycode, int state, long event) - Overrides:
gtk4_key_release_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventkeyval- the released keykeycode- raw code of the released keystate- the bitmask, representing the state of the modifier keys and pointer buttonsevent- the GdkEvent captured
-
gtk3_key_release_event
long gtk3_key_release_event(long widget, long event) - Overrides:
gtk3_key_release_eventin classWidget
-
gtk4_leave_event
void gtk4_leave_event(long controller, long event) - Overrides:
gtk4_leave_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventevent- the GdkEvent captured
-
gtk_leave_notify_event
long gtk_leave_notify_event(long widget, long event) - Overrides:
gtk_leave_notify_eventin classWidget
-
gtk_mnemonic_activate
long gtk_mnemonic_activate(long widget, long arg1) - Overrides:
gtk_mnemonic_activatein classWidget
-
gtk4_motion_event
void gtk4_motion_event(long controller, double x, double y, long event) - Overrides:
gtk4_motion_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventx- the x coordinatey- the y coordinateevent- the GdkEvent captured
-
gtk_motion_notify_event
long gtk_motion_notify_event(long widget, long event) - Overrides:
gtk_motion_notify_eventin classWidget
-
gtk_preedit_changed
long gtk_preedit_changed(long imcontext) - Overrides:
gtk_preedit_changedin classWidget
-
gtk_realize
long gtk_realize(long widget) - Overrides:
gtk_realizein classWidget
-
gtk4_scroll_event
boolean gtk4_scroll_event(long controller, double dx, double dy, long event) - Overrides:
gtk4_scroll_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventdx- x deltady- y deltaevent- the GdkEvent captured- Returns:
- TRUE if the scroll event was handled, FALSE otherwise
-
gtk_scroll_event
long gtk_scroll_event(long widget, long eventPtr) - Overrides:
gtk_scroll_eventin classWidget
-
gtk3_show_help
long gtk3_show_help(long widget, long helpType) - Overrides:
gtk3_show_helpin classWidget
-
gtk_style_updated
long gtk_style_updated(long widget) - Overrides:
gtk_style_updatedin classWidget
-
gtk_unrealize
long gtk_unrealize(long widget) - Overrides:
gtk_unrealizein classWidget
-
internal_new_GC
Invokes platform specific functionality to allocate a new GC handle.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.- Specified by:
internal_new_GCin interfaceDrawable- Parameters:
data- the platform specific GC data- Returns:
- the platform specific GC handle
-
imHandle
long imHandle() -
internal_dispose_GC
Invokes platform specific functionality to dispose a GC handle.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.- Specified by:
internal_dispose_GCin interfaceDrawable- Parameters:
hDC- the platform specific GC handledata- the platform specific GC data
-
isReparentable
public boolean isReparentable()Returnstrueif the underlying operating system supports this reparenting, otherwisefalse- Returns:
trueif the widget can be reparented, otherwisefalse- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
isShowing
boolean isShowing() -
isTabGroup
boolean isTabGroup() -
isTabItem
boolean isTabItem() -
isEnabled
public boolean isEnabled()Returnstrueif the receiver is enabled and all ancestors up to and including the receiver's nearest ancestor shell are enabled. Otherwise,falseis returned. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.- Returns:
- the receiver's enabled state
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
isFocusAncestor
-
isFocusControl
public boolean isFocusControl()Returnstrueif the receiver has the user-interface focus, andfalseotherwise.- Returns:
- the receiver's focus state
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
isVisible
public boolean isVisible()Returnstrueif the receiver is visible and all ancestors up to and including the receiver's nearest ancestor shell are visible. Otherwise,falseis returned.- Returns:
- the receiver's visibility state
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
mnemonicHit
boolean mnemonicHit(char key) -
mnemonicMatch
boolean mnemonicMatch(char key) -
register
-
requestLayout
public void requestLayout()Requests that this control and all of its ancestors be repositioned by their layouts at the earliest opportunity. This should be invoked after modifying the control in order to inform any dependent layouts of the change.The control will not be repositioned synchronously. This method is fast-running and only marks the control for future participation in a deferred layout.
Invoking this method multiple times before the layout occurs is an inexpensive no-op.
- Since:
- 3.105
-
redraw
public void redraw()Causes the entire bounds of the receiver to be marked as needing to be redrawn. The next time a paint request is processed, the control will be completely painted, including the background.Schedules a paint request if the invalidated area is visible or becomes visible later. It is not necessary for the caller to explicitly call
update()after calling this method, but depending on the platform, the automatic repaints may be delayed considerably.- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
redraw
void redraw(boolean all) -
redraw
public 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. The next time a paint request is processed, that area of the receiver will be painted, including the background. If theallflag istrue, any children of the receiver which intersect with the specified area will also paint their intersecting areas. If theallflag isfalse, the children will not be painted.Schedules a paint request if the invalidated area is visible or becomes visible later. It is not necessary for the caller to explicitly call
update()after calling this method, but depending on the platform, the automatic repaints may be delayed considerably.- Parameters:
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-trueif children should redraw, andfalseotherwise- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
redrawChildren
void redrawChildren() -
redrawWidget
void redrawWidget(int x, int y, int width, int height, boolean redrawAll, boolean all, boolean trim) -
release
-
releaseHandle
void releaseHandle()- Overrides:
releaseHandlein classWidget
-
releaseParent
void releaseParent()- Overrides:
releaseParentin classWidget
-
releaseWidget
void releaseWidget()- Overrides:
releaseWidgetin classWidget
-
destroyWidget
void destroyWidget()- Overrides:
destroyWidgetin classWidget
-
restackWindow
void restackWindow(long window, long sibling, boolean above) GTK3 only, do not call on GTK4.- Parameters:
window- a GdkWindowsibling- the sibling thereof, or 0above- a boolean setting for whether the window should be raised or lowered
-
flushQueueOnDnd
void flushQueueOnDnd() -
sendDragEvent
boolean sendDragEvent(int button, int stateMask, int x, int y, boolean isStateMask) -
sendFocusEvent
void sendFocusEvent(int type) -
sendGestureEvent
boolean sendGestureEvent(int stateMask, int detail, int x, int y, double delta) -
sendGestureEvent
boolean sendGestureEvent(int stateMask, int detail, int x, int y, double xDirection, double yDirection) -
sendGestureEvent
boolean sendGestureEvent(int stateMask, int detail, int x, int y, double rotation, int xDirection, int yDirection, double magnification) -
sendHelpEvent
boolean sendHelpEvent(long helpType) -
sendLeaveNotify
boolean sendLeaveNotify() -
sendMouseEvent
boolean sendMouseEvent(int type, int button, int time, double x, double y, boolean is_hint, int state) -
sendMouseEvent
boolean sendMouseEvent(int type, int button, int count, int detail, boolean send, int time, double x, double y, boolean is_hint, int state) -
sendOrPost
-
gtk_widget_set_align
void gtk_widget_set_align(long widget, int hAlign, int vAlign) Not direct gtk api, but useful to have them combined as they are usually called together.- Parameters:
widget- the GTK reference.hAlign- is of type GTKAlign enum. See OS.javavAlign- is of type GTKAlign enum. See OS.java
-
gtk_label_set_align
void gtk_label_set_align(long label, float xAlign, float yAlign) -
setBackground
void setBackground() -
setBackground
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.Note: This operation is a hint and may be overridden by the platform.
Note: The background color can be overridden by setting a background image.
- Parameters:
color- the new color (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
_setBackground
-
setBackgroundGdkRGBA
-
gtk_css_provider_load_from_css
-
setBackgroundGdkRGBA
-
setBackgroundGdkRGBA
-
setBackgroundImage
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. The background image is tiled to fill the available space.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.
Note: Setting a background image overrides a set background color.
- Parameters:
image- the new image (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
- ERROR_INVALID_ARGUMENT - if the argument is not a bitmap
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.2
-
setBackgroundSurface
-
setCapture
public void setCapture(boolean capture) If the argument istrue, causes the receiver to have all mouse events delivered to it until the method is called withfalseas the argument. Note that on some platforms, a mouse button must currently be down for capture to be assigned.- Parameters:
capture-trueto capture the mouse, andfalseto release it- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setCursor
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.When the mouse pointer passes over a control its appearance is changed to match the control's cursor.
- Parameters:
cursor- the new cursor (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setCursor
void setCursor(long cursor) -
setDragDetect
public void setDragDetect(boolean dragDetect) Sets the receiver's drag detect state. If the argument istrue, the receiver will detect drag gestures, otherwise these gestures will be ignored.- Parameters:
dragDetect- the new drag detect state- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.3
-
setEnabled
public void setEnabled(boolean enabled) Enables the receiver if the argument istrue, and disables it otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.- Parameters:
enabled- the new enabled state- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
cleanupEnableWindow
void cleanupEnableWindow() -
setFocus
public boolean setFocus()Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it. Focus reassignment will respect applicable platform constraints.- Returns:
trueif the control got focus, andfalseif it was unable to.- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
setFont
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.- Parameters:
font- the new font (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setFontDescription
void setFontDescription(long font) -
setForeground
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.Note: This operation is a hint and may be overridden by the platform.
- Parameters:
color- the new color (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setForegroundGdkRGBA
-
setForegroundGdkRGBA
-
setInitialBounds
void setInitialBounds() -
mustBeVisibleOnInitBounds
boolean mustBeVisibleOnInitBounds()Widgets with unusual bounds calculation behavior can override this method to returntrueif the widget must be visible during call tosetInitialBounds().- Returns:
falseby default on modern GTK 3 versions (3.20+).
-
setDragGesture
private void setDragGesture() -
setRotateGesture
private void setRotateGesture()- TODO: Panning gesture requires a GtkOrientation object. Need to discuss what orientation should be default. */
-
setZoomGesture
private void setZoomGesture() -
getControl
-
rotateProc
static void rotateProc(long gesture, double angle, double angle_delta, long user_data) -
magnifyProc
static void magnifyProc(long gesture, double zoom, long user_data) -
swipeProc
static void swipeProc(long gesture, double velocity_x, double velocity_y, long user_data) -
gestureBeginProc
static void gestureBeginProc(long gesture, long sequence, long user_data) -
gestureEndProc
static void gestureEndProc(long gesture, long sequence, long user_data) -
setMenu
Sets the receiver's pop up menu to the argument. All controls may optionally have a pop up menu that is displayed when the user requests one for the control. The sequence of key strokes, button presses and/or button releases that are used to request a pop up menu is platform specific.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.
- Parameters:
menu- the new pop up menu- Throws:
IllegalArgumentException-- ERROR_MENU_NOT_POP_UP - the menu is not a pop up menu
- ERROR_INVALID_PARENT - if the menu is not in the same widget tree
- ERROR_INVALID_ARGUMENT - if the menu has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setOrientation
void setOrientation(boolean create) - Overrides:
setOrientationin classWidget
-
setOrientation
public void setOrientation(int orientation) Sets the orientation of the receiver, which must be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.- Parameters:
orientation- new orientation style- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.7
-
setParent
Changes the parent of the widget to be the one provided. Returnstrueif the parent is successfully changed.- Parameters:
parent- the new parent for the control.- Returns:
trueif the parent is changed andfalseotherwise.- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
- ERROR_NULL_ARGUMENT - if the parent is
null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setParentBackground
void setParentBackground() -
setParentGdkResource
-
setRadioSelection
boolean setRadioSelection(boolean value) -
setRedraw
public void setRedraw(boolean redraw) If the argument isfalse, 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 wasfalseare lost. When the flag is set totrue, 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.
- Parameters:
redraw- the new redraw state- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
setTabItemFocus
boolean setTabItemFocus(boolean next) - Overrides:
setTabItemFocusin classWidget
-
setTextDirection
public void setTextDirection(int textDirection) Sets the base text direction (a.k.a. "paragraph direction") of the receiver, which must be one of the constantsSWT.LEFT_TO_RIGHT,SWT.RIGHT_TO_LEFT, orSWT.AUTO_TEXT_DIRECTION.setOrientationwould override this value with the text direction that is consistent with the new orientation.Warning: This API is currently only implemented on Windows. It doesn't set the base text direction on GTK and Cocoa.
- Parameters:
textDirection- the base text direction style- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.102
- See Also:
-
setToolTipText
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. For a control that has a default tool tip, such as the Tree control on Windows, setting the tool tip text to an empty string replaces the default, causing no tool tip text to be shown.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.
NOTE: This operation is a hint and behavior is platform specific, on Windows for CJK-style mnemonics of the form " (&C)" at the end of the tooltip text are not shown in tooltip.
- Parameters:
string- the new tool tip text (or null)- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setToolTipText
-
setTouchEnabled
public void setTouchEnabled(boolean enabled) Sets whether this control should send touch events (by default controls do not). Setting this tofalsecauses the receiver to send gesture events instead. No exception is thrown if a touch-based input device is not detected (this can be determined withDisplay#getTouchEnabled()).- Parameters:
enabled- the new touch-enabled state- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.7
- See Also:
-
setVisible
public void setVisible(boolean visible) Marks the receiver as visible if the argument istrue, 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.
- Parameters:
visible- the new visibility state- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setZOrder
-
setZOrder
-
setWidgetBackground
void setWidgetBackground() -
showMenu
boolean showMenu(int x, int y) -
showMenu
boolean showMenu(int x, int y, int detail) -
showWidget
void showWidget() -
sort
void sort(int[] items) -
traverse
public boolean traverse(int traversal) Based on the argument, perform one of the expected platform traversal action. The argument should be one of the constants: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_NEXTandSWT.TRAVERSE_PAGE_PREVIOUS.- Parameters:
traversal- the type of traversal- Returns:
- true if the traversal succeeded
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
traverse
Performs a platform traversal action corresponding to aKeyDownevent.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_NEXTandSWT.TRAVERSE_PAGE_PREVIOUS. IftraversalisSWT.TRAVERSE_NONEthen the Traverse event is created with standard values based on the KeyDown event. Iftraversalis one of the other traversal constants then the Traverse event is created with this detail, and itsdoitis taken from the KeyDown event.- Parameters:
traversal- the type of traversal, orSWT.TRAVERSE_NONEto compute this fromeventevent- the KeyDown event- Returns:
trueif the traversal succeeded- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT if the event is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.6
-
traverse
Performs a platform traversal action corresponding to aKeyDownevent.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_NEXTandSWT.TRAVERSE_PAGE_PREVIOUS. IftraversalisSWT.TRAVERSE_NONEthen the Traverse event is created with standard values based on the KeyDown event. Iftraversalis one of the other traversal constants then the Traverse event is created with this detail, and itsdoitis taken from the KeyDown event.- Parameters:
traversal- the type of traversal, orSWT.TRAVERSE_NONEto compute this fromeventevent- the KeyDown event- Returns:
trueif the traversal succeeded- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT if the event is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.6
-
traverse
boolean traverse(int traversal, char character, int keyCode, int keyLocation, int stateMask, boolean doit) -
translateMnemonic
-
translateMnemonic
boolean translateMnemonic(int keyval, long event) -
translateTraversal
boolean translateTraversal(long event) -
traversalCode
int traversalCode(int key, long event) -
traverse
-
traverseEscape
boolean traverseEscape() -
traverseGroup
boolean traverseGroup(boolean next) -
traverseItem
boolean traverseItem(boolean next) -
traverseReturn
boolean traverseReturn() -
traversePage
boolean traversePage(boolean next) -
traverseMnemonic
boolean traverseMnemonic(char key) -
update
public void update()Forces all outstanding paint requests for the widget to be processed before this method returns. If there are no outstanding paint request, this method does nothing.Note:
- This method does not cause a redraw.
- Some OS versions forcefully perform automatic deferred painting. This method does nothing in that case.
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
update
void update(boolean all, boolean flush) -
updateBackgroundMode
void updateBackgroundMode() -
updateLayout
void updateLayout(boolean all) -
windowProc
long windowProc(long handle, long arg0, long user_data) - Overrides:
windowProcin classWidget
-
getWindowOrigin
Point getWindowOrigin()Gets the position of the top left corner of the control in root window (display) coordinates. GTK3 only, do not call on GTK4.- Returns:
- the origin
-
getSurfaceOrigin
Point getSurfaceOrigin()Gets the position of the top left corner of the control in root window (display) coordinates. GTK4 only, do not call on GTK3.- Returns:
- the origin
-