XWidgetSoft Forum https://bbs.xwidget.com/ |
|
Show txt on a time ? https://bbs.xwidget.com/viewtopic.php?f=8&t=3658 |
Page 1 of 1 |
Author: | Jimking [ October 18th, 2013, 7:23 am ] | ||
Post subject: | Show txt on a time ? | ||
|
Author: | digigamer [ October 18th, 2013, 11:01 pm ] |
Post subject: | Re: Show txt on a time ? |
Component names cannot be started with a number. That's true for every programming language Name texts with a preceeding character like "num1" etc.. then eval("num"+core1.get(null,"%Hour")).Effect.Glow.Enabled = true; |
Author: | Jimking [ October 19th, 2013, 1:01 am ] |
Post subject: | Re: Show txt on a time ? |
Thanks man!!! And what about the colour of the txt? I will set it from the designer? Edit: Never mind.. I just read your note in DA! |
Author: | Jimking [ October 19th, 2013, 6:37 am ] |
Post subject: | Re: Show txt on a time ? |
Author: | meme [ October 19th, 2013, 4:01 pm ] |
Post subject: | Re: Show txt on a time ? |
Without changing the naming system you have used function datetimecore1OnUpdate(Sender) { ResetAllColors(); ---------------------------------------------------------------------- ADD this line eval(datetimecore1.get("%WeekEn")).Font.Color = rgba(41,1,214,255); eval(datetimecore1.get("%AMPM")).Font.Color = rgba(197,16,16,255); eval("num"+datetimecore1.get("%Hour0")).Font.Color = rgba(0,93,171,255); //hour0 eval("min"+datetimecore1.get("%Minute0")).Font.Color = rgba(0,20,171,255); //minute0 } function ResetAllColors() // reset colors -------------------------------------------------- ADD this function { for (var m=0; m<60; m++) // count up the minutes 0-59 { eval("min" + ("0" + m).slice(-2)).Font.Color = rgba(0,0,0,0); // reset all mins to transparent } for (var h=1; h<12; h++) // count up the hours 1-12 { eval("num" + ("0" + h).slice(-2)).Font.Color = rgba(0,0,0,0); // reset all nums to transparent } eval(AM).Font.Color = rgba(0,0,0,0); eval(PM).Font.Color = rgba(0,0,0,0); eval(Monday).Font.Color = rgba(0,0,0,0); eval(Tuesday).Font.Color = rgba(0,0,0,0); eval(Wednesday).Font.Color = rgba(0,0,0,0); eval(Thursday).Font.Color = rgba(0,0,0,0); eval(Friday).Font.Color = rgba(0,0,0,0); eval(Saturday).Font.Color = rgba(0,0,0,0); eval(Sunday).Font.Color = rgba(0,0,0,0); } //To reduce system resources this code only need to run if the time/seconds = 0 //this could be add with an IF statement at the start of the function datetimecore1OnUpdate(Sender) |
Author: | Jimking [ October 19th, 2013, 6:08 pm ] |
Post subject: | Re: Show txt on a time ? |
Thanks meme!!! Excellent work! Now works as it should, BUT damm, the cpu consumption makes the widget unusable... No way to reduce it..? This happens because of the number of the txts??? If yes, I have an idea! Is a full screen widget. So I can take a screenshot with all the numbers in black, so I can delete all the bottom txts and leave all the other that use the script code! Edit: I did it, I notice some improvement with the cpu but is still high.. So the code causes it..? |
Author: | meme [ October 19th, 2013, 6:58 pm ] |
Post subject: | Re: Show txt on a time ? |
Author: | Jimking [ October 19th, 2013, 7:20 pm ] |
Post subject: | Re: Show txt on a time ? |
Author: | meme [ October 19th, 2013, 7:40 pm ] |
Post subject: | Re: Show txt on a time ? |
Author: | Jimking [ October 19th, 2013, 7:58 pm ] |
Post subject: | Re: Show txt on a time ? |
Author: | meme [ October 19th, 2013, 8:47 pm ] |
Post subject: | Re: Show txt on a time ? |
Author: | Jimking [ October 20th, 2013, 2:45 am ] |
Post subject: | Re: Show txt on a time ? |
Author: | qiancang [ October 20th, 2013, 3:05 am ] |
Post subject: | Re: Show txt on a time ? |
this widget looks great! if you can upload the widget,i think i can reduce the code and components. |
Author: | Jimking [ October 20th, 2013, 4:02 am ] | ||
Post subject: | Re: Show txt on a time ? | ||
|
Author: | qiancang [ October 20th, 2013, 4:45 am ] |
Post subject: | Re: Show txt on a time ? |
how to handle the time 15:12:12? minute and second are the same, second text will cover the minute text. |
Author: | Jimking [ October 20th, 2013, 5:58 am ] |
Post subject: | Re: Show txt on a time ? |
Yes, as the original design (this is actually an Android lwp) the seconds will cover the minute txt but only for one sec when the values will be the same. That's why there are different colours for each part. At the beginning it seemed strange to me too but there is no other option I think.. The difficult part is to fix the cpu consumption with the secs active.. |
Author: | qiancang [ October 20th, 2013, 7:45 am ] | ||
Post subject: | Re: Show txt on a time ? | ||
high cpu usage only at starting. 2% ~ 3% after loading. you can lower the cpu usage by decreasing the glow effect softness
|
Author: | qiancang [ October 20th, 2013, 7:54 am ] |
Post subject: | Re: Show txt on a time ? |
i deleted all the "min" components the second issue does not happen on my PC |
Author: | Jimking [ October 20th, 2013, 7:59 am ] |
Post subject: | Re: Show txt on a time ? |
Author: | qiancang [ October 20th, 2013, 8:10 am ] |
Post subject: | Re: Show txt on a time ? |
Author: | Jimking [ October 20th, 2013, 8:14 am ] |
Post subject: | Re: Show txt on a time ? |
Ok qiancang. Thank you VERY MUCH for you help! |
Author: | Jimking [ October 20th, 2013, 12:19 pm ] |
Post subject: | Re: Show txt on a time ? |
meme what do you think..? Download the qiancang's widget to check the alternative code.. |
Author: | meme [ October 20th, 2013, 4:57 pm ] |
Post subject: | Re: Show txt on a time ? |
Author: | qiancang [ October 20th, 2013, 9:08 pm ] | ||
Post subject: | Re: Show txt on a time ? | ||
one mistake: please replace if(s!=mm) with if(s!=m) in about line 55
|
Author: | Jimking [ October 21st, 2013, 1:32 am ] |
Post subject: | Re: Show txt on a time ? |
Author: | Jimking [ October 21st, 2013, 2:05 am ] |
Post subject: | Re: Show txt on a time ? |
Author: | Jimking [ October 21st, 2013, 3:45 am ] |
Post subject: | Re: Show txt on a time ? |
I start a third test widget using the code by digigamer. I'm starting to add the seconds txts in the widget and add the extra similar fields in the script for the seconds... Let's see how the widget will work.. |
Author: | digigamer [ October 21st, 2013, 3:49 am ] |
Post subject: | Re: Show txt on a time ? |
So this is what you asked! Isn't it? With blinking seconds??? Another version: Shows seconds in green, minutes in royal blue and avoids conflicts between seconds and minutes falling at the same time ex: 04:16:16 PM File comment: Screenshot (scaled to reduce my data) demo.jpg [ 46.2 KiB | Viewed 9805 times ] (Default Image removed to save my data... currently running mobile broadband, costly. Just generate a new one.) |
Author: | Jimking [ October 21st, 2013, 4:03 am ] |
Post subject: | Re: Show txt on a time ? |
Page 1 of 1 | All times are UTC - 8 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |