Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problems with Embedded Excel ActiveX with SWT 3.1 (works with 2.1)
Problems with Embedded Excel ActiveX with SWT 3.1 (works with 2.1) [message #459775] Tue, 16 August 2005 12:50 Go to next message
Eclipse UserFriend
Originally posted by: john.nichol.psjsolutions.com

Hi,

I am having problems using the Excel ActiveX control in with SWT 3.1 (SWT
from Eclipse 3.1). Basically I can not get the control to size correctly,
show scrollbars, show column headers when needed, etc with 3.1. This all
works fine with SWT 2.1 (SWT from Eclipse 2.1).

I am guessing that I need to be move explicit about layout management or
sizing, but have tried all sorts of variants of layouts and sizing of the
OleFrame that contains the component all to no avail. Have the rules
changed from 2.1 to 3.1 if so could anyone point me at an appropriate
resource.

I have been through various IBM and Eclipse resources including
http://www.eclipse.org/articles/Article-ActiveX%20Support%20 in%20SWT/ActiveX%20Support%20in%20SWT.html
and
http://www-128.ibm.com/developerworks/library/os-activex/

These are pretty old (in Eclipse dev timeframes), are there newer
resources for embedding ActiveX in SWT/Eclipse RCP that I should be
reading?

Attached is a snippet that reproduces the problem. I have removed all
attempts to set layouts constrain sizes etc as they haven't worked. I
have run the code with minimal set of jars (swt, jfaces, runtime, boot)
from 2.1 and 3.1. 2.1 does what I expect, lays out correctly, shows row
and column headers, 3.1 doesn't fit the space sensibly, resize correctly,
etc.

I am using MS Office 2003 Pro.

Any help gratefully received.

Regards,

John


import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.ole.win32.OLE;
import org.eclipse.swt.ole.win32.OleClientSite;
import org.eclipse.swt.ole.win32.OleFrame;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Display;

public class SWTExcelTest {

private Shell sShell = null;

public static void main(String[] args) {
Display display = Display.getDefault();
SWTExcelTest thisClass = new SWTExcelTest();
thisClass.createSShell();
thisClass.sShell.open();

while (!thisClass.sShell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}

/**
* This method initializes sShell
*/
private void createSShell() {
sShell = new Shell();
sShell.setText("Shell");
sShell.setSize(new Point(300, 200));
sShell.setLayout(new FillLayout());
sShell.setMenuBar(new Menu(sShell, SWT.BAR));
OleFrame frame = new OleFrame(sShell, SWT.NONE);
OleClientSite site = new OleClientSite(frame, SWT.NONE,
"ExcelWorksheet");
site.doVerb(OLE.OLEIVERB_SHOW);
}

}
Re: Problems with Embedded Excel ActiveX with SWT 3.1 (works with 2.1) [message #460438 is a reply to message #459775] Fri, 26 August 2005 15:11 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Please enter a bug report with the snippet. Thanks!

"John Nichol" <john.nichol@psjsolutions.com> wrote in message
news:df69095f7e4e26fe1a28cbc21131a49f$1@www.eclipse.org...
> Hi,
>
> I am having problems using the Excel ActiveX control in with SWT 3.1 (SWT
> from Eclipse 3.1). Basically I can not get the control to size correctly,
> show scrollbars, show column headers when needed, etc with 3.1. This all
> works fine with SWT 2.1 (SWT from Eclipse 2.1).
>
> I am guessing that I need to be move explicit about layout management or
> sizing, but have tried all sorts of variants of layouts and sizing of the
> OleFrame that contains the component all to no avail. Have the rules
> changed from 2.1 to 3.1 if so could anyone point me at an appropriate
> resource.
>
> I have been through various IBM and Eclipse resources including
>
http://www.eclipse.org/articles/Article-ActiveX%20Support%20 in%20SWT/ActiveX%20Support%20in%20SWT.html
> and
> http://www-128.ibm.com/developerworks/library/os-activex/
>
> These are pretty old (in Eclipse dev timeframes), are there newer
> resources for embedding ActiveX in SWT/Eclipse RCP that I should be
> reading?
>
> Attached is a snippet that reproduces the problem. I have removed all
> attempts to set layouts constrain sizes etc as they haven't worked. I
> have run the code with minimal set of jars (swt, jfaces, runtime, boot)
> from 2.1 and 3.1. 2.1 does what I expect, lays out correctly, shows row
> and column headers, 3.1 doesn't fit the space sensibly, resize correctly,
> etc.
>
> I am using MS Office 2003 Pro.
>
> Any help gratefully received.
>
> Regards,
>
> John
>
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.graphics.Point;
> import org.eclipse.swt.layout.FillLayout;
> import org.eclipse.swt.ole.win32.OLE;
> import org.eclipse.swt.ole.win32.OleClientSite;
> import org.eclipse.swt.ole.win32.OleFrame;
> import org.eclipse.swt.widgets.Menu;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Display;
>
> public class SWTExcelTest {
>
> private Shell sShell = null;
>
> public static void main(String[] args) {
> Display display = Display.getDefault();
> SWTExcelTest thisClass = new SWTExcelTest();
> thisClass.createSShell();
> thisClass.sShell.open();
>
> while (!thisClass.sShell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> display.dispose();
> }
>
> /**
> * This method initializes sShell
> */
> private void createSShell() {
> sShell = new Shell();
> sShell.setText("Shell");
> sShell.setSize(new Point(300, 200));
> sShell.setLayout(new FillLayout());
> sShell.setMenuBar(new Menu(sShell, SWT.BAR));
> OleFrame frame = new OleFrame(sShell, SWT.NONE);
> OleClientSite site = new OleClientSite(frame, SWT.NONE,
> "ExcelWorksheet");
> site.doVerb(OLE.OLEIVERB_SHOW);
> }
>
> }
>
>
Previous Topic:Change content of Detail Area of ErrorDialog widget
Next Topic:Font size in ListViewer
Goto Forum:
  


Current Time: Thu Apr 25 13:45:08 GMT 2024

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

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

Back to the top