changeset 14:36b4efb34027

DateTime widget for windows
author Frank Benoit <benoit@tionex.de>
date Thu, 21 Feb 2008 18:08:51 +0100
parents 4406de6f216f
children 5c244d50e532
files dwtexamples/controlexample/ControlExample.d dwtexamples/controlexample/DateTimeTab.d
diffstat 2 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/dwtexamples/controlexample/ControlExample.d	Fri Feb 15 00:17:51 2008 +0100
+++ b/dwtexamples/controlexample/ControlExample.d	Thu Feb 21 18:08:51 2008 +0100
@@ -31,7 +31,9 @@
 import dwtexamples.controlexample.CanvasTab;
 import dwtexamples.controlexample.ComboTab;
 import dwtexamples.controlexample.CoolBarTab;
-//import dwtexamples.controlexample.DateTimeTab;
+version(Windows){
+    import dwtexamples.controlexample.DateTimeTab;
+}
 version(linux){
     import dwtexamples.controlexample.DialogTab;
 }
@@ -68,7 +70,6 @@
     void main(){
         Stdout.formatln( "The ControlExample: still work left" );
         Stdout.formatln( "todo: Implement Get/Set API reflection" );
-        Stdout.formatln( "todo: DateTimeTab not implemented" );
         Stdout.formatln( "" );
         version(Windows){
         Stdout.formatln( "On Windows:" );
@@ -84,6 +85,7 @@
         version(linux){
         Stdout.formatln( "todo: ExpandBarTab looks strange" );
         Stdout.formatln( "On linux GTK:" );
+        Stdout.formatln( "todo: DateTimeTab not implemented" );
         Stdout.formatln( "bug:  ProgressBarTab crash on vertical" );
         Stdout.formatln( "        in java it behaves the same" );
         Stdout.formatln( "bug:  SliderTab horizontal arrow buttons are too high." );
@@ -158,7 +160,7 @@
             new CanvasTab (this),
             new ComboTab (this),
             new CoolBarTab (this),
-            //new DateTimeTab (this), // DateTime Control not implemented
+            new DateTimeTab (this),
             //new DialogTab (this),   // Dialog not implemented
             new ExpandBarTab (this),
             new GroupTab (this),
--- a/dwtexamples/controlexample/DateTimeTab.d	Fri Feb 15 00:17:51 2008 +0100
+++ b/dwtexamples/controlexample/DateTimeTab.d	Thu Feb 21 18:08:51 2008 +0100
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*******************************************************************************
  * Copyright (c) 2000, 2007 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
@@ -22,6 +22,9 @@
 import dwt.widgets.Group;
 import dwt.widgets.Widget;
 
+import dwtexamples.controlexample.Tab;
+import dwtexamples.controlexample.ControlExample;
+
 class DateTimeTab : Tab {
     /* Example widgets and groups that contain them */
     DateTime dateTime1;
@@ -98,21 +101,21 @@
      * Gets the "Example" widget children.
      */
     Widget [] getExampleWidgets () {
-        return new Widget [] {dateTime1};
+        return [dateTime1];
     }
 
     /**
      * Returns a list of set/get API method names (without the set/get prefix)
      * that can be used to set/get values in the example control(s).
      */
-    String[] getMethodNames() {
-        return new String[] {"Day", "Hours", "Minutes", "Month", "Seconds", "Year"};
+    char[][] getMethodNames() {
+        return ["Day", "Hours", "Minutes", "Month", "Seconds", "Year"];
     }
 
     /**
      * Gets the text for the tab folder item.
      */
-    String getTabText () {
+    char[] getTabText () {
         return "DateTime";
     }