Sign in to follow this  
Followers 0
JellyFish666

Graph Clock

4 posts in this topic

#1 ·  Posted (edited)

here is my attempt so far and right now it is a fail lol but looks cool

cyan = hours

purple = minutes

yellow = seconds

Ill update it later but idea's are welcomed

==To do==

- Convert @hours to real hours instead of army time :D (Not fixed it was until hit hit double digits lol)

- fix dirty scan to estimate a better GUI width (seems to be perfect)

- needs a better refresh rate

- add a map to the graph stating the meaning of the ticks/graph [cyan] hours [purple] mins [yellow] seconds

==End==

#include <GUIConstants.au3>
Global $Clock , $X = 0 , $Y = 0
$Clock = GUICreate("Bar Clock", _DirtyScan(), 500 , -1 , -1 , $WS_POPUP)
GUISetBkColor(0x000000, $Clock)
_Time(1 , 1 , 0x00FFFF , 0x00FFFF) ;0xFF0000)
_Time(2 , 1 , 0xFF00FF , 0xFF00FF)
_Time(3 , 1 , 0xFFFF00 , 0xFFFF00)
GUISetState(@SW_SHOW)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    Sleep(1000)
    _Refresh()
WEnd

Func _Time($Time , $Space , $Color1 , $Color2)
    #cs
    $Time = 1 hours
    $Time = 2 minutes
    $Time = 3 seconds
    $Spacer
    $Color
    #ce 
    If $Time = 1 Then
        $Converted = @Hour -12
    ElseIf $Time = 2 Then
        $Converted = @Min 
    ElseIf $Time = 3 Then
        $Converted = @Sec 
    Else
        MsgBox(0 , "" , "error")
    EndIf

    $i = 0
    $Spacer = $Space
    Do
    GUICtrlCreateGraphic($X , $Y, 10 , 500)
    GUICtrlSetColor(-1, $Color1)
    GUICtrlSetBkColor(-1, $Color2)
    $X = $X + 10 + $Spacer
    $i = $i +1
    WinMove($Clock , "" , Default , Default , Default + $X , Default)
    Until $i = $Converted
EndFunc

Func _Refresh()
    $X = 0
    $Y = 0
    GUIDelete($Clock)
    $Clock = GUICreate("Bar Clock", _DirtyScan(), 500 , -1 , -1 , $WS_POPUP)
    GUISetBkColor(0x000000, $Clock)
    _Time(1 , 1 , 0x00FFFF , 0x00FFFF) ;0xFF0000)
    _Time(2 , 1 , 0xFF00FF , 0xFF00FF)
    _Time(3 , 1 , 0xFFFF00 , 0xFFFF00)
    GUISetState(@SW_SHOW)
EndFunc

Func _DirtyScan()
    Return @HOUR - 12 * 12 + @MIN * 12 + @SEC * 12
EndFunc
Edited by JellyFish666

Share this post


Link to post
Share on other sites



It doesn't seem to work for me.

Sometimes it appears, then flashes over and over with no changes.

And other times, nothing happens at all.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

It doesn't seem to work for me.

Sometimes it appears, then flashes over and over with no changes.

And other times, nothing happens at all.

I am running windows xp, it runs for me it flashes as it is updating it works well for me just need to fix the refresh rating so it doesn't flicker but deleting the GUI doesn't help much lol.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi, nice idea and thak you for sharing

I gather the reason the gui only sometimes appears is to do with the minutes, if mins = 0 then the gui won't show until mins > 0.

Same goes for seconds

Cheers

Edited by smashly

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0