# swt, groups, resize...(layout!)



## hagbard23 (8. Februar 2008)

hallo zusammen..... 
ich bastle gerade eine view für meine eclipse rcp. Sie besteht aus einem Tree und 2 groups mit den jeweiligen controls...nun versteh ich nicht ganz warum ich zunächst der sash form als 2 part keine composite übergeben kann, um auf dieser meine groups anordnen kann...

partControl mit einem GridLayout....

```
@Override
	public void createPartControl(Composite parent) {

		GridLayout gridLayout = new GridLayout(1, false);
		gridLayout.marginWidth = gridLayout.marginHeight = 3;
		parent.setLayout(gridLayout);
		parent.setLayoutData(new GridData(GridData.FILL_BOTH));

		// superior container
		SashForm sashForm = new SashForm(parent, SWT.VERTICAL);

		GridData gridData = new GridData(GridData.FILL_BOTH
				| GridData.GRAB_HORIZONTAL);
		sashForm.setLayoutData(gridData);

		// create path container tree
		createPathContainerGroup(sashForm);

		// create animation tools

		createToolsGroup(sashForm);

	}
```



```
private void createToolsGroup(Composite animationComposite) {

		createAnimationGroup(animationComposite);

		createRecordingGroup(animationComposite);

	}
```

und hier ist mein Problem....ich möchte nicht das die groups beim resizing statisch sind und die inneren widgets verdeckt werden, sondern umgekehrt, nämlich das die gruppen ihre größe behalten und sie kommplett überdeckt werden....ich verstehe auch nicht warum hier die einzelen gruppen auf einmal resizeable sind?

```
private void createAnimationGroup(Composite animationComposite) {

		// the animation group
		Group animationGroup = new Group(animationComposite,
				SWT.SHADOW_ETCHED_OUT);
		GridData animationGroupData = new GridData(GridData.FILL_HORIZONTAL);
		animationGroup.setLayoutData(animationGroupData);

		// create group layout
		GridLayout layout = new GridLayout(1, false);
		layout.marginWidth = layout.marginHeight = 4;
		layout.marginTop = layout.marginBottom = 2;
		layout.numColumns = 7;

		animationGroup.setLayout(layout);

		// set Text and Tooltips
		animationGroup.setText("Animation");
		animationGroup.setToolTipText("playing a path animation");

		// create animation slider
		Scale slider = new Scale(animationGroup, SWT.HORIZONTAL
				| SWT.SHADOW_ETCHED_OUT);
		slider.setMaximum(100);
		slider.setPageIncrement(5);
		GridData sliderLData = new GridData();
		sliderLData.horizontalSpan = 7;
		sliderLData.grabExcessHorizontalSpace = true;
		sliderLData.horizontalAlignment = GridData.FILL;
		slider.setLayoutData(sliderLData);

		// create animation buttons
		new Button(animationGroup, SWT.PUSH).setText("Wi");
		new Button(animationGroup, SWT.PUSH).setText("Wid");
		new Button(animationGroup, SWT.PUSH).setText("W");
		new Button(animationGroup, SWT.PUSH).setText("Wid");
		new Button(animationGroup, SWT.PUSH).setText("W");
		new Button(animationGroup, SWT.PUSH).setText("Wi");
		new Button(animationGroup, SWT.PUSH).setText("Wid");

		Label delayLabel = new Label(animationGroup, SWT.NULL);
		delayLabel.setText("Delay:");
		GridData delayLabelData = new GridData();
		delayLabelData.horizontalSpan = 3;
		delayLabel.setLayoutData(delayLabelData);

		Spinner delaySpinner = new Spinner(animationGroup, SWT.BORDER);

		GridData delaySpinnerData = new GridData();
		delaySpinnerData.grabExcessHorizontalSpace = true;
		delaySpinnerData.verticalIndent = 5;
		delaySpinnerData.horizontalSpan = 4;
		delaySpinnerData.minimumWidth = 50;
		delaySpinnerData.widthHint = 50;
		delaySpinner.setLayoutData(delaySpinnerData);

		Label scanningLabel = new Label(animationGroup, SWT.NULL);
		scanningLabel.setText("Scanning tact:");
		GridData scanningLabelData = new GridData();
		scanningLabelData.horizontalSpan = 3;
		scanningLabel.setLayoutData(scanningLabelData);

		Spinner scanningSpinner = new Spinner(animationGroup, SWT.BORDER);

		GridData scanningSpinnerData = new GridData();
		scanningSpinnerData.grabExcessHorizontalSpace = true;
		scanningSpinnerData.verticalIndent = 2;
		scanningSpinnerData.horizontalSpan = 4;
		scanningSpinnerData.minimumWidth = 50;
		scanningSpinnerData.widthHint = 50;
		scanningSpinner.setLayoutData(scanningSpinnerData);

		Label pathLabel = new Label(animationGroup, SWT.NULL);
		pathLabel.setText("Selected Path:");
		GridData pathLabelData = new GridData();
		pathLabelData.verticalIndent = 3;
		pathLabelData.horizontalSpan = 3;
		pathLabel.setLayoutData(pathLabelData);

		selectedPathLabel = new Label(animationGroup, SWT.NULL);
		selectedPathLabel.setText("pathname...blblblb....");
		GridData selectedPathLabelData = new GridData();
		selectedPathLabelData.horizontalSpan = 4;
		selectedPathLabel.setLayoutData(selectedPathLabelData);

	}
```


----------

