|
|
Re: Composite invisible? [message #493464 is a reply to message #493163] |
Mon, 26 October 2009 12:29 |
Alexander Mack Messages: 100 Registered: July 2009 |
Senior Member |
|
|
Hello, first: Thanks for your answer!
Okay I solved the problem with the layout for now, but there is still one problem left:
I want not the standard size so I resize the parent shell. Problem is that all components are only visible after resizing the window?!
I really don't know why and tried everthing like parent.getShell().layout()/update() e.c.
Here is some code:
protected Control createContents(Composite parent) {
parent.getShell().setSize(999, 999);
mComp = new Composite(parent, SWT.NONE);
mComp.setFont(parent.getFont());
mComp.setLayout(new GridLayout());
mComp.setLayoutData(new RowData());
//Preference Group
Group lPreferenceGroup = new Group(mComp,SWT.NONE);
lPreferenceGroup.setText("Preferences");
GridData lPreferenceGridData = new GridData();
lPreferenceGridData.horizontalAlignment = GridData.FILL;
lPreferenceGridData.grabExcessHorizontalSpace = true;
lPreferenceGroup.setLayoutData(lPreferenceGridData);
GridLayout lPreferenceGridLayout = new GridLayout(3, false);
lPreferenceGroup.setLayout(lPreferenceGridLayout);
//Location Label
Label lGeneratorMainFile = new Label(lPreferenceGroup, SWT.NONE);
lGeneratorMainFile.setText("Java Generator Location: ");
//Location Textfield layout
GridData lGeneratorLocationTextGridData = new GridData();
lGeneratorLocationTextGridData.horizontalAlignment = GridData.FILL;
lGeneratorLocationTextGridData.grabExcessHorizontalSpace = true;
//Location textfield
mGeneratorLocationText = new Text(lPreferenceGroup, SWT.BORDER);
mGeneratorLocationText.setLayoutData(lGeneratorLocationTextG ridData);
...
}
I would appreciate any help.
Best regards,
Alex
|
|
|
Re: Composite invisible? [message #493716 is a reply to message #493464] |
Tue, 27 October 2009 16:26 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Moving your "parent.getShell().setSize(999, 999);" to the end of your
createContents(...) implementation will probably fix this.
Grant
"Alexander Mack" <alex043@gmx.de> wrote in message
news:hc44o3$qk6$1@build.eclipse.org...
> Hello, first: Thanks for your answer!
> Okay I solved the problem with the layout for now, but there is still one
problem left:
>
> I want not the standard size so I resize the parent shell. Problem is that
all components are only visible after resizing the window?!
> I really don't know why and tried everthing like
parent.getShell().layout()/update() e.c.
>
> Here is some code:
> protected Control createContents(Composite parent) {
> parent.getShell().setSize(999, 999);
> mComp = new Composite(parent, SWT.NONE);
> mComp.setFont(parent.getFont());
> mComp.setLayout(new GridLayout());
> mComp.setLayoutData(new RowData());
>
> //Preference Group
> Group lPreferenceGroup = new Group(mComp,SWT.NONE);
> lPreferenceGroup.setText("Preferences");
> GridData lPreferenceGridData = new GridData();
> lPreferenceGridData.horizontalAlignment = GridData.FILL;
> lPreferenceGridData.grabExcessHorizontalSpace = true;
> lPreferenceGroup.setLayoutData(lPreferenceGridData);
> GridLayout lPreferenceGridLayout = new GridLayout(3, false);
> lPreferenceGroup.setLayout(lPreferenceGridLayout);
>
> //Location Label
> Label lGeneratorMainFile = new Label(lPreferenceGroup, SWT.NONE);
> lGeneratorMainFile.setText("Java Generator Location: ");
>
>
> //Location Textfield layout
> GridData lGeneratorLocationTextGridData = new GridData();
> lGeneratorLocationTextGridData.horizontalAlignment = GridData.FILL;
> lGeneratorLocationTextGridData.grabExcessHorizontalSpace = true;
>
> //Location textfield
> mGeneratorLocationText = new Text(lPreferenceGroup, SWT.BORDER);
> mGeneratorLocationText.setLayoutData(lGeneratorLocationTextG ridData);
> ..
> }
>
> I would appreciate any help.
> Best regards,
> Alex
>
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03823 seconds