2095953fd4338a338cc65dfb4f26e707a27c4687
[lichviet] / qml / LichViet / DateTimeDialog.qml
1 /*
2 Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>
16 */
17
18 import QtQuick 1.0
19 import "../DatePicker/component" as Comp
20
21 Item{
22     id: item1
23
24     Rectangle {
25         id: rectangle1
26         x: 0
27         y: -16
28         anchors.centerIn: parent
29         width:344
30         height: 234
31         color: "#19262b"
32         radius: 8
33         border.color: "#b57e8f"
34         visible: true
35         opacity:0.9
36
37
38
39         Column {
40             id: datePicker
41             width: 260
42             property int mDay: screen.curDay
43             property int mMonth: screen.curMonth
44             property int mYear: screen.curYear
45             anchors.centerIn: parent
46
47             Comp.DateReel {
48                 id: dateReel
49                 width: parent.width
50             }}
51
52
53         Button {
54             id: button2
55             x: 102
56             anchors.right: parent.right; anchors.rightMargin: 102; y: 185; width: 140; height: 40
57             text: "OK"
58             visible: true
59             onClicked: {
60                 LC.reset(datePicker.mDay,datePicker.mMonth,datePicker.mYear)
61                 screen.calculateLunar(datePicker.mDay,datePicker.mMonth,datePicker.mYear)
62                 screen.state="mainscreen"
63                 screen.refresh()
64                 maindatemodel.reset()
65                 }
66         }
67
68         Button {
69             id: button3
70             x: 298
71             y: 6
72             width: 39
73             height: 40
74             text: "X"
75             anchors.rightMargin: 56
76             onClicked: {screen.state="mainscreen";screen.refresh();}
77         }
78     }
79
80     function reset(){
81         dateReel.day_reset()
82                 dateReel.month_reset()
83                 dateReel.year_reset()
84     }
85
86     transitions: [
87         Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
88     ]
89 }