Jump to content

Berlin Clock


Gianni
 Share

Recommended Posts

....from the  serie "strange clocks":
see here for infos on how to read this clock

; Berlin-Uhr
HotKeySet("{Esc}", "End")
Global $aColors[3] = ["0x757575", "0xFFCC00", "0xFF0033"] ; [off][yellow][red]
Local $iSec = 0, $iMin = 0
Global $hGui = GUICreate(' Berlin-Uhr', 275, 240)
;                      ($nrPerLine, $ctrlWidth, $ctrlHeight, $xPanelPos, $yPanelPos, $xSpace)
Local $aGuiSecsX2 = _GuiPanel(01, 55, 35, 115, 010, 5) ; Seconds blink
Local $aGuiHourX5 = _GuiPanel(04, 55, 35, 025, 055, 5) ; Hours * 5
Local $aGuiHourX1 = _GuiPanel(04, 55, 35, 025, 100, 5) ; Hours
Local $aGuiMinsX5 = _GuiPanel(11, 16, 35, 025, 145, 6) ; Mins * 5
Local $aGuiMinsX1 = _GuiPanel(04, 55, 35, 025, 190, 5) ; Mins
GUISetBkColor("0x9A9A9A", $hGui)
GUISetState(@SW_SHOW)

Do
    If @SEC <> $iSec Then ; when the second changes do what following
        $iSec = @SEC
        GUICtrlSetBkColor($aGuiSecsX2[1], $aColors[@SEC / 2 = Int(@SEC / 2)]) ; second blink
        If @MIN <> $iMin Then
            $iMin = @MIN
            For $i = 1 To 11
                If $i < 5 Then
                    GUICtrlSetBkColor($aGuiHourX5[$i], $aColors[2 * (Int(@HOUR / 5) >= $i)])
                    GUICtrlSetBkColor($aGuiHourX1[$i], $aColors[2 * (Mod(@HOUR, 5) >= $i)])
                    GUICtrlSetBkColor($aGuiMinsX1[$i], $aColors[Mod(@MIN, 5) >= $i])
                EndIf
                GUICtrlSetBkColor($aGuiMinsX5[$i], $aColors[(Int(@MIN / 5) >= $i) * (1 + ($i = 3 Or $i = 6 Or $i = 9))])
            Next
        EndIf
    EndIf
Until GUIGetMsg() = -3 ; $GUI_EVENT_CLOSE
End()

Func _GuiPanel($nrPerLine, $ctrlWidth, $ctrlHeight, $xPanelPos, $yPanelPos, $xSpace = 1)
    ; create the controls
    Local $aGuiGridCtrls[$nrPerLine + 1]
    For $i = 1 To $nrPerLine
        $left = $xPanelPos + ((($ctrlWidth + $xSpace) * ($i - 1)) - $xSpace)
        $aGuiGridCtrls[$i] = GUICtrlCreateInput("", $left, $yPanelPos, $ctrlWidth, $ctrlHeight, 0x0800) ; 0x0800 = $ES_READONLY
        GUICtrlSetBkColor(-1, $aColors[0])
    Next
    Return $aGuiGridCtrls
EndFunc   ;==>_GuiPanel

Func End()
    If WinActive($hGui) Then
        GUIDelete($hGui)
        Exit
    EndIf
EndFunc   ;==>End

 

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

  • Moderators

Chimp,

Nice clock.

Sticking with the "mad clock" theme, we had fun with Qlock some years ago.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Nice clock Chimp, by the time I have calculated what time it is, we are already 2 minutes later :)

I like it, makes my brain work...

Small suggestion, I would replace GUICtrlCreateInput by GUICtrlCreateLabel to avoid the blinking cursor in the first box.

GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

.... by the time I have calculated what time it is, we are already 2 minutes later :) ...

​Ha..lol.... you are right  :D

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
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
 Share

×
×
  • Create New...