/* Copyright (C) 2011 by Cuong Le This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see */ import QtQuick 1.0 import "amlich-hnd.js" as AmLich import "xemngaytotxau.js" as NTX Item{ Rectangle { id: rectangle1 x: 0 y: -5 anchors.rightMargin: 0 anchors.leftMargin: 0 anchors.topMargin:30 anchors.fill: parent; anchors.bottomMargin: 16 visible: true opacity:0.9 Component { id: listDelegate Column { Rectangle { width:rectangle1.width; y:30; x:0 height:1 border.color: "#b57e8f" } width:rectangle1.width Rectangle{ width:rectangle1.width; height:10; } Text { x:5;y:50;text:getHD(name,idm) ;textFormat: Text.RichText;wrapMode: Text.WordWrap; font.pixelSize: 20 font.family: "Tahoma";width:parent.width;} Rectangle{ width:rectangle1.width; height:10; } } } ListModel { id: listModel ListElement { lheight:55;idm:0;name: ""; } ListElement { lheight:30;idm:-1;name: ""; } ListElement { lheight:85;idm:1;name: "Giờ Hoàng Đạo"; } ListElement { lheight:55;idm:2;name: "Tiết Khí"; } ListElement { lheight:55;idm:3;name: "Nhị Thập Bát Tú"; } ListElement { lheight:80;idm:6;name: "Các sao tốt"; } /* ListElement { lheight:80;idm:7;name: "Các sao xấu"; } ListElement { lheight:120;idm:5;name: "Ngày Tốt/Xấu"; }*/ } ListView { id: listView anchors.fill: parent;anchors.topMargin: 0;anchors.leftMargin: 0; anchors.bottomMargin: 16 model: listModel delegate: listDelegate focus: true } } ToolBarSingle { id: toolBar; height: 50; y: screen.height-78 width: parent.width; button1Label: "Quay Về" onButton1Clicked: { screen.state="mainscreen" } } function getHD(name,idm){ if (name.length){ name=""+name+"
"; } NTX.test(); switch(idm){ case 0 : return name+AmLich.getTHU(screen.jd)+",ngày "+screen.curDay+" tháng "+screen.curMonth+" năm "+screen.curYear+"
Ngày "+screen.lunarDay+" tháng "+screen.lunarMonth+" năm "+screen.lunarYear+" ("+screen.lunarYearInt+")";break; case 1 : return name+screen.lunarGioHoangDao;break; case 2 : return name+screen.lunarTietKhi();break; case 3 : return name+NTX.sao(screen.curYear,AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).jd - AmLich.getLunarDate(1,1,screen.curYear).jd);break; case 5 : return name+NTX.luangiai(screen.curDay);break; case -1: return name+NTX.truc(screen.lunarMonth, screen.lunarDayCanChi, screen.lunarMonthCanChi);break;//"Là ngày: Thiên Lao Hắc Đạo Trực: Định" case 6: return name+NTX.cacsaotot(screen.lunarMonth, screen.lunarDayCanChi);break; case 7: return name+NTX.cacsaoxau(screen.lunarMonth, screen.lunarDayCanChi);break; } } transitions: [ Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } } ] }