You should ask this question in the
SWT newsgroup (http://www.eclipse.org/newsportal/thread.php?group=eclipse.platform.swt).
I don't think the menus show up by default
unless you add them (at least, I don't see any menus when I run your example
on my machine). However, the toolbars do show up but they are added by
the Application.
However, you can turn off these menubars
and toolbars by sending the application appropriate commands. I found these
commands from MSDN after some digging.
Essentially, you have to send turn off
the toolbars that you don't want visible. In VB, the syntax is something
like this:
Display display = new
Display();
Shell shell = (new
Try2()).open(display);
while
(!shell.isDisposed()) {
if
(!display.readAndDispatch()) {
display.sleep();
}
}
clientSite.dispose();
display.dispose();
}
}
Sajid <sajid622@xxxxxxxxxxx> Sent by: platform-swt-dev-bounces@xxxxxxxxxxx
04/08/2008 08:48 AM
Please respond to
"Eclipse Platform SWT component developers list."
<platform-swt-dev@xxxxxxxxxxx>
To
<platform-swt-dev@xxxxxxxxxxx>
cc
Subject
[platform-swt-dev] Hiding menus and
toolbars from Excel Sheet
Hi,
I'm very new to Java development, specially to SWT and OLE.
I used OleClientSite to display an Excel sheet on SWT shell. Though it
displays fine, but my requirement is not to show any Excel menus and Tool
bars so that user should not be able to save or apply formating etc. I
have also read different answers at the mailing list and snippets at http://www.eclipse.org/swt/snippets/
that OleControlSite should be used for this purpose but still
this does not solve my problem. Because still I can see the menus and toolbars,
also the contents of my excel sheet does not get loaded and all the cells
appear blank.
Can anybody help to solve this problem? Some code will be very helpful
for me.
I have office 2007, SWT 3.3.1 and JDK 5 installed. Below is my code:
public class Try2 {
private Shell shell;
static OleClientSite clientSite;
public Shell open(Display display){
this.shell=new Shell(display, SWT.MIN);
final Button saveChangesButton = new Button(shell,
SWT.NONE);
saveChangesButton.setText("Save Changes");
saveChangesButton.setBounds(64, 405, 93, 23);
OleFrame frame = new OleFrame(shell,SWT.NONE);
frame.setBounds(0, 0, (shell.getSize().x)-5,
400);
final File file= new File("D:/Work/Worksheet1.xls");
try{
clientSite = new OleClientSite(frame,
SWT.NONE, file);
this.shell.layout();
Connect to the next generation of MSN Messenger
Get
it now! _______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev