2 Copyright (C) 2011 by Cuong Le <metacuong@gmail.com>
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.
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.
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/>
20 import "main.js" as Script
21 import "Themes.js" as Themes
26 anchors.verticalCenter: parent.verticalCenter
27 width: parent.width; height: parent.height;
28 x:(parent.width * 1.5)
34 property alias theme: theme_manager.item
35 source: Themes.default_theme()
42 xntxhd.state = "close";
47 property string day_month_year_LN_CN: ""
48 property string nhi_thap_bat_tu: ""
49 property string truc: ""
50 property string luan_giai: ""
51 property string cac_sao_xau: ""
52 property string cac_sao_tot: ""
53 property string huong_xuat_hanh: ""
55 property string warnning: "<span style='color:red;'>Thông tin trên đây được lấy nguồn từ <a href='http://www.xemngay.com'>www.xemngay.com</a> và chỉ mang tính chất <b>tham khảo</b></span>."
60 anchors.fill: parent; anchors.bottomMargin: 0;
71 width:rectangle1.width-10;
75 border.color: "#b57e8f"
78 width:rectangle1.width
81 width:rectangle1.width;
82 height:10;color:"transparent"
85 Text { x:5;y:50;text:getHD(name,idm) ;textFormat: Text.RichText;wrapMode: Text.WordWrap; font.pixelSize: 20
86 font.family: "Tahoma";width:parent.width-10;}
89 width:rectangle1.width;
90 height:10;color:"transparent"
107 idm:1;name: "<b>Giờ Hoàng Đạo</b>";
110 idm:2;name: "<b>Tiết Khí</b>";
113 idm:3;name: "<b>Nhị Thập Bát Tú</b>";
116 idm:-2;name: "<b>Hướng Xuất Hành</b>";
119 idm:6;name: "<b>Các Sao Tốt</b>";
122 idm:7;name: "<b>Các Sao Xấu</b>";
129 idm:5;name: "<b>Đánh Giá</b>";
137 anchors.fill: parent;anchors.topMargin: 45;anchors.leftMargin: 5;anchors.rightMargin: 5;anchors.bottomMargin: 55
139 delegate: listDelegate
148 id: toolBar; height: 42;
151 button1Label: "Quay Về"
152 onButton1Clicked:xntxhd.close()
155 function getHD(name,idm){
157 name="<span style='color:blue;'>"+name+"</span><br>";
163 case 0 : return name+ xntxhd.day_month_year_LN_CN;break;
164 case 1 : return name+Script.lunarGioHoangDao;break;
165 case 2 : return name+Script.lunarTietKhi();break;
166 case 3 : return name+xntxhd.nhi_thap_bat_tu; break;
167 case 5 : return name+xntxhd.luan_giai;break;
168 case -1: return name+xntxhd.truc;break;
169 case 6: return name+xntxhd.cac_sao_tot;break;
170 case 7: return name+xntxhd.cac_sao_xau;break;
171 case -2: return name+xntxhd.huong_xuat_hanh;break;
172 case 8: return xntxhd.warnning;break;
177 xntxhd.day_month_year_LN_CN = Script.thu()+",ngày <b>"+Script.curDay+"</b> tháng <b>"+Script.curMonth+"</b> năm <b>"+Script.curYear+"</b><br>Ngày <b>"+Script.lunarDay+"</b> tháng <b>"+Script.lunarMonth+"</b> năm <b>"+Script.lunarYear+"</b> (<b>"+Script.lunarYearInt+"</b>)";
178 xntxhd.nhi_thap_bat_tu = Script.sao(Script.curYear,Script.getLunarDate(Script.curDay,Script.curMonth,Script.curYear).jd - Script.getLunarDate(1,1,Script.curYear).jd);
179 xntxhd.truc = Script.truc(Script.lunarMonth, Script.lunarDayCanChi, Script.lunarMonthCanChi);
180 xntxhd.cac_sao_tot = Script.cacsaotot(Script.lunarMonth, Script.lunarDayCanChi);
181 xntxhd.cac_sao_xau = Script.cacsaoxau(Script.lunarMonth, Script.lunarDayCanChi);
182 xntxhd.luan_giai = Script.luangiai(Script.curDay);
183 xntxhd.huong_xuat_hanh = Script.huong_xuat_hanh(Script.lunarDayCanChi);
196 anchors { horizontalCenter: xntxhd.horizontalCenter; top: xntxhd.top; topMargin: 10 }
199 text: "Xem Ngày Tốt/Xấu"
207 AnchorChanges { target: xntxhd; anchors.right: parent.right }
211 AnchorChanges { target: xntxhd; anchors.right: parent.left }
215 transitions: Transition {
216 AnchorAnimation { easing.type: Easing.OutQuart; duration: 300 }