comparison jface/user/PopUp.d @ 147:5f508f322464

more JFace examples
author Frank Benoit <benoit@tionex.de>
date Sat, 16 Aug 2008 13:21:55 +0200
parents
children 80f47186dc48
comparison
equal deleted inserted replaced
146:7c4b76583cb8 147:5f508f322464
1 module user.PopUp;
2 import tango.util.log.Trace;
3
4 import dwt.dwthelper.utils;
5 import dwt.DWT;
6
7 import dwt.layout.GridLayout;
8 import dwt.layout.GridData;
9
10 import dwt.graphics.Image;
11
12 import dwt.widgets.Text;
13 import dwt.widgets.Control;
14 import dwt.widgets.Composite;
15 import dwt.widgets.Group;
16 import dwt.widgets.Display;
17 import dwt.widgets.Shell;
18 import dwt.widgets.Listener;
19 import dwt.widgets.Event;
20 import dwt.widgets.Button;
21
22 import dwtx.jface.dialogs.PopupDialog;
23
24 import dwtx.jface.window.ApplicationWindow;
25
26 class App : ApplicationWindow {
27
28 this(){
29 super(null);
30 setBlockOnOpen(true);
31 }
32 protected override Control createContents(Composite parent) {
33 Composite comp = cast(Composite)super.createContents(parent);
34 getShell().setText("Test PopupDialog");
35
36 comp.setLayout(new GridLayout(1, false));
37
38
39 auto btn = new Button( comp, DWT.PUSH );
40 btn.addListener( DWT.Selection, dgListener( & doBtn1 ));
41 btn.setText( "Btn 1" );
42 return comp;
43 }
44 void doBtn1( Event e ){
45 Trace.formatln( "btn1");
46 auto pu = new PopupDialog(
47 getShell(),
48 PopupDialog.HOVER_SHELLSTYLE ,
49 true,
50 true,
51 true,
52 true,
53 true,
54 "Title",
55 "Info line...");
56 pu.open();
57 }
58 void doBtn2( Event e ){
59 Trace.formatln( "btn1");
60 auto pu = new PopupDialog(
61 getShell(),
62 PopupDialog.HOVER_SHELLSTYLE,
63 false,
64 true,
65 true,
66 true,
67 true,
68 "Title",
69 "Text\non the other line...");
70 pu.open();
71 }
72
73 }
74
75
76
77 void main(){
78 auto d = new Display();
79 auto app = new App();
80 app.open();
81 }
82
83
84
85