after googleing a bit im stuck in finding out which SWT. flags I can use for a composite. The reference here Ref does not give me any idea...e.g. the constructor details list NO_BACKGROUND, NO_FOCUS, NO_MERGE_PAINTS, NO_REDRAW_RESIZE, NO_开发者_StackOverflow中文版RADIO_GROUP, EMBEDDED, DOUBLE_BUFFERED
but you can also pass SWT.BORDER
, and it has an effect. Maybe someone can tell me where to find, or, what keywords I should google. I used "swt composite styles" but...;-(
You can see that you can use SWT.BORDER
because Control
provides it and Composite
is a subclass of Control
.
As far as I see you can use the following in addition to those given in the documentation to Composite
:
- from
Scrollable
:SWT.H_SCROLL
SWT.V_SCROLL
- from
Control
:SWT.LEFT_TO_RIGHT
SWT.RIGHT_TO_LEFT
SWT.BORDER
More styles are used by the superclasses of Composite.
Here's what I found so far:
org.eclipse.swt.widgets.Control
SWT.BORDER
SWT.LEFT_TO_RIGHT
SWT.RIGHT_TO_LEFT
org.eclipse.swt.widgets.Scrollable
SWT.H_SCROLL
SWT.V_SCROLL
org.eclipse.swt.widgets.Composite
SWT.NO_BACKGROUND
SWT.NO_FOCUS
SWT.NO_MERGE_PAINTS
SWT.NO_REDRAW_RESIZE
SWT.NO_RADIO_GROUP
SWT.EMBEDDED
SWT.DOUBLE_BUFFERED
These are the styles mentioned in the javadoc for the constructors of the classes. Looking at the source code would show if there are more 'hidden' styles.
A composite can use two kind of style, one is its own, others is inherited from super class.
Composite
- SWT.NO_BACKGROUND
- SWT.NO_FOCUS
- SWT.NO_REDRAW_RESIZE
- SWT.NO_MERGE_PAINTS
- SWT.NO_RADIO_GROUP
- SWT.EMBEDDED
- SWT.DOUBLE_BUFFERED
- SWT.UP
And styles from superclass:
org.eclipse.swt.widgets.Scrollable
- H_SCROLL
- V_SCROLL
org.eclipse.swt.widgets.Control
- SWT.BORDER,
- SWT.LEFT_TO_RIGHT
- SWT.RIGHT_TO_LEFT
org.eclipse.swt.widgets.Widget
- SWT.NONE
The eclipse wiki has listed the style for composite as well as other widgets, you can refer to this document:https://wiki.eclipse.org/SWT_Widget_Style_Bits
精彩评论