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 "amlich-hnd.js" as AmLich
21 import "xemngaytotxau.js" as NTX
26 property string day_month_year_LN_CN: ""
27 property string nhi_thap_bat_tu: ""
28 property string truc: ""
29 property string luan_giai: ""
30 property string cac_sao_xau: ""
31 property string cac_sao_tot: ""
32 property string huong_xuat_hanh: ""
34 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>."
40 anchors.rightMargin: 0
43 anchors.fill: parent; anchors.bottomMargin: 16
54 width:rectangle1.width;
58 border.color: "#b57e8f"
61 width:rectangle1.width
64 width:rectangle1.width;
65 height:10;color:"transparent"
68 Text { x:5;y:50;text:getHD(name,idm) ;textFormat: Text.RichText;wrapMode: Text.WordWrap; font.pixelSize: 20
69 font.family: "Tahoma";width:parent.width;}
72 width:rectangle1.width;
73 height:10;color:"transparent"
90 idm:1;name: "<b>Giờ Hoàng Đạo</b>";
93 idm:2;name: "<b>Tiết Khí</b>";
96 idm:3;name: "<b>Nhị Thập Bát Tú</b>";
99 idm:-2;name: "<b>Hướng Xuất Hành</b>";
102 idm:6;name: "<b>Các Sao Tốt</b>";
105 idm:7;name: "<b>Các Sao Xấu</b>";
112 idm:5;name: "<b>Đánh Giá</b>";
120 anchors.fill: parent;anchors.topMargin: 0;anchors.leftMargin: 0; anchors.bottomMargin: 16
122 delegate: listDelegate
130 ToolBarSingle { id: toolBar; height: 50;
133 button1Label: "Quay Về"
136 screen.state="mainscreen"
140 function getHD(name,idm){
142 name="<span style='color:blue;'>"+name+"</span><br>";
146 case 0 : return name+ main_item.day_month_year_LN_CN;break;
147 case 1 : return name+screen.lunarGioHoangDao;break;
148 case 2 : return name+screen.lunarTietKhi();break;
149 case 3 : return name+main_item.nhi_thap_bat_tu; break;
150 case 5 : return name+main_item.luan_giai;break;
151 case -1: return name+main_item.truc;break;
152 case 6: return name+main_item.cac_sao_tot;break;
153 case 7: return name+main_item.cac_sao_xau;break;
154 case -2: return name+main_item.huong_xuat_hanh;break;
155 case 8: return main_item.warnning;break;
160 main_item.day_month_year_LN_CN = AmLich.getTHU(screen.jd)+",ngày <b>"+screen.curDay+"</b> tháng <b>"+screen.curMonth+"</b> năm <b>"+screen.curYear+"</b><br>Ngày <b>"+screen.lunarDay+"</b> tháng <b>"+screen.lunarMonth+"</b> năm <b>"+screen.lunarYear+"</b> (<b>"+screen.lunarYearInt+"</b>)";
161 main_item.nhi_thap_bat_tu = NTX.sao(screen.curYear,AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).jd - AmLich.getLunarDate(1,1,screen.curYear).jd);
162 main_item.truc = NTX.truc(screen.lunarMonth, screen.lunarDayCanChi, screen.lunarMonthCanChi);
163 main_item.cac_sao_tot = NTX.cacsaotot(screen.lunarMonth, screen.lunarDayCanChi);
164 main_item.cac_sao_xau = NTX.cacsaoxau(screen.lunarMonth, screen.lunarDayCanChi);
165 main_item.luan_giai = NTX.luangiai(screen.curDay);
166 main_item.huong_xuat_hanh = NTX.huong_xuat_hanh(screen.lunarDayCanChi);