Mercurial > projects > dwt-samples
annotate dwtexamples/controlexample/CustomControlExample.d @ 65:a84ba4d1820f
restructure the dsss.conf and resources
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Apr 2008 21:15:36 +0200 |
parents | 5c244d50e532 |
children |
rev | line source |
---|---|
0 | 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 *******************************************************************************/ | |
13 module dwtexamples.controlexample.CustomControlExample; | |
14 | |
15 import dwt.layout.FillLayout; | |
16 import dwt.widgets.Composite; | |
17 import dwt.widgets.Display; | |
18 import dwt.widgets.Shell; | |
19 | |
11
b61e7baf0574
Reworked the DrawingBoard for better organization. And also removed the linker fixes in the source files and moved it to dsss.conf by adding buildflags+=-L-lDD-tango-util.
Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
parents:
0
diff
changeset
|
20 import tango.io.Stdout; |
b61e7baf0574
Reworked the DrawingBoard for better organization. And also removed the linker fixes in the source files and moved it to dsss.conf by adding buildflags+=-L-lDD-tango-util.
Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
parents:
0
diff
changeset
|
21 |
0 | 22 import dwtexamples.controlexample.ControlExample; |
23 import dwtexamples.controlexample.CComboTab; | |
24 import dwtexamples.controlexample.CLabelTab; | |
25 import dwtexamples.controlexample.CTabFolderTab; | |
26 import dwtexamples.controlexample.SashFormTab; | |
27 import dwtexamples.controlexample.StyledTextTab; | |
28 import dwtexamples.controlexample.Tab; | |
29 | |
65
a84ba4d1820f
restructure the dsss.conf and resources
Frank Benoit <benoit@tionex.de>
parents:
15
diff
changeset
|
30 public class CustomControlExampleFactory : IControlExampleFactory { |
a84ba4d1820f
restructure the dsss.conf and resources
Frank Benoit <benoit@tionex.de>
parents:
15
diff
changeset
|
31 CustomControlExample create(Shell shell, char[] title) { |
a84ba4d1820f
restructure the dsss.conf and resources
Frank Benoit <benoit@tionex.de>
parents:
15
diff
changeset
|
32 |
0 | 33 Stdout.formatln( "The CustomControlExample: still work left" ); |
34 Stdout.formatln( "warning in Control:setBounds() line=695 gtk_widget_size_allocate()" ); | |
35 Stdout.formatln( "Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 15" ); | |
36 Stdout.formatln( "for the CTabFolder widget. Params are OK. Further bugtracking needed." ); | |
37 Stdout.formatln( "please report problems" ); | |
65
a84ba4d1820f
restructure the dsss.conf and resources
Frank Benoit <benoit@tionex.de>
parents:
15
diff
changeset
|
38 |
a84ba4d1820f
restructure the dsss.conf and resources
Frank Benoit <benoit@tionex.de>
parents:
15
diff
changeset
|
39 auto res = new CustomControlExample( shell ); |
a84ba4d1820f
restructure the dsss.conf and resources
Frank Benoit <benoit@tionex.de>
parents:
15
diff
changeset
|
40 shell.setText(ControlExample.getResourceString("custom.window.title")); |
a84ba4d1820f
restructure the dsss.conf and resources
Frank Benoit <benoit@tionex.de>
parents:
15
diff
changeset
|
41 return res; |
0 | 42 } |
43 } | |
44 | |
65
a84ba4d1820f
restructure the dsss.conf and resources
Frank Benoit <benoit@tionex.de>
parents:
15
diff
changeset
|
45 |
0 | 46 public class CustomControlExample : ControlExample { |
47 | |
48 /** | |
49 * Creates an instance of a CustomControlExample embedded | |
50 * inside the supplied parent Composite. | |
51 * | |
52 * @param parent the container of the example | |
53 */ | |
54 public this(Composite parent) { | |
55 super (parent); | |
56 } | |
57 | |
58 /** | |
59 * Answers the set of example Tabs | |
60 */ | |
61 Tab[] createTabs() { | |
62 return [ cast(Tab) | |
63 new CComboTab (this), | |
64 new CLabelTab (this), | |
65 new CTabFolderTab (this), | |
66 new SashFormTab (this), | |
67 new StyledTextTab (this) | |
68 ]; | |
69 } | |
70 } |