Mercurial > projects > dwt-samples
annotate examples/controlexample/CustomControlExample.d @ 179:89de7ff0752c default tip
Add JFace snippet Snippet054NativeControlsInViewers, thanks to WasserDragoon
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 29 Apr 2009 11:01:41 +0200 |
parents | eb84f9418bbf |
children |
rev | line source |
---|---|
78 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2006 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
161
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
13 module controlexample.CustomControlExample; |
78 | 14 |
15 import dwt.layout.FillLayout; | |
16 import dwt.widgets.Composite; | |
17 import dwt.widgets.Display; | |
18 import dwt.widgets.Shell; | |
19 | |
20 import tango.io.Stdout; | |
21 | |
161
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
22 import controlexample.ControlExample; |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
23 import controlexample.CComboTab; |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
24 import controlexample.CLabelTab; |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
25 import controlexample.CTabFolderTab; |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
26 import controlexample.SashFormTab; |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
27 import controlexample.StyledTextTab; |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
28 import controlexample.Tab; |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
29 |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
30 version(JIVE) import jive.stacktrace; |
78 | 31 |
32 public class CustomControlExampleFactory : IControlExampleFactory { | |
33 CustomControlExample create(Shell shell, char[] title) { | |
34 | |
35 Stdout.formatln( "The CustomControlExample: still work left" ); | |
36 Stdout.formatln( "warning in Control:setBounds() line=695 gtk_widget_size_allocate()" ); | |
37 Stdout.formatln( "Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 15" ); | |
38 Stdout.formatln( "for the CTabFolder widget. Params are OK. Further bugtracking needed." ); | |
39 Stdout.formatln( "please report problems" ); | |
40 | |
41 auto res = new CustomControlExample( shell ); | |
42 shell.setText(ControlExample.getResourceString("custom.window.title")); | |
43 return res; | |
44 } | |
45 } | |
46 | |
47 | |
48 public class CustomControlExample : ControlExample { | |
49 | |
50 /** | |
51 * Creates an instance of a CustomControlExample embedded | |
52 * inside the supplied parent Composite. | |
53 * | |
54 * @param parent the container of the example | |
55 */ | |
56 public this(Composite parent) { | |
57 super (parent); | |
58 } | |
59 | |
60 /** | |
61 * Answers the set of example Tabs | |
62 */ | |
63 Tab[] createTabs() { | |
64 return [ cast(Tab) | |
161
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
65 //new CComboTab (this), |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
66 //new CLabelTab (this), |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
67 new CTabFolderTab (this) |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
68 //new SashFormTab (this), |
eb84f9418bbf
Change module names to this not have examples in the FQN.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
69 //new StyledTextTab (this) |
78 | 70 ]; |
71 } | |
72 } |