Class Composite
- All Implemented Interfaces:
Drawable
- Direct Known Subclasses:
Browser, Canvas, CBanner, CCombo, Combo, CoolBar, CTabFolder, DateTime, ExpandBar, Group, SashForm, ScrolledComposite, Spinner, TabFolder, Table, ToolBar, Tree, ViewForm
- Styles:
- NO_BACKGROUND, NO_FOCUS, NO_MERGE_PAINTS, NO_REDRAW_RESIZE, NO_RADIO_GROUP, EMBEDDED, DOUBLE_BUFFERED
- Events:
- (none)
Note: The NO_BACKGROUND, NO_FOCUS, NO_MERGE_PAINTS,
and NO_REDRAW_RESIZE styles are intended for use with Canvas.
They can be used with Composite if you are drawing your own, but their
behavior is undefined if they are used with subclasses of Composite other
than Canvas.
Note: The CENTER style, although undefined for composites, has the
same value as EMBEDDED which is used to embed widgets from other
widget toolkits into SWT. On some operating systems (GTK), this may cause
the children of this composite to be obscured.
This class may be subclassed by custom control implementors who are building controls that are constructed from aggregates of other controls.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) intA HashMap of child widgets that keeps track of which child has had their GdkWindow lowered/raised.longthe handle to the OS resource (Warning: This field is platform dependent)(package private) longWhen this field is set, it indicates that a child widget of this Composite needs to have its clip set to its allocation.If fixClipHandle is set, then the fixClipMap HashMap contains children of fixClipHandle that also need to have their clips adjusted.(package private) long(package private) Layout(package private) int(package private) static final String(package private) booleanIf set totrue, child widgets with negative y coordinate GTK allocation will not be drawn.(package private) Shell(package private) long(package private) Control[]Fields inherited from class Scrollable
horizontalBar, RESIZE_ON_GETCLIENTAREA, scrolledHandle, verticalBarFields inherited from class Control
accessible, autoScale, backgroundAlpha, backgroundImage, cachedNoBackground, checkScaleFactor, cssBackground, cssForeground, cursor, DISABLE_EMOJI, dragDetectionQueue, dragGesture, drawCount, drawRegion, enableWindow, eventRegion, firstFixedHandle, fixedHandle, font, gestureBegin, gestureEnd, gestureRotation, gestureSwipe, gestureZoom, keyController, labelRelation, lastInput, layoutData, menu, mouseDown, panGesture, parent, provider, redrawWindow, region, regionHandle, rotateGesture, toolTipText, zoomGestureFields 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) Control[](package private) Control[](package private) voidadjustChildClipping(long widget) Allows Controls to adjust the clipping of themselves or their children.(package private) intvoidDeprecated.(package private) void(package private) static intcheckStyle(int style) protected voidChecks that this class can be subclassed.(package private) boolean(package private) PointcomputeSizeInPixels(int wHint, int hHint, boolean changed) (package private) Widget[](package private) voidConnects this widget's fixedHandle to the "draw" signal.
NOTE: only the "draw" (EXPOSE) signal is connected, not EXPOSE_EVENT_INVERSE.(package private) voidcreateHandle(int index) (package private) voidcreateHandle(int index, boolean fixed, boolean scrolled) (package private) voidvoiddrawBackground(GC gc, int x, int y, int width, int height, int offsetX, int offsetY) Fills the interior of the rectangle specified by the arguments, with the receiver's background.(package private) voidenableWidget(boolean enabled) (package private) Composite(package private) Menu[](package private) voidfixChildren(Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu[] menus) (package private) voidIterates though the array of child widgets that need to have their clips adjusted, and calls Control.adjustChildClipping() on it.(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) voidfixTabList(Control control) (package private) void(package private) long(package private) booleanforceFocus(long focusHandle) intReturns the receiver's background drawing mode.Control[]Returns a (possibly empty) array containing the receiver's children.(package private) int(package private) RectangleReturns layout which is associated with the receiver, or null if one has not been set.booleanReturnstrueif the receiver has deferred the performing of layout, andfalseotherwise.Control[]Gets the (possibly empty) tabbing order for the control.(package private) longgtk_button_press_event(long widget, long event) (package private) longgtk_draw(long widget, long cairo) (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) longgtk_map(long widget) (package private) longgtk_realize(long widget) (package private) longgtk_scroll_child(long widget, long scrollType, long horizontal) (package private) longgtk_style_updated(long widget) (package private) longgtk3_key_press_event(long widget, long event) (package private) booleangtk4_key_press_event(long controller, int keyval, int keycode, int state, long event) (package private) boolean(package private) void(package private) boolean(package private) longimHandle()booleanReturnstrueif the receiver or any ancestor up to and including the receiver's nearest ancestor shell has deferred the performing of layouts.(package private) booleanvoidlayout()If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children.voidlayout(boolean changed) If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children.voidlayout(boolean changed, boolean all) If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children.voidForces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarchy of the changed control up to and including the receiver.voidForces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarchy of the changed control up to and including the receiver.(package private) voidmarkLayout(boolean changed, boolean all) (package private) PointminimumSize(int wHint, int hHint, boolean changed) (package private) voidmoveAbove(long child, long sibling) (package private) voidmoveBelow(long child, long sibling) (package private) voidmoveChildren(int oldWidth) (package private) booleanWidgets with unusual bounds calculation behavior can override this method to returntrueif the widget must be visible during call toControl.setInitialBounds().(package private) long(package private) voidprintWidget(GC gc, long drawable, int depth, int x, int y) (package private) voidpropagateDraw(long container, long cairo) Propagates draw events from a parent container to its children using gtk_container_propagate_draw().(package private) void(package private) voidregister()(package private) voidreleaseChildren(boolean destroy) (package private) void(package private) void(package private) voidremoveControl(Control control) (package private) voidresizeHandle(int width, int height) (package private) voidreskinChildren(int flags) voidsetBackgroundMode(int mode) Sets the background drawing mode to the argument which should be one of the following constants defined in classSWT:INHERIT_NONE,INHERIT_DEFAULT,INHERIT_FORCE.(package private) intsetBounds(int x, int y, int width, int height, boolean move, boolean resize) booleansetFocus()Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.voidSets the layout which is associated with the receiver to be the argument which may be null.voidsetLayoutDeferred(boolean defer) If the argument istrue, causes subsequent layout operations in the receiver or any of its children to be ignored.(package private) voidsetOrientation(boolean create) (package private) booleansetScrollBarVisible(ScrollBar bar, boolean visible) (package private) booleansetTabGroupFocus(boolean next) (package private) booleansetTabItemFocus(boolean next) voidsetTabList(Control[] tabList) Sets the tabbing order for the specified controls to match the order that they occur in the argument list.(package private) voidtoString()Returns a string containing a concise, human-readable description of the receiver.(package private) booleantranslateMnemonic(Event event, Control control) (package private) booleantranslateTraversal(long event) (package private) inttraversalCode(int key, long event) (package private) void(package private) voidupdateLayout(boolean all) Methods inherited from class Scrollable
clientHandle, computeTrim, computeTrimInPixels, createScrollBar, createWidget, destroyScrollBar, getBorderWidthInPixels, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, gtk_scroll_event, hScrollBarWidth, redrawBackgroundImage, redrawWidget, sendLeaveNotify, setScrollbarsMode, topHandle, updateScrollBarValue, vScrollBarWidthMethods inherited from class Control
_getAccessible, _getShell, addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addRelation, addTouchListener, addTraverseListener, cairoClipRegion, cairoCopyRegion, cairoDisposeRegion, checkBackground, checkBorder, checkMirrored, cleanupEnableWindow, computeNativeSize, computeSize, computeSize, computeSizeInPixels, computeTabGroup, computeTabRoot, containedInRegion, defaultBackground, defaultFont, destroyWidget, dragDetect, dragDetect, dragDetect, dragDetect, drawBackground, drawGripper, drawWidget, enterExitHandle, eventHandle, eventSurface, eventWindow, filterKey, findBackgroundControl, fixFocus, fixGdkEventTypeValues, fixStyle, flushQueueOnDnd, fontHandle, forceFocus, forceResize, gestureBeginProc, gestureEndProc, gestureHandle, getAccessible, getBackground, getBackgroundGdkRGBA, getBackgroundImage, getBaseGdkRGBA, getBgGdkRGBA, getBorderWidth, getBounds, getBoundsInPixels, getClientWidth, getContextBackgroundGdkRGBA, getContextColorGdkRGBA, getControl, getControlOrigin, getCursor, getDragDetect, getEnabled, getFont, getFontDescription, getForeground, getForegroundGdkRGBA, getIMCaretPos, getLayoutData, getLocation, getLocationInPixels, getMenu, getMonitor, getOrientation, getParent, getPath, getRegion, getShell, getSize, getSizeInPixels, getSurfaceOrigin, getTextDirection, getThickness, getToolTipText, getTouchEnabled, getVisible, getWindowOrigin, gtk_button_press_event, gtk_button_release_event, gtk_commit, gtk_css_provider_load_from_css, gtk_enter_notify_event, gtk_gesture_press_event, gtk_gesture_release_event, gtk_label_set_align, gtk_leave_notify_event, gtk_mnemonic_activate, gtk_motion_notify_event, gtk_preedit_changed, gtk_style_context_get_border, gtk_style_context_get_padding, gtk_unrealize, gtk_widget_reparent, gtk_widget_set_align, gtk3_event_after, gtk3_key_release_event, gtk3_popup_menu, gtk3_show_help, gtk4_draw, gtk4_enter_event, gtk4_focus_enter_event, gtk4_focus_leave_event, gtk4_focus_window_event, gtk4_key_release_event, gtk4_leave_event, gtk4_motion_event, gtk4_scroll_event, hasFocus, hooksPaint, hoverProc, internal_dispose_GC, internal_new_GC, isActive, isAutoScalable, isDescribedByLabel, isEnabled, isFocusAncestor, isFocusControl, isFocusHandle, isReparentable, isShowing, isTabItem, isVisible, magnifyProc, menuShell, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, moveHandle, pack, pack, paintHandle, paintSurface, paintWindow, print, printWindow, redraw, redraw, redraw, release, releaseParent, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeRelation, removeTouchListener, removeTraverseListener, requestLayout, resizeCalculationsGTK3, restackWindow, rotateProc, sendDragEvent, sendFocusEvent, sendGestureEvent, sendGestureEvent, sendGestureEvent, sendHelpEvent, sendMouseEvent, sendMouseEvent, setBackground, setBackground, setBackgroundGdkRGBA, setBackgroundGdkRGBA, setBackgroundGdkRGBA, setBackgroundImage, setBackgroundSurface, setBounds, setBounds, setBoundsInPixels, setBoundsInPixels, setCapture, setCursor, setCursor, setDragDetect, setEnabled, setFont, setFontDescription, setForeground, setForegroundGdkRGBA, setForegroundGdkRGBA, setInitialBounds, setLayoutData, setLocation, setLocation, setLocationInPixels, setLocationInPixels, setMenu, setOrientation, setParent, setParentBackground, setParentGdkResource, setRadioSelection, setRedraw, setRegion, setRelations, setSize, setSize, setSizeInPixels, setSizeInPixels, setTextDirection, setToolTipText, setToolTipText, setTouchEnabled, setVisible, setWidgetBackground, setZOrder, setZOrder, showMenu, showMenu, sort, swipeProc, toControl, toControl, toDisplay, toDisplay, toDisplayInPixels, translateMnemonic, traverse, traverse, traverse, traverse, traverse, traverseEscape, traverseGroup, traverseItem, traverseMnemonic, traversePage, traverseReturn, update, update, wantDragDropDetection, windowProcMethods inherited from class Widget
_addListener, addDisposeListener, addListener, addTypedListener, cellDataProc, checkBits, checkOpen, checkOrientation, checkParent, checkWidget, convertPangoFontDescriptionToCss, 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_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_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, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, rendererGetPreferredWidthProc, rendererRenderProc, rendererSnapshotProc, reskin, reskinWidget, scrollProc, sendEvent, sendEvent, sendEvent, sendEvent, sendIMKeyEvent, sendKeyEvent, sendSelectionEvent, sendSelectionEvent, setButtonState, setData, setData, setFontDescription, setInputState, setKeyState, setLocationState, setToolTipText, shellMapProc, sizeAllocateProc, sizeRequestProc, snapshotToDraw, timerProc, translateTraversal, windowActiveProc, windowProc, windowProc, windowProc, windowProc
-
Field Details
-
embeddedHandle
public long embeddedHandlethe handle to the OS resource (Warning: This field is platform dependent)IMPORTANT: This field is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code.
-
imHandle
long imHandle -
socketHandle
long socketHandle -
layout
Layout layout -
tabList
Control[] tabList -
layoutCount
int layoutCount -
backgroundMode
int backgroundMode -
fixClipHandle
long fixClipHandleWhen this field is set, it indicates that a child widget of this Composite needs to have its clip set to its allocation. This is because on GTK3.20+ some widgets (like Combo) have their clips merged with that of their parent. -
fixClipMap
If fixClipHandle is set, then the fixClipMap HashMap contains children of fixClipHandle that also need to have their clips adjusted.Each key is a Control which needs to have its clip adjusted, and each value is an array of handles (descendants of the Control) ordered by widget hierarchy. This array will be traversed in-order to adjust the clipping of each element. See bug 500703 and 535323.
-
NO_INPUT_METHOD
- See Also:
-
popupChild
Shell popupChild -
noChildDrawing
boolean noChildDrawingIf set totrue, child widgets with negative y coordinate GTK allocation will not be drawn. Only relevant if such child widgets are being drawn via propagateDraw(), such as Tree/Table editing widgets. See bug 535978 and bug 547986. -
childrenLowered
-
-
Constructor Details
-
Composite
Composite() -
Composite
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 widget which will be the parent of the new instance (cannot be null)style- the style of widget 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
- See Also:
-
-
Method Details
-
checkStyle
static int checkStyle(int style) -
_getChildren
Control[] _getChildren() -
_getTabList
Control[] _getTabList() -
changed
Deprecated.uselayout(Control[], int)insteadClears any data that has been cached by a Layout for all widgets that are in the parent hierarchy of the changed control up to and including the receiver. If an ancestor does not have a layout, it is skipped.- Parameters:
changed- an array of controls that changed state and require a recalculation of size- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed
- ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver
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.1
-
checkBuffered
void checkBuffered()- Overrides:
checkBufferedin classControl
-
checkSubclass
protected void checkSubclass()Description copied from class:WidgetChecks that this class can be subclassed.The SWT class library is intended to be subclassed only at specific, controlled points (most notably,
CompositeandCanvaswhen implementing new widgets). This method enforces this rule unless it is overridden.IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
- Overrides:
checkSubclassin classWidget
-
computeSizeInPixels
- Overrides:
computeSizeInPixelsin classControl
-
computeTabList
Widget[] computeTabList()- Overrides:
computeTabListin classControl
-
createHandle
void createHandle(int index) - Overrides:
createHandlein classWidget
-
applyThemeBackground
int applyThemeBackground()- Overrides:
applyThemeBackgroundin classScrollable- Returns:
- 0 to remove THEME_BACKGROUND
- 1 to apply THEME_BACKGROUND
- otherwise don't change THEME_BACKGROUND state
-
createHandle
void createHandle(int index, boolean fixed, boolean scrolled) -
fixClippings
void fixClippings()Iterates though the array of child widgets that need to have their clips adjusted, and calls Control.adjustChildClipping() on it. The default implementation in Composite is: if a child has a negative clip, adjust it. Also check if the child's allocation is negative, and adjust it as necessary.If the array is empty this method just returns. See bug 500703, and 539367.
-
adjustChildClipping
void adjustChildClipping(long widget) Description copied from class:ControlAllows Controls to adjust the clipping of themselves or their children.- Overrides:
adjustChildClippingin classControl- Parameters:
widget- the handle to the widget
-
gtk_draw
long gtk_draw(long widget, long cairo) - Overrides:
gtk_drawin classScrollable
-
mustBeVisibleOnInitBounds
boolean mustBeVisibleOnInitBounds()Description copied from class:ControlWidgets with unusual bounds calculation behavior can override this method to returntrueif the widget must be visible during call toControl.setInitialBounds().- Overrides:
mustBeVisibleOnInitBoundsin classControl- Returns:
falseby default on modern GTK 3 versions (3.20+).
-
deregister
void deregister()- Overrides:
deregisterin classScrollable
-
drawBackground
Fills the interior of the rectangle specified by the arguments, with the receiver's background.The
offsetXandoffsetYare used to map from thegcorigin to the origin of the parent image background. This is useful to ensure proper alignment of the image background.- Parameters:
gc- the gc where the rectangle is to be filledx- the x coordinate of the rectangle to be filledy- the y coordinate of the rectangle to be filledwidth- the width of the rectangle to be filledheight- the height of the rectangle to be filledoffsetX- the image background x offsetoffsetY- the image background y offset- 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.6
-
enableWidget
void enableWidget(boolean enabled) - Overrides:
enableWidgetin classControl
-
findDeferredControl
Composite findDeferredControl() -
findMenus
-
fixChildren
void fixChildren(Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu[] menus) - Overrides:
fixChildrenin classControl
-
fixParentGdkResource
void fixParentGdkResource()Description copied from class:ControlIn 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.- Overrides:
fixParentGdkResourcein classControl
-
fixModal
-
fixStyle
-
fixTabList
-
fixZOrder
void fixZOrder() -
focusHandle
long focusHandle()- Overrides:
focusHandlein classControl
-
forceFocus
boolean forceFocus(long focusHandle) - Overrides:
forceFocusin classControl
-
getBackgroundMode
public int getBackgroundMode()Returns the receiver's background drawing mode. This will be one of the following constants defined in classSWT:INHERIT_NONE,INHERIT_DEFAULT,INHERIT_FORCE.- Returns:
- the background mode
- 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
- See Also:
-
getChildren
Returns a (possibly empty) array containing the receiver's children. Children are returned in the order that they are drawn. The topmost control appears at the beginning of the array. Subsequent controls draw beneath this control and appear later in the array.Note: This is not the actual structure used by the receiver to maintain its list of children, so modifying the array will not affect the receiver.
- Returns:
- an array of children
- 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:
-
getChildrenCount
int getChildrenCount() -
getClientAreaInPixels
Rectangle getClientAreaInPixels()- Overrides:
getClientAreaInPixelsin classScrollable
-
getLayout
Returns layout which is associated with the receiver, or null if one has not been set.- Returns:
- the receiver's layout 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
-
getLayoutDeferred
public boolean getLayoutDeferred()Returnstrueif the receiver has deferred the performing of layout, andfalseotherwise.- Returns:
- the receiver's deferred layout 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.1
- See Also:
-
getTabList
Gets the (possibly empty) tabbing order for the control.- Returns:
- tabList the ordered list of controls representing the tab order
- 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:
-
gtk_button_press_event
long gtk_button_press_event(long widget, long event) - Overrides:
gtk_button_press_eventin classControl
-
gtk4_key_press_event
boolean gtk4_key_press_event(long controller, int keyval, int keycode, int state, long event) - Overrides:
gtk4_key_press_eventin classControl- 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 classControl
-
gtk_focus
-
gtk_focus_in_event
long gtk_focus_in_event(long widget, long event) - Overrides:
gtk_focus_in_eventin classControl
-
gtk_focus_out_event
long gtk_focus_out_event(long widget, long event) - Overrides:
gtk_focus_out_eventin classControl
-
gtk_map
-
gtk_realize
long gtk_realize(long widget) - Overrides:
gtk_realizein classControl
-
gtk_scroll_child
long gtk_scroll_child(long widget, long scrollType, long horizontal) - Overrides:
gtk_scroll_childin classWidget
-
gtk_style_updated
long gtk_style_updated(long widget) - Overrides:
gtk_style_updatedin classControl
-
hasBorder
boolean hasBorder() -
hookEvents
void hookEvents()- Overrides:
hookEventsin classControl
-
hooksKeys
boolean hooksKeys() -
imHandle
-
isLayoutDeferred
public boolean isLayoutDeferred()Returnstrueif the receiver or any ancestor up to and including the receiver's nearest ancestor shell has deferred the performing of layouts. Otherwise,falseis returned.- Returns:
- the receiver's deferred layout 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.1
- See Also:
-
isTabGroup
boolean isTabGroup()- Overrides:
isTabGroupin classControl
-
layout
public void layout()If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the receiver does not have a layout, do nothing.Use of this method is discouraged since it is the least-efficient way to trigger a layout. The use of
layout(true)discards all cached layout information, even from controls which have not changed. It is much more efficient to invokeControl.requestLayout()on every control which has changed in the layout than it is to invoke this method on the layout itself.This is equivalent to calling
layout(true).Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.
- 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
-
layout
public void layout(boolean changed) If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the argument istruethe layout must not rely on any information it has cached about the immediate children. If it isfalsethe layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the receiver does not have a layout, do nothing.It is normally more efficient to invoke
Control.requestLayout()on every control which has changed in the layout than it is to invoke this method on the layout itself. Clients are encouraged to useControl.requestLayout()where possible instead of calling this method.If a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. The layout will cascade down through all child widgets in the receiver's widget tree until a child is encountered that does not resize. Note that a layout due to a resize will not flush any cached information (same as
layout(false)).Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.
- Parameters:
changed-trueif the layout must flush its caches, 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
-
layout
public void layout(boolean changed, boolean all) If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the changed argument istruethe layout must not rely on any information it has cached about its children. If it isfalsethe layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the all argument istruethe layout will cascade down through all child widgets in the receiver's widget tree, regardless of whether the child has changed size. The changed argument is applied to all layouts. If the all argument isfalse, the layout will not cascade down through all child widgets in the receiver's widget tree. However, if a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. Note that a layout due to a resize will not flush any cached information (same aslayout(false)).It is normally more efficient to invoke
Control.requestLayout()on every control which has changed in the layout than it is to invoke this method on the layout itself. Clients are encouraged to useControl.requestLayout()where possible instead of calling this method.Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.
- Parameters:
changed-trueif the layout must flush its caches, andfalseotherwiseall-trueif all children in the receiver's widget tree should be laid out, 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
- Since:
- 3.1
-
layout
Forces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarchy of the changed control up to and including the receiver. The layouts in the hierarchy must not rely on any information cached about the changed control or any of its ancestors. The layout may (potentially) optimize the work it is doing by assuming that none of the peers of the changed control have changed state since the last layout. If an ancestor does not have a layout, skip it.It is normally more efficient to invoke
Control.requestLayout()on every control which has changed in the layout than it is to invoke this method on the layout itself. Clients are encouraged to useControl.requestLayout()where possible instead of calling this method.Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.
- Parameters:
changed- a control that has had a state change which requires a recalculation of its size- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed
- ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver
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.1
-
layout
Forces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarchy of the changed control up to and including the receiver.The parameter
flagsmay be a combination of:- SWT.ALL
- all children in the receiver's widget tree should be laid out
- SWT.CHANGED
- the layout must flush its caches
- SWT.DEFER
- layout will be deferred
When the
changedarray is specified, the flagsSWT.ALLandSWT.CHANGEDhave no effect. In this case, the layouts in the hierarchy must not rely on any information cached about the changed control or any of its ancestors. The layout may (potentially) optimize the work it is doing by assuming that none of the peers of the changed control have changed state since the last layout. If an ancestor does not have a layout, skip it.When the
changedarray is not specified, the flagSWT.ALLindicates that the whole widget tree should be laid out. And the flagSWT.CHANGEDindicates that the layouts should flush any cached information for all controls that are laid out.The
SWT.DEFERflag always causes the layout to be deferred by callingComposite.setLayoutDeferred(true)and scheduling a call toComposite.setLayoutDeferred(false), which will happen when appropriate (usually before the next event is handled). When this flag is set, the application should not callComposite.setLayoutDeferred(boolean).Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.
- Parameters:
changed- a control that has had a state change which requires a recalculation of its sizeflags- the flags specifying how the layout should happen- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if any of the controls in changed is null or has been disposed
- ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver
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
-
markLayout
void markLayout(boolean changed, boolean all) - Overrides:
markLayoutin classControl
-
moveAbove
void moveAbove(long child, long sibling) -
moveBelow
void moveBelow(long child, long sibling) -
moveChildren
void moveChildren(int oldWidth) - Overrides:
moveChildrenin classControl
-
minimumSize
-
parentingHandle
long parentingHandle() -
printWidget
- Overrides:
printWidgetin classControl
-
connectFixedHandleDraw
void connectFixedHandleDraw()Connects this widget's fixedHandle to the "draw" signal.
NOTE: only the "draw" (EXPOSE) signal is connected, not EXPOSE_EVENT_INVERSE. -
propagateDraw
void propagateDraw(long container, long cairo) Propagates draw events from a parent container to its children using gtk_container_propagate_draw(). This method only works if the fixedHandle has been connected to the "draw" signal, and only propagates draw events to other siblings of handle (i.e. other children of fixedHandle, but not handle itself).
It's useful to propagate draw events to other child widgets for things like Table/Tree editors, or other scenarios where a widget is a child of a non-standard container widget (i.e., not a direct child of a Composite).
- Parameters:
container- the parent container, i.e. fixedHandlecairo- the cairo context provided by GTK
-
redrawChildren
void redrawChildren()- Overrides:
redrawChildrenin classControl
-
register
void register()- Overrides:
registerin classScrollable
-
releaseChildren
void releaseChildren(boolean destroy) - Overrides:
releaseChildrenin classScrollable
-
releaseHandle
void releaseHandle()- Overrides:
releaseHandlein classScrollable
-
releaseWidget
void releaseWidget()- Overrides:
releaseWidgetin classControl
-
removeControl
-
reskinChildren
void reskinChildren(int flags) - Overrides:
reskinChildrenin classScrollable
-
resizeHandle
void resizeHandle(int width, int height) - Overrides:
resizeHandlein classScrollable
-
setBackgroundMode
public void setBackgroundMode(int mode) Sets the background drawing mode to the argument which should be one of the following constants defined in classSWT:INHERIT_NONE,INHERIT_DEFAULT,INHERIT_FORCE.- Parameters:
mode- the new background mode- 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
- See Also:
-
setBounds
-
setFocus
public boolean setFocus()Description copied from class:ControlCauses the receiver to have the keyboard focus, such that all keyboard events will be delivered to it. Focus reassignment will respect applicable platform constraints. -
setLayout
Sets the layout which is associated with the receiver to be the argument which may be null.- Parameters:
layout- the receiver's new layout 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
-
setLayoutDeferred
public void setLayoutDeferred(boolean defer) If the argument istrue, causes subsequent layout operations in the receiver or any of its children to be ignored. No layout of any kind can occur in the receiver or any of its children until the flag is set to false. Layout operations that occurred while the flag wastrueare remembered and when the flag is set tofalse, the layout operations are performed in an optimized manner. Nested calls to this method are stacked.- Parameters:
defer- the new defer 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.1
- See Also:
-
setOrientation
void setOrientation(boolean create) - Overrides:
setOrientationin classScrollable
-
setScrollBarVisible
- Overrides:
setScrollBarVisiblein classScrollable
-
setTabGroupFocus
boolean setTabGroupFocus(boolean next) - Overrides:
setTabGroupFocusin classWidget
-
setTabItemFocus
boolean setTabItemFocus(boolean next) - Overrides:
setTabItemFocusin classControl
-
setTabList
Sets the tabbing order for the specified controls to match the order that they occur in the argument list.- Parameters:
tabList- the ordered list of controls representing the tab order or null- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if a widget in the tabList is null or has been disposed
- ERROR_INVALID_PARENT - if widget in the tabList is not in the same widget tree
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
showWidget
void showWidget()- Overrides:
showWidgetin classScrollable
-
checkSubwindow
boolean checkSubwindow()- Overrides:
checkSubwindowin classControl
-
translateMnemonic
- Overrides:
translateMnemonicin classControl
-
traversalCode
int traversalCode(int key, long event) - Overrides:
traversalCodein classControl
-
translateTraversal
boolean translateTraversal(long event) - Overrides:
translateTraversalin classControl
-
updateBackgroundMode
void updateBackgroundMode()- Overrides:
updateBackgroundModein classScrollable
-
updateLayout
void updateLayout(boolean all) - Overrides:
updateLayoutin classControl
-
toString
-
layout(Control[], int)instead