Best way to create an horizontal scrolling text ?
#1
Posted 05 February 2012 - 10:56 PM
I'd like to create a simple way to diffuse some text messages at the bottom of a screen from right to left on the entire width in continue.
Goal is to diffuse message to my company's people on a 16/9 TV in a continue way. Messages would be taken from text files created in a specified directory....
How could i do this with AutoIT ?
thanks a lot for your help.
Florent
#2
Posted 06 February 2012 - 12:08 PM
Look at the Marquee UDF in my sig - should do what you want.
M23
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#3
Posted 06 February 2012 - 01:02 PM
Simple Horizontal Label Scroller.au3
Simple Horizontal Label Scroller.au3 1.3K
116 downloads;coded by UEZ 2012 build 2012-03-09 #include <windowsconstants.au3> #include "Scroller.au3" $iW = 640 $iH = Int($iW * 9 / 16) $hGUI = GUICreate("Simple Horizontal Scroller", $iW, $iH, -1, -1, Default, $WS_EX_COMPOSITED) GUISetState() $sText = "This is a simple horizontal scroller made with AutoIt using a label! Using this technique is not the best way because label is flickering :-(" $aHScroller1= Scroller_Init($hGUI, 64, $sText, "Arial", 96, 0, 0x006000, False, False, 0xABCDEF) If @error Then Exit MsgBox(16, "ERROR", "Unable to initiate scroller", 10) $aHScroller2= Scroller_Init($hGUI, $iH - 64, $sText, "Comic Sans MS", 24, 0, 0, True, True) If @error Then Exit MsgBox(16, "ERROR", "Unable to initiate scroller", 10) HotKeySet("{F1}", "Init_Scroller_Off") HotKeySet("{F2}", "Init_Scroller_On") HotKeySet("{F3}", "Init_Scroller_Reset") AdlibRegister("Scroll_It", 30) Do Until GUIGetMsg() = -3 _Exit() Func Scroll_It() Scroller_Move($aHScroller1, 1.25) Scroller_Move($aHScroller2, 1) EndFunc Func Init_Scroller_Off() Scroller_Off($aHScroller1[0]) EndFunc Func Init_Scroller_On() Scroller_On($aHScroller1[0]) EndFunc Func Init_Scroller_Reset() Scroller_Reset($aHScroller1) EndFunc Func _Exit() AdlibUnRegister("Scroll_It") GUIDelete($hGUI) Exit EndFunc
Scroller.au3
Scroller.au3 2.99K
124 downloads;coded by UEZ 2012 build 2012-03-11 #include-once #include <guiconstantsex.au3> #include <staticconstants.au3> #include <gdiplus.au3> Func Scroller_Init($hGUI, $iY, $sText, $sFont = "Arial", $iFSize = 24, $iFStyle = 0, $iFColor = 0x000000, $hl = False, $bgc = False, $bgcolor = 0xFEDCBA) If Not IsHWnd($hGUI) Then Return SetError(1, 0, 0) If $sText = "" Then Return SetError(2, 0, 0) Local $aSize = WinGetClientSize($hGUI) Local $aStringSize = GetStringSize($sText, $sFont, $iFSize, $iFStyle) Local $idLabel_Scroller = GUICtrlCreateLabel($sText, $aSize[0], $iY, $aStringSize[0], $aStringSize[1]) Local $fWeight = 400 If BitAND($iFStyle, 1) Then $fWeight = 800 GUICtrlSetFont($idLabel_Scroller, $iFSize, $fWeight , BitXOR($iFStyle, 1), $sFont, 4) GUICtrlSetColor($idLabel_Scroller, $iFColor) If $bgc Then Local $idLabel_BG = GUICtrlCreateLabel("", 0, $iY - 3, $aSize[0], $aStringSize[1] + 3) GUICtrlSetBkColor($idLabel_BG, $bgcolor) GUICtrlSetState($idLabel_BG, $GUI_DISABLE) GUICtrlSetBkColor($idLabel_Scroller, $bgcolor) EndIf If $hl Then Local $idLabel_HorizontalLine1 = GUICtrlCreateLabel("", 0, $iY - 4, $aSize[0] + 4, 2, $SS_ETCHEDHORZ) Local $idLabel_HorizontalLine2 = GUICtrlCreateLabel("", 0, $iY + $aStringSize[1], $aSize[0] + 4, 2, $SS_ETCHEDHORZ) EndIf Local $aData[4] = [$idLabel_Scroller, $aStringSize[0], $aSize[0] + $iFSize, $aSize[0] + $iFSize] ;id label, string width, gui width, $iPos Return $aData EndFunc Func Scroller_Off($idControl) GUICtrlSetState($idControl, $GUI_HIDE) EndFunc Func Scroller_On($idControl) GUICtrlSetState($idControl, $GUI_SHOW) EndFunc Func Scroller_Reset(ByRef $aData) $aData[3] = $aData[2] EndFunc Func Scroller_Move(ByRef $aData, $iSpeed = 1) $aData[3] -= $iSpeed GUICtrlSetPos($aData[0], $aData[3]) If $aData[3] < -$aData[1] Then $aData[3] = $aData[2] EndFunc Func GetStringSize($string, $font, $fontsize, $fontstyle) Local $GDIp = False Local $iWidth = StringLen($string) * $fontsize Local $iHeight = 2 * $fontsize If Not $ghGDIPDll Then _GDIPlus_Startup() $GDIp = True EndIf Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0) Local $hBitmap = $aResult[6] Local $hGrphContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) Local $hFormat = _GDIPlus_StringFormatCreate() Local $hFamily = _GDIPlus_FontFamilyCreate($font) Local $hFont = _GDIPlus_FontCreate($hFamily, $fontsize, $fontstyle) Local $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0) Local $aInfo = _GDIPlus_GraphicsMeasureString($hGrphContext, $string, $hFont, $tLayout, $hFormat) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGrphContext) If $GDIp Then _GDIPlus_Shutdown() Local $aDim[2] = [Int(DllStructGetData($aInfo[0], "Width")), Int(DllStructGetData($aInfo[0], "Height"))] Return $aDim EndFunc
Br,
UEZ
Edited by UEZ, 11 March 2012 - 09:29 PM.
The own fart smells best! ✌
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯
#4
Posted 09 March 2012 - 01:43 PM
Edited by Belini, 09 March 2012 - 01:44 PM.
Autoit Forum Brazil: http://autoitbrasil.com/ >> Autoit and arcades: http://www.arcadebr.com/forumMy Codes:
#5
Posted 09 March 2012 - 02:27 PM
@Belini: Did you modify something?
Br,
UEZ
The own fart smells best! ✌
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯
#6
Posted 09 March 2012 - 02:58 PM
Autoit Forum Brazil: http://autoitbrasil.com/ >> Autoit and arcades: http://www.arcadebr.com/forumMy Codes:
#7
Posted 09 March 2012 - 03:01 PM
Works for me on Windows 7 x64 using AutoIt V3.3.9.1.Anybody else with same problem?
@Belini: Did you modify something?
Br,
UEZ
Example List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _DesktopDimensions() • _DisplayPassword() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringIsValid() • _StringReplaceWholeWord() • _StringStripChar() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • AutoIt Search • AutoIt3 Portable • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • FileInstallr • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIGetBkColor() • LockFile() • PasteBin • SciTE Jump • Signature Creator • WM_COPYDATA • More Examples...Updated: 11/04/2013
#8
Posted 09 March 2012 - 03:11 PM
How to ask questions the smart way!
Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.
#9
Posted 09 March 2012 - 03:46 PM
Thanks for testing!
Br,
UEZ
The own fart smells best! ✌
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯
#10
Posted 09 March 2012 - 04:02 PM
Example List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _DesktopDimensions() • _DisplayPassword() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringIsValid() • _StringReplaceWholeWord() • _StringStripChar() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • AutoIt Search • AutoIt3 Portable • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • FileInstallr • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIGetBkColor() • LockFile() • PasteBin • SciTE Jump • Signature Creator • WM_COPYDATA • More Examples...Updated: 11/04/2013
#11
Posted 09 March 2012 - 07:23 PM
I tried it on Win 7 running both AutoIt 3.3.8.1 and 3.3.9.1, using both x64 and x86 and it worked for me.
Windows XP Spack2
@ UEZ do not think you understand, I want only to appear a screen part, I do not want the whole screen
The image is an example of what I want
Edited by Belini, 09 March 2012 - 07:28 PM.
Autoit Forum Brazil: http://autoitbrasil.com/ >> Autoit and arcades: http://www.arcadebr.com/forumMy Codes:
#12
Posted 09 March 2012 - 08:08 PM
Edited by D4RKON3, 09 March 2012 - 08:08 PM.
#13
Posted 09 March 2012 - 08:12 PM
That's not easily possible because here the whole label is moving from right to left and it cannot be implemented as shown in the screenshot.
One possibility might be creating 2 topmost child windows with appropriate size and height which overlap the left and right part of the scroller.
This could give the illusion that the scroller is only in a middle part of the gui.
Br,
UEZ
The own fart smells best! ✌
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯
#14
Posted 09 March 2012 - 09:31 PM
I thought the same as you and probably everyone else did on the forum, that Belini had a problem with your UDF not requesting a new feature to be added.
Example List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _DesktopDimensions() • _DisplayPassword() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringIsValid() • _StringReplaceWholeWord() • _StringStripChar() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • AutoIt Search • AutoIt3 Portable • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • FileInstallr • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIGetBkColor() • LockFile() • PasteBin • SciTE Jump • Signature Creator • WM_COPYDATA • More Examples...Updated: 11/04/2013
#15
Posted 10 March 2012 - 08:55 AM
Autoit Forum Brazil: http://autoitbrasil.com/ >> Autoit and arcades: http://www.arcadebr.com/forumMy Codes: 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users






