tags:

views:

24

answers:

2

Hi,

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_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...;-(

+1  A: 

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.

Andreas_D
@Andreas I have accepted the other answer because he has less score. Hope you dont mind.
InsertNickHere
Of course, using 'hidden styles' could break the program in future versions. Also sorry for 'stealing' the accepted answer. Your answer was a minute earlier than mine.
musiKk
+1  A: 

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
musiKk