Mercurial > projects > dwt-samples
view examples/controlexample/CustomControlExample.d @ 161:eb84f9418bbf
Change module names to this not have examples in the FQN.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 01 Sep 2008 22:24:27 +0200 |
parents | 4a04b6759f98 |
children |
line wrap: on
line source
/******************************************************************************* * Copyright (c) 2000, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Port to the D programming language: * Frank Benoit <benoit@tionex.de> *******************************************************************************/ module controlexample.CustomControlExample; import dwt.layout.FillLayout; import dwt.widgets.Composite; import dwt.widgets.Display; import dwt.widgets.Shell; import tango.io.Stdout; import controlexample.ControlExample; import controlexample.CComboTab; import controlexample.CLabelTab; import controlexample.CTabFolderTab; import controlexample.SashFormTab; import controlexample.StyledTextTab; import controlexample.Tab; version(JIVE) import jive.stacktrace; public class CustomControlExampleFactory : IControlExampleFactory { CustomControlExample create(Shell shell, char[] title) { Stdout.formatln( "The CustomControlExample: still work left" ); Stdout.formatln( "warning in Control:setBounds() line=695 gtk_widget_size_allocate()" ); Stdout.formatln( "Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 15" ); Stdout.formatln( "for the CTabFolder widget. Params are OK. Further bugtracking needed." ); Stdout.formatln( "please report problems" ); auto res = new CustomControlExample( shell ); shell.setText(ControlExample.getResourceString("custom.window.title")); return res; } } public class CustomControlExample : ControlExample { /** * Creates an instance of a CustomControlExample embedded * inside the supplied parent Composite. * * @param parent the container of the example */ public this(Composite parent) { super (parent); } /** * Answers the set of example Tabs */ Tab[] createTabs() { return [ cast(Tab) //new CComboTab (this), //new CLabelTab (this), new CTabFolderTab (this) //new SashFormTab (this), //new StyledTextTab (this) ]; } }