Jump to content

Text Ticker


ioliver
 Share

Recommended Posts

Here is my code for a Text Ticker.

; Ticker.au3
; August 25, 2004

; Use to display scrolling text across the top of the screen.
; Ticker displays whatever text is in the file C:\marquee.txt.
; Ticker can be updated on-the-fly.  Just change the text in
; C:\marquee.txt and save the file.

; Thanks Larry!

Global $WS_POPUP = 0x80000000
Global $WS_DLGFRAME = 0x400000

$style = $WS_POPUP + $WS_DLGFRAME
$text = FileReadLine("C:\marquee.txt", 1)
$len = StringLen($text)
$show = $text

Opt("GuiNotifyMode", 1)
GuiCreate("Ticker", 1024, 40, 0, 0, $style)
  GUIDefaultFont (12, 600)
  $ref = GUISetControl("Label", $show, 10, 10)
GuiShow()

While 1
  For $i = 0 to $len - 1
    $show = StringRight($text,$len - $i) & StringLeft($text,$i)
    GUIWrite($ref, 0, $show)
    Sleep(500)
  Next
  $text = FileReadLine("C:\marquee.txt", 1)
  $len = StringLen($text)
Wend

Thanks,

Ian

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Link to comment
Share on other sites

Marquee logic from ioliver implemented as UDF

#cs
    Marquee.au3
    August 26, 2004
    
    Adapted from post on AutoIT S/S forum, ioliver
   
    Modified to Genericize the input
    
    UDF takes 3 functions - control to make scroll, text to scroll, and scroll delay 
    In order to be useful for more than getting stuck in an infinite loop, insert 
    logic for an event handler -- 
   
   
   
    
#ce

$text = "This is scroll text.   "
$delay = 80; on my system 80 msec gives a nice smooth but fast scroll.

$hGUI = GUICreate("Marquee", 400, 400)


GUIShow()
$hLbl = GUISetControl("label", $text, 40, 40)


_Marquee ($hlbl, $text, $delay)

Exit

Func _Marquee ($control, $text, $delay)
    Local $text, $delay, $control
    Local $len, $i, $show
   Local $event
    $len = StringLen($text)
    While 1
        
        For $i = 0 To $len - 1
            $show = StringRight($text, $len - $i) & StringLeft($text, $i)
            GUIWrite($control, 0, $show)
            Sleep($delay)
            
        Next
     ;event handler
      $event = GuiMsg(0)
      if $event <> 0 Then
        ;_EventHandler($event)
      EndIf
      
    Wend
EndFunc  ;==>Marquee

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

Guest Guidosoft

Great.  The scrolling text part was from Larry.  So, props to Larry.

BTW, What does UDF stand for?

Ian

<{POST_SNAPBACK}>

neat, do I have permission to include any of this in my notepad console script for version 5. I don't want it to just stay prompts you know and fast text prints.
Link to comment
Share on other sites

Guest Guidosoft

neat, do I have permission to include any of this in my notepad console script for version 5. I don't want it to just stay prompts you know and fast text prints.

<{POST_SNAPBACK}>

I mean change it so it can be a marquee in the notepad.
Link to comment
Share on other sites

Guest Guidosoft

How many people actualy use my notepad console script. Please list yourself below.

<{POST_SNAPBACK}>

me! It's realy cool, more people should use it. LOL!
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...