Jump to content

Marquee with smooth text scroll


DigDeep
 Share

Recommended Posts

@Melba23, I was looking at your Marquee UDF to use few of the functions inside mine.

Is there a way, we can make the text scroll to be smooth? I see that the text scrolling is moving with breaks.

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

Const $GetMsg = "This is a test sample."

$hGUI = GUICreate("", 500, 100, -1, -1, -1, $WS_EX_TOPMOST)
GUISetBkColor(0xC0C0C0)

; Marquee
$aMarquee = _GUICtrlMarquee_Init()
_GUICtrlMarquee_SetScroll($aMarquee, "", "Slide", "Left", 2, 1)
_GUICtrlMarquee_SetDisplay($aMarquee, 0, 0x000000, 0xC0C0C0, 8.5, "Courier New")
_GUICtrlMarquee_Create($aMarquee, $GetMsg, 80, 16, 300, 20)

GUISetState()

Do
Until GUIGetMsg() = -3

 

Link to comment
Share on other sites

  • Moderators

DigDeep,

The flow of text looks pretty "smooth" to me.

Or do you mean the fact that the message must disappear from one side of the marquee before reappearing from the other? If so, then please address yourself to Microsoft as that is their implementation of the marquee - all I do is make it easier to use.

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

The 2nd part of your statement is fine. By 'smooth' I meant, when the text is scrolling, it is going with breaks.

I have attached a small video for reference. Try to get the GUI and Marquee width expanded and put a long text. When text is scrolling, it is like moving 1 step then stopping for some milliseconds and then step 2, .....  

Marquee scroll sample.mp4

Link to comment
Share on other sites

  • Moderators

DigDeep,

Again, nothing of my doing - just MS's implementation 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

Thanks @Melba23. One more thing here...

Func _GUICtrlMarquee_SetScroll($iIndex, $iLoop = Default, $sMove = Default, $sDirection = Default, $iScroll = Default, $iDelay = Default)

$iScroll: Controls the speed of scrolling

$iDelay: Controls the delay.

I tried to change these but it does not affect anything.

Link to comment
Share on other sites

Worked fine for me I think it might have something to do with the empty string you are passing ("") as a parameter

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

Const $GetMsg = "This is a test sample."

$hGUI = GUICreate("", 500, 100, -1, -1, -1, $WS_EX_TOPMOST)
GUISetBkColor(0xC0C0C0)

; Marquee
$aMarquee = _GUICtrlMarquee_Init()
;;;;;_GUICtrlMarquee_SetScroll($aMarquee, "", "Slide", "Left", 2, 1)
;_GUICtrlMarquee_SetScroll($iIndex, $iLoop = Default, $sMove = Default, $sDirection = Default, $iScroll = Default, $iDelay = Default)
_GUICtrlMarquee_SetScroll($aMarquee, 0, Default, "Left", 20, 1)
_GUICtrlMarquee_SetDisplay($aMarquee, 0, 0x000000, 0xC0C0C0, 8.5, "Courier New")
_GUICtrlMarquee_Create($aMarquee, $GetMsg, 80, 16, 300, 20)

GUISetState()

Do
Until GUIGetMsg() = -3

 

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