Testing ways to get user input
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Sun, 7 Aug 2011 16:43:33 +0000 (19:43 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Sun, 7 Aug 2011 16:43:33 +0000 (19:43 +0300)
Looks wild...

qml/MainPage.qml

index 1e77268..7d673ac 100644 (file)
@@ -1,6 +1,7 @@
 import QtQuick 1.1
 import com.meego 1.0
 import QtQuick 1.0
+import com.nokia.extras 1.0
 
 
 Page {
@@ -18,13 +19,7 @@ Page {
 //        text: qsTr("Hello world!")
 //        visible: false
 //    }
-//    Button{
-//        anchors.horizontalCenter: parent.horizontalCenter
-//        anchors.top: label.bottom
-//        anchors.topMargin: 10
-//        text: qsTr("Click here!")
-//        onClicked: newGameDialog.open()
-//    }
+
 
     Image
     {
@@ -43,6 +38,7 @@ Page {
         {
             name: "Normal clock"
             askAddition: false
+            logoFile: ":/rc/pic/oldclock.png"
 
 
         }
@@ -51,30 +47,35 @@ Page {
         {
             name: "Addition before"
             askAddition: true
+            logoFile: ":/rc/pic/addbefore.png"
         }
 
         ListElement
         {
             name: "Addition after"
             askAddition: true
+            logoFile: ":/rc/pic/addafter.png"
         }
 
         ListElement
         {
             name: "Delay"
             askAddition: true
+            logoFile: ":/rc/pic/pausebefore.png"
         }
 
         ListElement
         {
             name: "Delay after"
             askAddition: true
+            logoFile: ":/rc/pic/pauseafter.png"
         }
 
         ListElement
         {
             name:"Hour Glass"
             askAddition: false
+            logoFile:":/rc/pic/hourglass.png"
         }
 
     }
@@ -92,20 +93,34 @@ Page {
 
          model: menuModel
 
-         delegate: Text
+         delegate: Row
          {
-             text: name
-             font.pointSize: 40
-             anchors.topMargin: 12
-             color: "white"
+            Image
+            {
+                source: logoFile
+
+                MouseArea
+                {
+                    anchors.fill: parent
+                    onClicked: {newGameDialog.name = name; newGameDialog.askAddition = askAddition; newGameDialog.open()}
+                }
+            }
 
-            MouseArea
+            Text
             {
-                anchors.fill: parent
-                onClicked: {newGameDialog.name = name; newGameDialog.askAddition = askAddition; newGameDialog.open()}
+                text: name
+                font.pointSize: 40
+                anchors.topMargin: 12
+                color: "white"
+
+                MouseArea
+                {
+                    anchors.fill: parent
+                    onClicked: {newGameDialog.name = name; newGameDialog.askAddition = askAddition; newGameDialog.open()}
+                }
             }
-        }
 
+        }
     }
 
 
@@ -180,27 +195,121 @@ Page {
 //                    visible: true
                 }
 
+
+                TextField
+                {
+                    id: whiteInitialTime
+                    inputMask: "000"
+                }
+
+
+
+                Button
+                {
+                    id: blackInitialTime
+                    text: "pick time"
+  //                  color: "white"
+                    onClicked: initialTimePicker.open()
+                }
+
+
+
                 Text
                 {
                     id: additionalTimeText
                     text: "Additional time"
                     color: "white"
                     font.pointSize: 26
-//                    visible: newGameDialog.askAddition
+                    visible: newGameDialog.askAddition
 //                    anchors.top: initialTimeText.bottom
 //                    anchors.horizontalCenter: parent.horizontalCenter
                 }
 
+
+                TextField
+                {
+                    id: whiteAdditionalTime
+                    inputMask: "000"
+                }
+
+                ListModel
+                {
+                    id: hoursList
+                    ListElement { value: 0}
+                    ListElement {value: 1}
+                    ListElement { value: 2}
+                }
+
+                TumblerColumn
+                {
+
+                    id: hours
+                    selectedIndex: 0
+                    items: hoursList
+
+                    //for (var day = 1; day <= 31; day++) {hoursList.append({"value" : day});
+                }
+
+//                TumblerColumn
+//                {
+//                    id: minutes
+//                    selectedIndex: 0
+//                    items: [0,1,2]
+//                    //for (var day = 1; day <= 31; day++) {minutesList.append({"value" : day});
+//                }
+
+//                TumblerColumn
+//                {
+//                    id: seconds
+//                    selectedIndex:0
+//                    items: [0,1,2]
+//                    //for (var day = 1; day <= 31; day++) {daysList.append({"value" : day});
+//                }
+
+//                Tumbler
+//                {
+//                    columns:[hours]
+//                }
+
+        Slider
+        {
+            id: blackAdditionalTime
+            minimumValue: 0
+            maximumValue: 100
+            value: 1
+            stepSize: 1
+            valueIndicatorVisible: true
+
+        }
+
+
                 Text
                 {
                     text:  "Turns per addition"
                     color: "white"
                     font.pointSize: 26
-//                    visible: newGameDialog.askAddition
+                    visible: newGameDialog.askAddition
 //                    anchors.top: additionalTimeText.bottom
 //                    anchors.horizontalCenter: parent.horizontalCenter
                 }
-    }
+                TextField
+                {
+                    id: whiteTurnsPerAddition
+                    inputMask: "000"
+                }
+
+                Slider
+                {
+                    id: blackTurnsPerAddition
+                    minimumValue: 0
+                    maximumValue: 100
+                    value: 1
+                    stepSize: 1
+                    valueIndicatorVisible: true
+
+                }
+
+         }
 
 
         buttons:
@@ -209,12 +318,20 @@ Page {
             {
                 id: bOk
                 text: "Start game"
-                y: 170
+                y: 150
 
                 onClicked: newGameDialog.accept()
             }
     }
 
+    TimePickerDialog
+    {
+        id: initialTimePicker
+        titleText: "Choose initial time"
+    }
+
 }
 
 
+
+