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 *******************************************************************************/
|
|
13 module examples.controlexample.CustomControlExample;
|
|
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
|
|
22 import examples.controlexample.ControlExample;
|
|
23 import examples.controlexample.CComboTab;
|
|
24 import examples.controlexample.CLabelTab;
|
|
25 import examples.controlexample.CTabFolderTab;
|
|
26 import examples.controlexample.SashFormTab;
|
|
27 import examples.controlexample.StyledTextTab;
|
|
28 import examples.controlexample.Tab;
|
|
29
|
|
30 public class CustomControlExampleFactory : IControlExampleFactory {
|
|
31 CustomControlExample create(Shell shell, char[] title) {
|
|
32
|
|
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" );
|
|
38
|
|
39 auto res = new CustomControlExample( shell );
|
|
40 shell.setText(ControlExample.getResourceString("custom.window.title"));
|
|
41 return res;
|
|
42 }
|
|
43 }
|
|
44
|
|
45
|
|
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 }
|