Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Clock Gadgets Customize

02 Nov 2009   #1
newtek

windows 7 pro
 
 
Clock Gadgets Customize

Hello I'm new to the SevenForums. and yes I did search for my question but no one as asked this before. first I am not a programmer...but this does nto mean I do not understand teh basics.

It is easier for me to backward engeneer simple code than to learn from scratch. What I ahve already accomplished.

1. have edited the iamges to the system clock gadget to suit my needs. the H hand, min hand and Second hand and face

2. the main artwork is based on the system clock defauylt of 129 x 129 px and the hands based on 129 x 13 px.

3. teh default for all these is base on center of the artwork and every clock has the second hand rotating from the center an d on top of the hour an d min hands..

what I want to do is have my second had off center as per this watch here



I have gone through all html an dCss an dJS file the only one that changes the actual postion of teh parts is "clock.js"

Code:
 
case "system":
clockFont = "Arial Narrow, " + clockFont;
clockFontColor = "#666666";
topPX += 3;
leftPX += 1;
maxClockNameWidth = 72;
clockPartsWidth = 16;
clockPartsHeight = 129;
clockPartsTop = 0; 
clockPartsLeft = 58;
break;

I've hilighted teh code that change this but it effects all the clock parts so if I add clockpartstop = 60; teh hall the hand move down 60 px

teh other code which I thought would work is the "Clock.html"

Code:
 
<html>
<head>
<meta http-equiv="MSThemeCompatible" CONTENT="yes" />
<meta http-equiv="Content-Type" content="text/html; charset=Unicode" />
<title>Clock</title>
<link href="css/clock.css" rel="stylesheet" type="text/css" />
<script src="js/timeZones.js" language="javascript" type="text/javascript"></script>
<script src="js/settings.js" language="javascript" type="text/javascript"></script>
<script src="js/clock.js" language="javascript" type="text/javascript"></script>
 
<script type="text/javascript">
 
window.google_analytics_uacct = "UA-1848300-2";
 
 
</script>
</head>
<body scroll="no" unselectable="on" onload="loadMain()" onmouseover="updateTooltip()">
<img id="clockTime" style="position:absolute;top:-1px;left:-1px;width:1px;height:1px" tabindex="1" />
<g:background id="clockBg" style="position:absolute;width:130px;height:130px;z-index:-1" />
<g:image id="highlights" unselectable="on" src="http://www.sevenforums.com/images/spacer_highlights.png" style="position:absolute;left:3px;top:3px;width:124px;height:124px;z-index:30" />
<g:image id="dot" unselectable="on" src="http://www.sevenforums.com/images/trad_dot.png" style="position:absolute;left:58px;top:0px;width:13px;height:129px;z-index:23" />
<g:image id="s" unselectable="on" src="http://www.sevenforums.com/images/trad_s.png" style="position:absolute;left:58px;top:0px;width:13px;height:129px;z-index:22" />
<g:image id="m" unselectable="on" src="http://www.sevenforums.com/images/trad_m.png" style="position:absolute;left:58px;top:0px;width:13px;height:129px;z-index:21" />
<g:image id="h" unselectable="on" src="http://www.sevenforums.com/images/trad_h.png" style="position:absolute;left:58px;top:0px;width:13px;height:129px;z-index:20" />
<div id="clockNamePosition" style="position:absolute;top:75px;left:-1px;width:130px;text-align:center;z-index:10">
<div id="clockName" style="text-overflow:ellipsis;white-space:nowrap;overflow:hidden"></div>
</div>
 
<script type="text/javascript"><!--
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
//-->
</script>
<script type="text/javascript"><!--
try {
var pageTracker = _gat._getTracker("UA-1848300-2");
pageTracker._trackPageview();
} catch(err) {}
//-->
</script>
</body>
</html>
but as you can see the default code is for Trad...I did change this to "system_h, s m and dot" but made no difference.

The other thing I tried was editing the default 16x129 parts for the second d had to 64 x 16...this seemed to work but the second had is now located to the top look good but in the wrong position...since we cannot edit the default setting without effecting the other hands too

so back to square one...how can I edit this code to add another string for the second hand only so that it aligns as per the example image above?

Thank in advance for taking the time to read and hopefully point me in the right direction


My System SpecsSystem Spec
.
03 Nov 2009   #2
Generator

XP Pro SP3 x86/Vista SP2 x64/Win7 x64 Triple-boot
 
 

In "clock.js" it's the following line thats locking it in place vertically with the rest of them:
Code:
dot.style.top = h.style.top = m.style.top = s.style.top = clockPartsTop;
so change that line to exclude the 's.style.top' like so:

Code:
dot.style.top = h.style.top = m.style.top = clockPartsTop;


then, further up the file where the 'case' blocks of code are, you could add the following line:
Code:
s.style.top = 60;
so it would resemble something like this (notice the line added just before 'break;'):
Code:
case "trad":
   clockFont = "Constantia, " + clockFont;
   clockFontColor = "#2F2E2E";
   topPX += -3;
   leftPX += -1;
   maxClockNameWidth = 66;
   clockPartsWidth = 13;
   clockPartsHeight = 129;
   clockPartsTop = -1;
   clockPartsLeft = 57;
   s.style.top = 60;
   break;
My System SpecsSystem Spec
03 Nov 2009   #3
newtek

windows 7 pro
 
 

cool thanks I'll give it go
My System SpecsSystem Spec
.

03 Nov 2009   #4
newtek

windows 7 pro
 
 

worked like a charm..thank you..all I need to do is tweak the artwork
My System SpecsSystem Spec
03 Nov 2009   #5
Generator

XP Pro SP3 x86/Vista SP2 x64/Win7 x64 Triple-boot
 
 

No problem newtek! Glad it worked for you.

Welcome to SevenForum's too btw.
My System SpecsSystem Spec
Reply

 Clock Gadgets Customize




Thread Tools






Similar help and support threads
Thread Forum
Clock gadget gone, but other gadgets remain
Hi, My clock gadget suddenly disappears when I open the pc today. My pc specs are W7 64bit (more in system specs). I noticed that when I right click and go to the 'gadgets' menu, it does not respond. Other gadget related that do not respond: Desktop gadget gallery Restore desktop gadgets...
Gadgets
How do I restore the clock to my desktop gadgets?
I accidently uninstalled the clock from my desktop gadgets and would like it back. Help!:o
Gadgets
[Find] Media & Clock Gadgets or Widgets
I Need Media Gadgets For My Desktop But I Need Settings That Gadgets Link to AIMP3 Not WMP. Can Anyone Recommend ? And One Gadgets for Digital Clock With Settings for London, UK Time
Gadgets
Gadgets - Clock - Not working - Won't appear after restart
Hello, I got issues with my gadget clock, I can add it, but I can't change its skins. After I restart, it's gone. Any ideas? I'm pretty sure, it's the Windows one, not 3rd party. Best Regards, ~tEh'Pār4d0x
Gadgets
Gadgets - Customize
How to Customize Existing Windows 7 Gadgets The question having been asked in the "post your seven desktop" thread, i thought it was maybe interesting to deepen that with a new and clear post... So, the subject here is how to change icons and type/color of font in a windows gadget :orb: to...
Tutorials
What programs/gadgets to use to customize your desktop?
I see a lot of guys running a CPU monitor & a fan monitor/control on their desktop. And I've seen some date/clock/weather one's that are pretty cool too. And I understand there's some cool icon things too. So lets see what little gadgets you guys have used to customize your desktop. And a...
Customization


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 04:28.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App