Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » FigureCanvas Bounds
FigureCanvas Bounds [message #186113] Fri, 01 July 2005 19:32 Go to next message
Brad Reynolds is currently offline Brad ReynoldsFriend
Messages: 309
Registered: July 2009
Senior Member
Is FigureCanvas doing something that a normal SWT Canvas is not in
relation to it's bounds? If I run the following snippet there is a
margin around the FigureCanvas that doesn't allow for me to put 2
FigureCanvases next to each other sharing a border, there's always a gap.

Display display = new Display();
Shell shell = new Shell(display);
StackLayout layout = new StackLayout();
shell.setLayout(layout);

Composite composite = new Composite(shell, SWT.NONE);
GridLayout gridLayout = new GridLayout();
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
composite.setLayout(gridLayout);

FigureCanvas canvas = new FigureCanvas(composite);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
canvas.setBackground(display.getSystemColor(SWT.COLOR_RED));

canvas = new FigureCanvas(composite);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
canvas.setBackground(display.getSystemColor(SWT.COLOR_RED));

layout.topControl = composite;

shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();

If I change this from being FigureCanvas and use just a Canvas the two
widgets are right up against each other without any spacing.

I'm running Eclipse 3.1 and GEF 3.1RC4.

Thanks,
Brad
Re: FigureCanvas Bounds [message #186129 is a reply to message #186113] Fri, 01 July 2005 20:17 Go to previous messageGo to next message
Brad Reynolds is currently offline Brad ReynoldsFriend
Messages: 309
Registered: July 2009
Senior Member
Previously I was running this on OS X and had the issue. When I run it
on WinXP it works fine. I'm going to dig into this to see what the
difference is.

Brad Reynolds wrote:
> Is FigureCanvas doing something that a normal SWT Canvas is not in
> relation to it's bounds? If I run the following snippet there is a
> margin around the FigureCanvas that doesn't allow for me to put 2
> FigureCanvases next to each other sharing a border, there's always a gap.
>
> Display display = new Display();
> Shell shell = new Shell(display);
> StackLayout layout = new StackLayout();
> shell.setLayout(layout);
>
> Composite composite = new Composite(shell, SWT.NONE);
> GridLayout gridLayout = new GridLayout();
> gridLayout.horizontalSpacing = 0;
> gridLayout.verticalSpacing = 0;
> composite.setLayout(gridLayout);
>
> FigureCanvas canvas = new FigureCanvas(composite);
> canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
> canvas.setBackground(display.getSystemColor(SWT.COLOR_RED));
>
> canvas = new FigureCanvas(composite);
> canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
> canvas.setBackground(display.getSystemColor(SWT.COLOR_RED));
>
> layout.topControl = composite;
>
> shell.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> display.dispose();
>
> If I change this from being FigureCanvas and use just a Canvas the two
> widgets are right up against each other without any spacing.
>
> I'm running Eclipse 3.1 and GEF 3.1RC4.
>
> Thanks,
> Brad
Re: FigureCanvas Bounds [message #186188 is a reply to message #186129] Sun, 03 July 2005 01:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

OS X is reserving space for the Focus Ring. This is a faint border that is
painted when the canvas has keyboard focus.

"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:da48bv$d59$1@news.eclipse.org...
> Previously I was running this on OS X and had the issue. When I run it on
> WinXP it works fine. I'm going to dig into this to see what the
> difference is.
Re: FigureCanvas Bounds [message #186373 is a reply to message #186188] Tue, 05 July 2005 11:42 Go to previous messageGo to next message
Brad Reynolds is currently offline Brad ReynoldsFriend
Messages: 309
Registered: July 2009
Senior Member
Thanks for the response. But why isn't this visible with a simple SWT
canvas? Is there a style that I'm missing when testing the Canvas?

Randy Hudson wrote:
> OS X is reserving space for the Focus Ring. This is a faint border that is
> painted when the canvas has keyboard focus.
>
> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
> news:da48bv$d59$1@news.eclipse.org...
>
>>Previously I was running this on OS X and had the issue. When I run it on
>>WinXP it works fine. I'm going to dig into this to see what the
>>difference is.
>
>
>
Re: FigureCanvas Bounds [message #186704 is a reply to message #186373] Wed, 06 July 2005 14:42 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

There is some magical combination which causes it to appear. I think it
involves the presence of a KeyListener and maybe scrollbars.

"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:42CA723D.7010702@gmail.com...
> Thanks for the response. But why isn't this visible with a simple SWT
> canvas? Is there a style that I'm missing when testing the Canvas?
Previous Topic:getAdapter and IPropertySheetPage Problems
Next Topic:Custom property scheets
Goto Forum:
  


Current Time: Fri Apr 19 09:41:55 GMT 2024

Powered by FUDForum. Page generated in 0.02220 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top