Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] Using Excel ActiveX control in SWT

See the following document:
http://www.eclipse.org/articles/Article-ActiveX%20Support%20in%20SWT/ActiveX%20Support%20in%20SWT.html

You need to add your file menu to the OleFrame using OleFrame.setFileMenus.
The trimming for excel is a bit screwy, it does not behave like other OLE
Documents.  You can play around with OleClientSite.setIndent to get it
right.  There is also a bug report about this:
http://dev.eclipse.org/bugs/show_bug.cgi?id=23417



                                                                                                                                                     
                      "Elliott, R C (Richard)                                                                                                        
                      - London Particle Team"         To:      "'platform-swt-dev@xxxxxxxxxxx'" <platform-swt-dev@xxxxxxxxxxx>                       
                      <ElliottR2@xxxxxxxxxxxx         cc:                                                                                            
                      m>                              Subject: RE: [platform-swt-dev] Using Excel ActiveX control in SWT                             
                      Sent by:                                                                                                                       
                      platform-swt-dev-admin@                                                                                                        
                      eclipse.org                                                                                                                    
                                                                                                                                                     
                                                                                                                                                     
                      04/11/2002 10:06 AM                                                                                                            
                      Please respond to                                                                                                              
                      platform-swt-dev                                                                                                               
                                                                                                                                                     
                                                                                                                                                     




Thanks. I can now see the spreadsheet.

There's obviously more to this than meets the eye. My File menu option is
not visible and it seem to be trimming scroll bars and row/column headings,
presumably a function of the layout I select. Can you direct me to any
documentation that will help me understand this.

Thanks
Richard
-----Original Message-----
From: Veronika Irvine [mailto:Veronika_Irvine@xxxxxxx]
Sent: 04 November 2002 15:50
To: platform-swt-dev@xxxxxxxxxxx
Subject: RE: [platform-swt-dev] Using Excel ActiveX control in SWT



You are missing the line:
shell.setLayout(new GridLayout());





                      "Elliott, R C (Richard)

                      - London Particle Team"         To:
"'platform-swt-dev@xxxxxxxxxxx'" <platform-swt-dev@xxxxxxxxxxx>

                      <ElliottR2@xxxxxxxxxxxx         cc:

                      m>                              Subject: RE:
[platform-swt-dev] Using Excel ActiveX control in SWT

                      Sent by:

                      platform-swt-dev-admin@

                      eclipse.org





                      04/11/2002 08:56 AM

                      Please respond to

                      platform-swt-dev









Here's my sample code. It loads a frame and shows the menus, toolbar and
formula bar but no more.

Thanks

Richard.

public static void main(String[] args)
 {
  int i;
  Display display = new Display();
  Shell shell = new Shell(display);

  OleFrame frame = new OleFrame(shell, SWT.NONE);
  frame.setLayoutData(new GridData(GridData.FILL_BOTH));

  Menu bar = new Menu(shell, SWT.BAR);
  shell.setMenuBar(bar);

  OleClientSite clientSite = new OleClientSite(frame,
SWT.NONE, "Excel.Sheet");

  //OleAutomation oleAutomation = new
OleAutomation(clientSite);

  clientSite.setEnabled(true);
  clientSite.setVisible(true);

  frame.setVisible(true);
  clientSite.setSize(900, 900);

  i = clientSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);

  frame.setSize(1000,1000);

  System.out.println(frame.getSize());

  if(i == OLE.S_OK)
  {
   System.out.println("OK");
  }
  shell.open();
  shell.setSize(1001, 1001);

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


  display.dispose ();
 }

-----Original Message-----
From: Veronika Irvine [mailto:Veronika_Irvine@xxxxxxx]
Sent: 04 November 2002 14:20
To: platform-swt-dev@xxxxxxxxxxx
Subject: Re: [platform-swt-dev] Using Excel ActiveX control in SWT



Please post some sample code.  Have you given the OleFrame a size or added
a layout to its parent?





                      "Elliott, R C (Richard)

                      - London Particle Team"         To:
"'platform-swt-dev@xxxxxxxxxxx'" <platform-swt-dev@xxxxxxxxxxx>

                      <ElliottR2@xxxxxxxxxxxx         cc:

                      m>                              Subject:
[platform-swt-dev] Using Excel ActiveX control in SWT

                      Sent by:

                      platform-swt-dev-admin@

                      eclipse.org





                      04/11/2002 02:42 AM

                      Please respond to

                      platform-swt-dev








I followed the instruction in the article "ActiveX Support in SWT" to use
Excel in SWT.

When my program runs I can only view the Excel menu bar (minus the file
menu) and the toolbar but no spreadsheet is visible.

What could I be doing wrong? Does excel require a specail layout or does
the
composite in which it sits have to be scrollable? Anyone else tried this
successfully?

Thanks
Richard

============================================================================


====================

This electronic message (email) and any attachments to it are subject to
copyright and are sent for the personal attention of the addressee.
Although you may be the named recipient, it may become apparent that this
email and its contents are not intended for you and an addressing error has
been made. This email may include information that is legally privileged
and exempt from disclosure. If you have received this email in error,
please advise us immediately and delete this email and any attachments from
your computer system.   Coöperatieve Centrale Raiffeisen-Boerenleenbank BA
(trading as Rabobank Group Treasury and Rabobank
International),incorporated in the Netherlands. Registered with the
Registrar of Companies for England & Wales No. BR002630. Regulated by the
FSA.

The presence of this footnote also confirms that this email has been
automatically checked by us for the presence of computer viruses prior to
it being sent, however, no guarantee is given or implied that this email is
virus free upon delivery.

==================================================================

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev




_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev

============================================================================

====================

This electronic message (email) and any attachments to it are subject to
copyright and are sent for the personal attention of the addressee.
Although you may be the named recipient, it may become apparent that this
email and its contents are not intended for you and an addressing error has
been made. This email may include information that is legally privileged
and exempt from disclosure. If you have received this email in error,
please advise us immediately and delete this email and any attachments from
your computer system.   Coöperatieve Centrale Raiffeisen-Boerenleenbank BA
(trading as Rabobank Group Treasury and Rabobank
International),incorporated in the Netherlands. Registered with the
Registrar of Companies for England & Wales No. BR002630. Regulated by the
FSA.

The presence of this footnote also confirms that this email has been
automatically checked by us for the presence of computer viruses prior to
it being sent, however, no guarantee is given or implied that this email is
virus free upon delivery.

==================================================================




_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev

================================================================================================

This electronic message (email) and any attachments to it are subject to
copyright and are sent for the personal attention of the addressee.
Although you may be the named recipient, it may become apparent that this
email and its contents are not intended for you and an addressing error has
been made. This email may include information that is legally privileged
and exempt from disclosure. If you have received this email in error,
please advise us immediately and delete this email and any attachments from
your computer system.   Coöperatieve Centrale Raiffeisen-Boerenleenbank BA
(trading as Rabobank Group Treasury and Rabobank
International),incorporated in the Netherlands. Registered with the
Registrar of Companies for England & Wales No. BR002630. Regulated by the
FSA.

The presence of this footnote also confirms that this email has been
automatically checked by us for the presence of computer viruses prior to
it being sent, however, no guarantee is given or implied that this email is
virus free upon delivery.

==================================================================






Back to the top