MRI123 Posted December 4, 2009 Share Posted December 4, 2009 What would be the easiest way to code a wrist watch LCD display GUI? For example a simple watch with 4 seven segments with a 24h(23:59) clock functions. I´ve done some simple things with paint and SplashImageOn combination. Any other ideas...? Thanks in advance! Link to comment Share on other sites More sharing options...
martin Posted December 4, 2009 Share Posted December 4, 2009 What would be the easiest way to code a wrist watch LCD display GUI?For example a simple watch with 4 seven segments with a 24h(23:59) clock functions. I´ve done some simple things with paint and SplashImageOn combination. Any other ideas...?Thanks in advance!I would expect the simplest way would be to find a free 7 segment font rather than create your own characters. Then all you need is a label and just set the text to the time. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
GEOSoft Posted December 4, 2009 Share Posted December 4, 2009 Following martins advice, there are two 7-segment fonts in this file http://www.twyman.org.uk/Fonts/7-Segment-Fonts.zip 3D and plain George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
MRI123 Posted December 6, 2009 Author Share Posted December 6, 2009 (edited) Thanks for the idea and font link! P.S. How to add blinking semicolon between hour, min and sec...? (Again - the easiest way...) P.P.S Copy font files => C:\WINDOWS\Fonts expandcollapse popup;***************************************************************************************************** ;***************************************************************************************************** HotKeySet("^!x", "MyExit") ;CRTL+ALT+x Func MyExit() MsgBox(0, "7 Segment clock", "Closing...", 1) Exit EndFunc ;***************************************************************************************************** ;***************************************************************************************************** ;***************************************************************************************************** Opt("TrayIconDebug", 1) ;***************************************************************************************************** #include <GUIConstants.au3> #include <string.au3> $Form1 = GUICreate("7 Segment clock", 170, 70, 100, 100) $HOUR = GUICtrlCreateLabel("12", 10, 10, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "7 Segment") $MIN = GUICtrlCreateLabel("12", 60, 10, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "7 Segment") $SEC = GUICtrlCreateLabel("12", 110, 10, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "7 Segment") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case Else GUICtrlSetData($HOUR,@HOUR) GUICtrlSetData($MIN,@MIN) GUICtrlSetData($SEC,@SEC) Sleep(1000) EndSwitch WEnd Edited December 6, 2009 by MRI123 Link to comment Share on other sites More sharing options...
martin Posted December 6, 2009 Share Posted December 6, 2009 (edited) Thanks for the idea and font link!P.S. How to add blinking semicolon between hour, min and sec...? (Again - the easiest way...)P.P.S Copy font files => C:\WINDOWS\Fontsexpandcollapse popup;***************************************************************************************************** ;***************************************************************************************************** HotKeySet("^!x", "MyExit") ;CRTL+ALT+x Func MyExit() MsgBox(0, "7 Segment clock", "Closing...", 1) Exit EndFunc ;***************************************************************************************************** ;***************************************************************************************************** ;***************************************************************************************************** Opt("TrayIconDebug", 1) ;***************************************************************************************************** #include <GUIConstants.au3> #include <string.au3> $Form1 = GUICreate("7 Segment clock", 170, 70, 100, 100) $HOUR = GUICtrlCreateLabel("12", 10, 10, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "7 Segment") $MIN = GUICtrlCreateLabel("12", 60, 10, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "7 Segment") $SEC = GUICtrlCreateLabel("12", 110, 10, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "7 Segment") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case Else GUICtrlSetData($HOUR,@HOUR) GUICtrlSetData($MIN,@MIN) GUICtrlSetData($SEC,@SEC) Sleep(1000) EndSwitch WEndSomething like this perhapsexpandcollapse popup;***************************************************************************************************** ;***************************************************************************************************** HotKeySet("^!x", "MyExit") ;CRTL+ALT+x Func MyExit() MsgBox(0, "7 Segment clock", "Closing...", 1) Exit EndFunc ;==>MyExit ;***************************************************************************************************** ;***************************************************************************************************** ;***************************************************************************************************** Opt("TrayIconDebug", 1) ;***************************************************************************************************** #include <GUIConstants.au3> #include <string.au3> $Form1 = GUICreate("7 Segment clock", 200, 70, 100, 100) $HOUR = GUICtrlCreateLabel("12", 10, 10, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "7 Segment") $c1 = GUICtrlCreateLabel(":", 60, 3, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "Arial") $MIN = GUICtrlCreateLabel("12", 70, 10, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "7 Segment") $C2 = GUICtrlCreateLabel(":", 120, 3, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "Arial") $SEC = GUICtrlCreateLabel("12", 130, 10, 50, 50) GUICtrlSetFont(-1, 36, 800, 0, "7 Segment") GUISetState(@SW_SHOW) AdlibEnable("updateClock", 1000) Global $colon = $GUI_HIDE While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func updateClock() Local $s, $m $colon = $GUI_HIDE + $GUI_SHOW - $colon $s = @SEC $m = @MIN GUICtrlSetData($SEC, $s) If $s = 0 Then GUICtrlSetData($MIN, @MIN) If $m = 0 Then GUICtrlSetData($HOUR, @HOUR) GUICtrlSetState($C1, $colon) GUICtrlSetState($C2, $colon) EndFunc ;==>updateClock Edited December 6, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 6, 2009 Moderators Share Posted December 6, 2009 MRI123, If you want a graphical solution to the segmented font, there is a nice example here. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MRI123 Posted December 10, 2009 Author Share Posted December 10, 2009 MRI123, If you want a graphical solution to the segmented font, there is a nice example here. M23 Thanks for semicolon updates and the analog watch link! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now