Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg
mturilin wrote:I have a problem with swing2swt Borderlayout in 2.0.1 compiled on 2004.06.27 on Eclipse 3.0 Release. Composite descendant with BorderLayout as layout manager doesn't display any internal component after construction. When it get resized everything becomes fine. Any ideas?
Eric Clayberg wrote:We have already corrected the problem for the next build.
Eric Clayberg wrote:Eric Clayberg wrote:We have already corrected the problem for the next build.
A new 2004.07.2 build includes the fix.
mturilin wrote:When am I wrong?
package ru.microtest.test.gl.ui;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Tree;
import swing2swt.layout.BorderLayout;
public class BorderTest {
public static void main(String[] args) {
BorderTest window = new BorderTest();
window.open();
}
public void open() {
final Display display = new Display();
final Shell shell = new Shell();
shell.setText("SWT Application");
{
Tree tree;
Table table;
Text text;
shell.setLayout(new BorderLayout(0, 0));
{
final Composite composite = new Composite(shell, SWT.NONE);
final org.eclipse.swt.layout.GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 5;
composite.setLayout(gridLayout);
composite.setLayoutData(BorderLayout.SOUTH);
{
final Button button = new Button(composite, SWT.NONE);
button.setText("button");
}
{
text = new Text(composite, SWT.BORDER);
}
}
{
table = new Table(shell, SWT.BORDER);
table.setLayoutData(BorderLayout.CENTER);
table.setLinesVisible(true);
table.setHeaderVisible(true);
}
{
final ToolBar toolBar = new ToolBar(shell, SWT.NONE);
toolBar.setLayoutData(BorderLayout.NORTH);
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
toolItem.setText("New item");
}
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
toolItem.setText("New item");
}
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.SEPARATOR);
toolItem.setText("New item");
}
}
{
tree = new Tree(shell, SWT.BORDER);
tree.setLayoutData(BorderLayout.WEST);
}
}
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
}
}
package ru.microtest.test.gl.ui;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Tree;
import swing2swt.layout.BorderLayout;
/**
* @author barnes
*/
public class BordelLayoutPanel extends Composite {
private Tree tree;
private Table table;
private Text text;
public BordelLayoutPanel(Composite parent, int style) {
super(parent, style);
setLayout(new BorderLayout(0, 0));
{
final Composite composite = new Composite(this, SWT.NONE);
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 5;
composite.setLayout(gridLayout);
composite.setLayoutData(BorderLayout.SOUTH);
{
final Button button = new Button(composite, SWT.NONE);
button.setText("button");
}
{
text = new Text(composite, SWT.BORDER);
}
}
{
table = new Table(this, SWT.BORDER);
table.setLayoutData(BorderLayout.CENTER);
table.setLinesVisible(true);
table.setHeaderVisible(true);
}
{
final ToolBar toolBar = new ToolBar(this, SWT.NONE);
toolBar.setLayoutData(BorderLayout.NORTH);
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
toolItem.setText("New item");
}
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
toolItem.setText("New item");
}
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.SEPARATOR);
toolItem.setText("New item");
}
}
{
tree = new Tree(this, SWT.BORDER);
tree.setLayoutData(BorderLayout.WEST);
}
//
}
public void dispose() {
super.dispose();
}
protected void checkSubclass() {
}
}
admin wrote:Both Shell and Composite with BorderLayout displayed correctly in Designer, but when I press "Test..." in Designer for Composite, I really see empty Composite until first resize.
I've fixed this problem. I am not sure what do you mean under not working, and hope that this fixed problem was your one.
admin wrote:I can not promise when new version will be uploaded (this is not my task), but hope that this will happen in near days.
Users browsing this forum: No registered users and 1 guest