Hi Nebula-Committer & Technology-PMC,
I have a problem with the CDateTime,I use the CDatetime in my Program and add
the CDateTime, when I run this program, I chose a date. All is right but the
shell'menu is disappeared. When I use the mouse to shoot across the
shell'menu,the menu of the shell is appeared. Why? I don't konow how to deal
with this? Can you help me?
I'm sorry that my English is poor.And Thanks for your attention and your help
with this issue.
My code is in the following:
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.nebula.widgets.cdatetime.CDT;
import org.eclipse.swt.nebula.widgets.cdatetime.CDateTime;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
public class Nebula_CDateTime {
private Shell sShell = null;
private CDateTime cdt = null;
private Menu menuBar = null;
public static void main(String[] args) {
// TODO Auto-generated method stub
/* Before this is run, be sure to set up the launch configuration
(Arguments->VM Arguments)
* for the correct SWT library path in order to run with the SWT dlls.
* The dlls are located in the SWT plugin jar.
* For example, on Windows the Eclipse SWT 3.1 plugin jar is:
* installation_directory\plugins\org.eclipse.swt.win32_3.1.0.jar
*/
Display display = Display.getDefault();
Nebula_CDateTime thisClass = new Nebula_CDateTime();
thisClass.createSShell();
thisClass.sShell.open();
while (!thisClass.sShell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
private void createSShell() {
sShell = new Shell();
sShell.setText("CDateTime");
sShell.setSize(new Point(406, 385));
menuBar = new Menu(sShell, SWT.BAR);
MenuItem push = new MenuItem(menuBar, SWT.PUSH);
push.setText("File(&F)");
MenuItem push1 = new MenuItem(menuBar, SWT.PUSH);
push1.setText("Edit(&E)");
MenuItem push2 = new MenuItem(menuBar, SWT.PUSH);
push2.setText("Help(&H)");
sShell.setMenuBar(menuBar);
sShell.setText("Shell");
sShell.setSize(new Point(300, 200));
cdt = new CDateTime(sShell, CDT.BORDER | CDT.DROP_DOWN);
cdt.setFormat(CDT.DATE_MEDIUM);
cdt.setBounds(new Rectangle(42, 20, 100, 16));
}
}
= = = = = = = = = = = = = = = = = = = = = =
致
礼!
韩崇
___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/_______________________________________________
nebula-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/nebula-dev