Just4Fun - Eine etwas andere Uhr

    • Offizieller Beitrag

    ne ne huggy, wenns läuft, braucht er ja nicht umschalten :D

    Hier mal mit Farbänderung im Sekundentakt:

    Edit: Dann werde ich den Tipp von GTASpider gleich mal mit einfügen - thx

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    Opt("GUIOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 1)
    Dim $hour = @HOUR, $min = @MIN, $sec = @SEC
    $SteelBlue = 0x4682B4
    $White = 0xFFFFFF

    [/autoit] [autoit][/autoit] [autoit]

    Dim $arCol[60]
    $arCol[0] = 0xFFEBCD
    $arCol[1] = 0xFFDEAD
    $arCol[2] = 0xD2B48C
    $arCol[3] = 0xDEB887
    $arCol[4] = 0xCD853F
    $arCol[5] = 0xA0522D
    $arCol[6] = 0x8B4513
    $arCol[7] = 0xFFA07A
    $arCol[8] = 0xE9967A
    $arCol[9] = 0xF08080
    $arCol[10] = 0xBC8F8F
    $arCol[11] = 0xCD5C5C
    $arCol[12] = 0xA52A2A
    $arCol[13] = 0xDC143C
    $arCol[14] = 0xFF69B4
    $arCol[15] = 0xFF1493
    $arCol[16] = 0xC71585
    $arCol[17] = 0xFF00FF
    $arCol[18] = 0x8B008B
    $arCol[19] = 0x800080
    $arCol[20] = 0x9400D3
    $arCol[21] = 0x9932CC
    $arCol[22] = 0x8A2BE2
    $arCol[23] = 0x0000FF
    $arCol[24] = 0x0000CD
    $arCol[25] = 0x000080
    $arCol[26] = 0x4169E1
    $arCol[27] = 0x1E90FF
    $arCol[28] = 0x00BFFF
    $arCol[29] = 0x00CED1
    $arCol[30] = 0x00FFFF
    $arCol[31] = 0x008B8B
    $arCol[32] = 0x008080
    $arCol[33] = 0x48D1CC
    $arCol[34] = 0x20B2AA
    $arCol[35] = 0x40E0D0
    $arCol[36] = 0x00FF7F
    $arCol[37] = 0x32CD32
    $arCol[38] = 0x00FF00
    $arCol[39] = 0x008000
    $arCol[40] = 0x7FFF00
    $arCol[41] = 0xADFF2F
    $arCol[42] = 0x9ACD32
    $arCol[43] = 0xFFFF00
    $arCol[44] = 0x808000
    $arCol[45] = 0xFFD700
    $arCol[46] = 0xDAA520
    $arCol[47] = 0xB8860B
    $arCol[48] = 0xFFA500
    $arCol[49] = 0xFF8C00
    $arCol[50] = 0xF4A460
    $arCol[51] = 0xD2691E
    $arCol[52] = 0xFF4500
    $arCol[53] = 0xFF7F50
    $arCol[54] = 0xFF6347
    $arCol[55] = 0xFA8072
    $arCol[56] = 0xFF0000
    $arCol[57] = 0xB22222
    $arCol[58] = 0x8B0000
    $arCol[59] = 0x800000

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $Time = GUICreate("Time", 100, 285, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION))
    GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
    GUISetBkColor($SteelBlue)
    $prHour = GUICtrlCreateProgress(15, 10, 20, 250, BitOR($PBS_SMOOTH,$PBS_VERTICAL))
    $prMin = GUICtrlCreateProgress(40, 10, 20, 250, BitOR($PBS_SMOOTH,$PBS_VERTICAL))
    $prSec = GUICtrlCreateProgress(65, 10, 20, 250, BitOR($PBS_SMOOTH,$PBS_VERTICAL))
    $lHour = GUICtrlCreateLabel("lHour", 15, 265, 20, 17, $SS_CENTER)
    GUICtrlSetColor(-1, $White)
    GUICtrlSetFont(-1, 10, 600)
    GUICtrlCreateLabel(":", 36, 265, 4, 17, $SS_CENTER)
    GUICtrlSetColor(-1, $White)
    GUICtrlSetFont(-1, 10, 600)
    $lMin = GUICtrlCreateLabel("lMin", 40, 265, 20, 17, $SS_CENTER)
    GUICtrlSetColor(-1, $White)
    GUICtrlSetFont(-1, 10, 600)
    GUICtrlCreateLabel(":", 61, 265, 4, 17, $SS_CENTER)
    GUICtrlSetColor(-1, $White)
    GUICtrlSetFont(-1, 10, 600)
    $lSec = GUICtrlCreateLabel("lSec", 65, 265, 20, 17, $SS_CENTER)
    GUICtrlSetColor(-1, $White)
    GUICtrlSetFont(-1, 10, 600)
    GUISetState(@SW_SHOW)
    GUICtrlSetData($prHour, @HOUR*100/24)
    GUICtrlSetData($lHour, @HOUR)
    GUICtrlSetData($prMin, @MIN*100/60)
    GUICtrlSetData($lMin, @MIN)
    GUICtrlSetData($prSec, @SEC*100/60)
    GUICtrlSetData($lSec, @SEC)
    _HourColor()
    _MinColor()
    _SecColor()
    While 1
    Sleep(100)
    If @SEC <> $sec Then
    $sec = @SEC
    GUICtrlSetData($prSec, @SEC*100/60)
    GUICtrlSetData($lSec, @SEC)
    _SecColor()
    EndIf
    If @MIN <> $min Then
    $min = @MIN
    GUICtrlSetData($prMin, @MIN*100/60)
    GUICtrlSetData($lMin, @MIN)
    _MinColor()
    EndIf
    If @HOUR <> $hour Then
    $hour = @HOUR
    GUICtrlSetData($prHour, @HOUR*100/24)
    GUICtrlSetData($lHour, @HOUR)
    _HourColor()
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func Close()
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _SecColor()
    GUICtrlSetColor($prSec, $arCol[@SEC])
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _MinColor()
    GUICtrlSetColor($prMin, $arCol[@MIN])
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _HourColor()
    Select
    Case @HOUR = 0
    GUICtrlSetColor($prHour, $arCol[0])
    Case (@HOUR > 0) And (@HOUR < 13)
    GUICtrlSetColor($prHour, $arCol[@HOUR*5-1])
    Case Else
    GUICtrlSetColor($prHour, $arCol[(@HOUR-12)*5-1])
    EndSelect
    EndFunc

    [/autoit]
    • Offizieller Beitrag

    Na, noch ein 'obskurer' Zeitmesser gefällig ? :D :D

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

    Dim $grafik, $width = 190, $height = 190, $desc = 1
    Dim $diameter, $pos, $sec = @SEC, $color
    Dim $DarkOrange = 0xFF8C00, $Orange = 0xFFA500, $HotPink = 0xFF69B4, $LightCoral = 0xF08080

    [/autoit] [autoit][/autoit] [autoit]

    $gui=GUICreate("Time "&@HOUR&':'&@MIN&':'&@SEC, 200,200,-1,-1,BitOR($WS_SYSMENU,$WS_CAPTION))
    $grafik=GuiCtrlCreateGraphic(5, 5, $width, $height)
    GUISetState()

    Do
    $msg = GUIGetMsg()
    If @SEC <> $sec Then
    Switch $desc
    Case 1
    $sec = @SEC
    If $sec = 59 Then $desc = 0
    $diameter = @SEC*3
    $pos = ($width-$diameter)/2
    If (Mod(@SEC,2) = 0) Or (@SEC = 0) Then
    $color = $DarkOrange
    Else
    $color = $Orange
    EndIf
    Case 0
    $sec = @SEC
    If $sec = 59 Then $desc = 1
    $diameter = (60 - @SEC)*3
    $pos = ($width-$diameter)/2
    If (Mod(@SEC,2) = 0) Or (@SEC = 0) Then
    $color = $HotPink
    Else
    $color = $LightCoral
    EndIf
    EndSwitch
    SetGraphik()
    EndIf
    Sleep(100)
    Until $msg=$GUI_EVENT_CLOSE

    [/autoit] [autoit][/autoit] [autoit]

    Func SetGraphik()
    Local $title = WinGetTitle("Time")
    WinSetTitle($title, '', "Time "&@HOUR&':'&@MIN&':'&@SEC)
    GuiSetState(@SW_LOCK, $gui)
    GUICtrlDelete($grafik)
    $grafik=GuiCtrlCreateGraphic(5, 5, $width, $height)
    GUICtrlSetGraphic(-1,$GUI_GR_COLOR, $color,$color)
    GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, $pos, $pos, $diameter, $diameter)
    GUICtrlSetGraphic($grafik,$GUI_GR_REFRESH)
    GuiSetState(@SW_UNLOCK, $gui)
    EndFunc

    [/autoit]
  • Naja der neue ist nicht ganz so cool ;)


    Ich hatte mal in der PCGH ein Bild von einer extrem krass komplizierten Uhr aus Asien gesehen, wenn ich die Zeitschrift noch finde scann ich das mal und stell es hier rein.


    Waluev :rock:

    Flensburg ist wie Payback - wenn man 18 Punkte hat bekommt man ein Fahrrad.

  • Zitat

    Original von BugFix
    Edit: Ist gefixt, jetzt wird immer das vorhergehende Fenster gelöscht :)

    nicht ganz jetzt wird jede zweite sekunde ein neues fenster erstellt^^

    snoozer

    • Offizieller Beitrag

    Und noch eine Kreation :D

    Diesmal aber eine "stinknormale" Analoguhr. Mich reizte halt die Umsetzung mit Autoit Graphik-Funktion.
    Es flackert ab und an etwas. Das kann man umgehen, wenn man es mit WinApi löst. Aber dazu hab ich grad keine Lust :D

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

    Dim $grafik, $width = 190, $height = 190, $desc = 1, $gui, $chg = False
    Dim $s_angle = 90+@SEC*-6, $m_angle = 90+1+@MIN*-6, $h_angle = 90+1+@HOUR*-30
    Dim $sec = @SEC, $min = @MIN, $hour = @HOUR
    Dim $DarkOrange = 0xFF8C00, $Orange = 0xFFA500, $HotPink = 0xFF69B4, $LightCoral = 0xF08080, $RoyalBlue = 0x4169E1
    Dim $Navy = 0x000080, $Crimson = 0xDC143C, $Green = 0x008000, $LightSteelBlue = 0xB0C4DE

    [/autoit] [autoit][/autoit] [autoit]

    $m_angle -= Floor($sec/10)
    $h_angle -= Floor($min/2)
    $gui=GUICreate("Time "&@HOUR&':'&@MIN&':'&@SEC, 200,200,-1,-1,BitOR($WS_SYSMENU,$WS_CAPTION))
    GUISetBkColor($RoyalBlue)
    $grafik=GuiCtrlCreateGraphic(5, 5, $width, $height)
    SetGraphik() ; 12 Uhr = 90° // Uhrzeigersinn (-n°)
    GuiSetState()

    [/autoit] [autoit][/autoit] [autoit]

    Do
    Sleep(100)
    $msg = GUIGetMsg()
    If @HOUR <> $hour Then
    $hour = @HOUR
    $h_angle = 90-1+@HOUR*-30
    $chg = True
    EndIf
    If @MIN <> $min Then
    $min = @MIN
    $m_angle = 90-1+@MIN*-6
    If Mod($min,2) = 0 Then $h_angle -= 1
    $chg = True
    EndIf
    If @SEC <> $sec Then
    $sec = @SEC
    $s_angle = 90+@SEC*-6
    If Mod($sec,10) = 0 Then $m_angle -= 1
    $chg = True
    EndIf
    If $chg Then
    SetGraphik()
    EndIf
    Until $msg=$GUI_EVENT_CLOSE

    [/autoit] [autoit][/autoit] [autoit]

    Func SetGraphik()
    Local $title = WinGetTitle("Time")
    WinSetTitle($title, '', "Time "&@HOUR&':'&@MIN&':'&@SEC)
    GuiSetState(@SW_LOCK, $gui)
    GUICtrlDelete($grafik)
    $grafik=GuiCtrlCreateGraphic(5, 5, $width, $height)
    GUICtrlSetGraphic($grafik,$GUI_GR_COLOR,$LightSteelBlue,$LightSteelBlue)
    GUICtrlSetGraphic($grafik,$GUI_GR_ELLIPSE, 0, 0, 190, 190)
    GUICtrlSetGraphic($grafik,$GUI_GR_COLOR,$Crimson,$Crimson)
    GUICtrlSetGraphic($grafik,$GUI_GR_PIE, 95, 95, 90, $s_angle, 1)
    GUICtrlSetGraphic($grafik,$GUI_GR_COLOR,$Navy,$Navy)
    GUICtrlSetGraphic($grafik,$GUI_GR_PIE, 95, 95, 80, $m_angle, 2)
    GUICtrlSetGraphic($grafik,$GUI_GR_COLOR,$Green,$Green)
    GUICtrlSetGraphic($grafik,$GUI_GR_PIE, 95, 95, 70, $h_angle, 2)
    GUICtrlSetGraphic($grafik,$GUI_GR_REFRESH)
    GuiSetState(@SW_UNLOCK, $gui)
    $chg = False
    EndFunc

    [/autoit]
  • Sehr gut gemacht!!!!

    Nur wieder sind die Farben etwas, naja bunt :D

    Mach doch ein Uhrentool, was man in den Desktop einbinden kann und verschiedene Uhren wählen kann, dann evt noch nen Newsticker per RSS Feed und Wetter per Inet abrfragen und du hast ne mit Autoit erzeugt Sidebar :rofl:


    GEBT BUGFIX DEN STATUS "UHRENMACHER"!!!!!!!!!!! :rofl2:


    Waluev

    Flensburg ist wie Payback - wenn man 18 Punkte hat bekommt man ein Fahrrad.