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/>
19 import "amlich-hnd.js" as AmLich
20 import "amlich-aa98.js" as AmLich98
22 import "Settings.js" as Settings
23 import "Themes.js" as Themes
30 property int curDay: LC.curDay()
31 property int curMonth: LC.curMonth()
32 property int curYear: LC.curYear()
34 property int initcurDay: LC.curDay()
35 property int initcurMonth: LC.curMonth()
36 property int initcurYear:LC.curYear()
38 property int lunarDay: AmLich.getLunarDate(curDay,curMonth,curYear).day
39 property int lunarMonth: AmLich.getLunarDate(curDay,curMonth,curYear).month
40 property string lunarYear: AmLich.getCanChi(AmLich.getLunarDate(curDay,curMonth,curYear))[2]
42 property int lunarYearInt : AmLich.getLunarDate(curDay,curMonth,curYear).year
43 property int jd : AmLich.getLunarDate(curDay,curMonth,curYear).jd
44 property string lunarGioHoangDao : AmLich.getGioHoangDao(jd)
46 property string lunarDayCanChi : AmLich.getCanChi(AmLich.getLunarDate(curDay,curMonth,curYear))[0]
47 property string lunarMonthCanChi : AmLich.getCanChi(AmLich.getLunarDate(curDay,curMonth,curYear))[1]
49 //property string lunarCanHour : AmLich.getCanHour0(LC.curHour())
55 property alias theme: theme_manager.item
56 source: Themes.default_theme()
66 source: theme_manager.theme.background_image; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3
75 property int fixed: 40
78 anchors.fill: parent;anchors.topMargin: 60;anchors.bottomMargin:60;
81 if (Settings.pressandhold()==1){
82 screen.state="xemngaytotxauhoangdao"
88 if (Settings.doubleclicked()==1){
89 screen.state="datetimedialog"
101 text: "Tháng "+screen.curMonth+" Năm "+screen.curYear
102 anchors.horizontalCenter: parent.horizontalCenter
104 font.family: "Tahoma"
106 horizontalAlignment: Text.AlignHCenter
110 //------------------------------------------------
117 anchors.horizontalCenter: parent.horizontalCenter
118 property int index: 0
119 onIndexChanged: txtDATEpv.currentIndex = reelx.index
129 font.pixelSize: wrapper.PathView.isCurrentItem ? 80 : 40
130 color: wrapper.PathView.isCurrentItem ? "#FFFFFF" : "grey"
142 preferredHighlightBegin: 0.5
143 preferredHighlightEnd: 0.5
144 highlightRangeMode: PathView.StrictlyEnforceRange
149 PathLine {x: reelx.width; y: 50}
152 calculateLunar(txtDATEpv.currentIndex+1, LC.curMonth(), LC.curYear())
160 while(maindatemodel.count>0){
161 try{maindatemodel.remove(maindatemodel.count-1)}catch(e){}
164 for(var i=1;i<=LC.calDays(screen.curMonth,screen.curYear);i++)
166 reelx.index = screen.curDay -1
170 //-------------------------------------------------
171 Component.onCompleted: {
172 maindatemodel.reset()
182 text: AmLich.getTHU(screen.jd)
183 horizontalAlignment: Text.AlignHCenter
184 anchors.horizontalCenter: parent.horizontalCenter
198 text: "Ngày <span style='color:#C0C0C0;'>"+screen.lunarDay+" ("+screen.lunarDayCanChi+")</span><br>Tháng <span style='color:#C0C0C0;'>"+screen.lunarMonth+" ("+screen.lunarMonthCanChi+")</span><br>Năm <span style='color:#C0C0C0;'>"+screen.lunarYearInt+" ("+screen.lunarYear+")</span>"
199 horizontalAlignment: Text.AlignHCenter
200 anchors.horizontalCenter: parent.horizontalCenter
210 anchors.verticalCenter: parent.verticalCenter
211 width: parent.width; height: parent.height-60;
212 x: -(screen.width * 1.5)
217 state:"optionsscreen"
218 anchors.verticalCenter: parent.verticalCenter
219 width: parent.width; height: parent.height-60;
220 x: -(screen.width * 1.5)
223 XemNgayTotXauHoangDao{
225 state:"xemngaytotxauhoangdao"
226 anchors.verticalCenter: parent.verticalCenter
227 width: parent.width; height: parent.height-60;
228 x: -(screen.width * 1.5)
233 state:"datetimedialog"
234 anchors.verticalCenter: parent.verticalCenter
235 width: parent.width; height: parent.height-60;
236 x: -(screen.width * 1.5)
241 state:"amdatetimedialog"
242 anchors.verticalCenter: parent.verticalCenter
243 width: parent.width; height: parent.height-60;
244 x: -(screen.width * 1.5)
250 anchors.verticalCenter: parent.verticalCenter
251 width: parent.width; height: parent.height-60;
252 x: -(screen.width * 1.5)
257 state:"nofeaturedialog"
258 anchors.verticalCenter: parent.verticalCenter
259 width: parent.width; height: parent.height-60;
260 x: -(screen.width * 1.5)
267 anchors.verticalCenter: parent.verticalCenter
268 width: parent.width; height: parent.height-60;
269 x: -(screen.width * 1.5)
273 MultiTitleBar { id: titleBar; width: parent.width }
274 ToolBar { id: toolBar; height: 50;
275 y: screen.height - 48
276 width: parent.width; opacity: 0.9
278 button2Label: "Lựa Chọn"
281 screen.state="menuscreen"
284 screen.state="optionsscreen"
292 PropertyChanges { target: menuScreen; x: 0; focus:true}
293 PropertyChanges { target: toolBar; y: screen.height }
294 PropertyChanges { target: toolBar }
295 PropertyChanges { target: mouseareaMM;enabled:false }
299 name: "optionsscreen";
300 PropertyChanges { target: optionsScreen; x: 0; focus:true}
301 PropertyChanges { target: toolBar; y: screen.height }
302 PropertyChanges { target: toolBar }
303 PropertyChanges { target: mouseareaMM;enabled:false }
307 name: "xemngaytotxauhoangdao";
308 PropertyChanges { target: xntxhdScreen; x: 0; focus:true}
309 PropertyChanges { target: toolBar; y: screen.height }
310 PropertyChanges { target: toolBar }
311 PropertyChanges { target: mouseareaMM;enabled:false }
315 name: "datetimedialog";
316 PropertyChanges { target: datetimeDialog; x: 0; focus:true}
317 PropertyChanges { target: toolBar; y: screen.height }
318 PropertyChanges { target: toolBar }
319 PropertyChanges { target: mouseareaMM;enabled:false }
320 PropertyChanges { target: reelx;enabled:false }
323 datetimeDialog.reset()
328 name: "amdatetimedialog";
329 PropertyChanges { target: amdatetimeDialog; x: 0; focus:true}
330 PropertyChanges { target: toolBar; y: screen.height }
331 PropertyChanges { target: toolBar }
332 PropertyChanges { target: mouseareaMM;enabled:false }
333 PropertyChanges { target: reelx;enabled:false }
336 amdatetimeDialog.reset()
341 name: "nofeaturedialog";
342 PropertyChanges { target: nofeatureDialog; x: 0; focus:true}
343 PropertyChanges { target: toolBar; y: screen.height }
344 PropertyChanges { target: toolBar }
345 PropertyChanges { target: mouseareaMM;enabled:false }
346 PropertyChanges { target: reelx;enabled:false }
350 PropertyChanges { target: aboutDialog; x: 0; focus:true}
351 PropertyChanges { target: toolBar; y: screen.height }
352 PropertyChanges { target: toolBar }
353 PropertyChanges { target: mouseareaMM;enabled:false }
356 name: "xemtheothang";
357 PropertyChanges { target: fullmonthDialog; x: 0; focus:true}
358 PropertyChanges { target: toolBar; y: screen.height }
359 PropertyChanges { target: toolBar }
362 fullmonthDialog.reset()
365 PropertyChanges { target: mouseareaMM;enabled:false }
370 Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
374 function lunarTietKhi(){
375 return AmLich.TIETKHI[AmLich.getSunLongitude(screen.jd+1,7.0)];
379 function calculateLunar(D,M,Y){
383 screen.lunarDay = AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).day
384 screen.lunarMonth = AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).month
385 screen.lunarYearInt = AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).year
386 screen.lunarYear = AmLich.getCanChi(AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear))[2]//AmLich.getYearCanChi(screen.curYear)
387 screen.jd = AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).jd
388 screen.lunarGioHoangDao = AmLich.getGioHoangDao(screen.jd)
390 screen.lunarDayCanChi = AmLich.getCanChi(AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear))[0]
391 screen.lunarMonthCanChi = AmLich.getCanChi(AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear))[1]
396 calculateLunar(initcurDay, initcurMonth, initcurYear)
397 LC.reset(initcurDay, initcurMonth, initcurYear)
398 screen.state="mainscreen"
399 maindatemodel.reset()
400 txtDATEpv.currentIndex = initcurDay-1;
406 Component.onCompleted: {