Jump to content

Marquee UDF - New release 13 Jan 2019


Melba23
 Share

Recommended Posts

  • Moderators

Efo74,

I am but a hobbyist coder as well - but with perhaps just a little more experience than you . It was ~50 years ago I got my first experience of programming a computer to play Nim thanks to my very progressive 6th form maths master. We were using the mainframe of Imperial College - where a few years later I took my only formal programming classes (in Fortran) as part of my Aeronautical Engineering degree. Since then I have used various flavours of Sinclair home computers and then PCs, using Basic, assembly and AutoIt languages. It has given me a lot of pleasure over the years.

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

  • 4 months later...

Guys, my first day in looking into this great script. I need to modify the text displayed in the Marquee. I assume it is being called by $iIndex or $sText.

how do I modify what is currently running. I am new and under pressure to change the domain logon script to run marquee.au3 with the updated corona message. Help @Melba23 and all you other coders out here 😭

Link to comment
Share on other sites

  • Moderators

karldrogo,

Welcome to the AutoIt forum.

The text displayed by the marquee is set by the $sText  parameter of the _GUICtrlMarquee_Create function as explained in the function header:

;    $sText - The text (or HTML markup) the marquee should display

So you need to modify the string setting that parameter to get a new message.

If you need more help than post the code that you are using - see here how to do it

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

  • 4 months later...

Greetings @Melba 23 can you use your UDF with a transparent background, with only the letters overlaying an image?

Link to comment
Share on other sites

  • Moderators

Belini,

I do not believe you can have "transparent" as the background colour of a marquee, sorry.

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

18 hours ago, Belini said:

Greetings @Melba 23 can you use your UDF with a transparent background, with only the letters overlaying an image?

... a possible way to make transparent background,
but perhaps only useful if you want to create a large standalone marquee on your desktop (not to overlay it on an image within a gui ...

#include <WindowsConstants.au3>
#include "Marquee.au3"

#include <WinAPI.au3>

$hGUI = GUICreate("Big Ticker", @DesktopWidth, 50, 0, 0, $WS_POPUPWINDOW, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))

; ----- make $AlphaKey transparent -----------------------------------
Global $AlphaKey = 0xFFFFFF
_WinAPI_SetLayeredWindowAttributes($hGUI, $AlphaKey, 0, $LWA_COLORKEY)
GUISetBkColor($AlphaKey, $hGUI)
GUISetState(@SW_SHOW, $hGUI)
; --------------------------------------------------------------------
Global $sText = "The quick brown fox jumps over the lazy dog."

$iMarqueeIndex = _GUICtrlMarquee_Init()
_GUICtrlMarquee_SetScroll($iMarqueeIndex, 0, Default, "left", Default, 50)
_GUICtrlMarquee_SetDisplay($iMarqueeIndex, 0, 0xFFFF00, $AlphaKey, 26, "Comic Sans MS")
_GUICtrlMarquee_Create($iMarqueeIndex, $sText, 0, 0, @DesktopWidth, 50)

MsgBox(0,'', 'hit ok to end the script')

 

 

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

Thanks @Chimp but what I really needed was to overlay an image.

Jukebel.jpg

I wanted to maintain the effect it has on the image and too without transparency whenever i change the background image i will need to change the background color of the text message too.

Edited by Belini
Link to comment
Share on other sites

@Belini maybe something like this ?

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WinAPISysWin.au3>
#include <WindowsConstants.au3>
#include "Marquee.au3"

$sFileName = @ScriptDir & "\Jukebel.jpg" ; your pic in post just above
If Not FileExists($sFileName) Then Exit MsgBox(0, "Exit", "Image not found")

_GDIPlus_Startup()
$hImage = _GDIPlus_BitmapCreateFromFile($sFileName)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$iW = _GDIPlus_ImageGetWidth($hImage)
$iH = _GDIPlus_ImageGetHeight($hImage)

$hGUI = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, BitOr($WS_EX_LAYERED, $WS_EX_CONTROLPARENT))
_WinAPI_UpdateLayeredWindowEx($hGUI, -1, -1, $hBitmap)

$hGUI2 = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, BitOr($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI)
GUISetBkColor(0xABCDEF, $hGUI2) ; transparent
_WinAPI_SetLayeredWindowAttributes($hGUI2, 0xABCDEF)

$sText = "The quick brown fox jumps over the lazy dog."
$iMarqueeIndex = _GUICtrlMarquee_Init()
_GUICtrlMarquee_SetScroll($iMarqueeIndex, 0, Default, "left", Default, 50)
_GUICtrlMarquee_SetDisplay($iMarqueeIndex, 0, 0xFFFF00, 0xABCDEF, 26, "Comic Sans MS") ; 0xFFFF00 = yellow
_GUICtrlMarquee_Create($iMarqueeIndex, $sText, 5, 10, $iW, 50)

GUISetState(@SW_SHOW, $hGUI2)
GUISetState(@SW_SHOW, $hGUI)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

GUIDelete($hGUI2)
GUIDelete($hGUI)
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_BitmapDispose($hImage)
_GDIPlus_Shutdown()

Edit : Removed $WS_EX_TOPMOST extended style from $hGUI . Added $WS_EX_CONTROLPARENT extended style (making image draggable : AutoIt feature) . ESC to Exit

Edited by pixelsearch
Link to comment
Share on other sites

Link to comment
Share on other sites

  • 1 year later...
On 8/27/2012 at 4:26 PM, Melba23 said:

New version - 13 Jan 2019

 - Added: 2 new functions to hide/show and existing marquee.

New UDF and example script in zip format: Marquee.zip

As always, ready for compliments and/or complaints! :D

M23

How do I pause and restart the scrolling? I am trying to implement a tele promptor using this UDF.

Link to comment
Share on other sites

  • Moderators

BlackEvil,

You can start and stop the scrolling by using _GUICtrlMarquee_SetScroll to set a very low scroll speed followed by _GUICtrlMarquee_Reset to apply it - but this also resets the text to the start which I imagine is not what you want for a teleprompter.

However I have seen example marquees that just pause - I will see what I can find.

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

6 hours ago, Melba23 said:

....

However I have seen example marquees that just pause - I will see what I can find.

at this link (https://github.com/aamirafridi/jQuery.Marquee) there is a javascript (which in turn also relies on jquery) which allows different scrolling directions; up, down, right and left. It also allows the "pause" and "resume" methods.
A while ago I sketched out a little script that allows that javascript to be used by embedding a "browser control" into an AutoIt GUI, (more or less like this UDF does too)
If you want to try it you can download the BrowserControl.zip file that you find at this link (https://www.autoitscript.com/forum/topic/200338-browsercontrol-companion/) and the script to try is called Example_Marquee.au3 (you have to unzip the whole folder)
That example doesn't use the "pause" and "resume" methods, but you can easily try them out like this: 

$hMarquee.marquee('pause') ; To pause the marquee at any time.
$hMarquee.marquee('resume') ;  To resume the marquee after being paused previously.

 

 

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

Gianni,

Thanks - I will look into that.

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

  • 6 months later...
3 minutes ago, BlackEvil said:

Is there a way to pause & resume the marquee? I am working on a teleprompter application where I will need to pause the scrolling when user click on a button and then resume again on user action.

I just realized by seeing my own question previously that my hobby project is lying untouched for quite some time and I have to make this functionality my own...  😋😒

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...