Jump to content

Horizontal scrolling Texts


DigDeep
 Share

Recommended Posts

@James I was looking at your below code for Vertical Text scrolling and thsi was something I was looking since sometime but the other way round (Horizontal scrolling).

Can you please help?

 

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 0)
$AboutGUI = GUICreate("About iDFree", 436, 251, -1, -1, $WS_BORDER)
WinSetOnTop("About iDFree", "", 1)
GUISetBkColor(0xFFFFFF)
GUICtrlCreatePic(@TempDir & "\about.gif", 0, 0, 436, 251)
GUICtrlSetState(-1, $GUI_DISABLE)

$close = GUICtrlCreateButton(" Ok! ", 380, 75, 35, 22)
$win = WinGetPos("About iDFree")
$child = GUICreate("About scroller", 175, 115, $win[0]+260, $win[1]+125, $WS_POPUP, $WS_EX_TRANSPARENT, $AboutGUI)
GUISetBkColor(0xFFFFFF)
$AboutLabel = GUICtrlCreateLabel("Coded by Ben Perkins" & @CR & "Magic Soft Inc." & @CR & "Inspired by:" & @CR & "Alex Bagby and Ichaelmay58" & _
                    @CR & "BG image thanks to Reel Big Fish" & @CR & @CR & "-The Magician", 1, -80, 170, 105, BitOr($SS_NOTIFY, $SS_RIGHT))
GUISetState(@SW_SHOW, $AboutGUI)
GUISetState(@SW_SHOW, $child)

While 1
    For $i = -105 to 130
        $msg = GUIGetMsg()
        ControlMove("About scroller", "", $AboutLabel, 1, 30-$i)
        If $msg = $close Then
            Opt("GUIOnEventMode", 1)
            GUIDelete($AboutGUI)
            Return
        EndIf
        sleep(50)
    Next
WEnd

 

Link to comment
Share on other sites

I modified a stock ticker to functional many years ago... Holy crap 7 years, I'm getting old.  Anyway, gives you another method of scrolling text sideways.

https://www.autoitscript.com/forum/topic/120604-taskbar-stock-ticker/#comment-837952

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

  • Moderators

DigDeep,

Take a look at the Marquee UDF in my sig.

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

@Melba23 Marquee is looking great too. I can use something from here. Thanks for suggesting.

Just one thing here...

From your example.au3, I am using the below part. But the scrolling text is going with breaks. Can we get it scroll smoothly without breaking.. The reason is that I am planning to put a long text as  display and I am observing that due to the breaks while scrolling the texts are not clearly readable.

$aMarquee[6] = _GUICtrlMarquee_Init()
_GUICtrlMarquee_SetScroll($aMarquee[6])
_GUICtrlMarquee_SetDisplay($aMarquee[6])
_GUICtrlMarquee_Create($aMarquee[6], "Default Marquee Parameters", 10, 190, 300, 20, "Everything at default")
Link to comment
Share on other sites

  • Moderators

DigDeep,

I am afraid the Windows Marquee object only allows the new instance of the text to appear once the old instance has departed stage left, 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

Hi @Melba23, I see another issue here. If I try to add multiple messages to show up giving some spaces both (Tab Space and SpaceBar) are not getting recognized. It takes all different sentences as one sentence.

$aMarquee[4] = _GUICtrlMarquee_Init()
_GUICtrlMarquee_SetScroll($aMarquee[4])
_GUICtrlMarquee_SetDisplay($aMarquee[4], 1, "cyan", "black", 12, "arial")
_GUICtrlMarquee_Create($aMarquee[4], " This is a test 1.    This is a test 2.   This is a test 3.   This is a test 4.", 10, 190, 300, 20)

This reads like:

This is a test 1.This is a test 2.This is a test 3.This is a test 4.

instead it should be like:

This is a test 1.                This is a test 2.                This is a test 3.                This is a test 4.

Edited by DigDeep
Link to comment
Share on other sites

  • Moderators

DigDeep,

You can use HTML for the $sText parameter - so try using &nbsp to separate the different elements.

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

Yep, got it. Thanks.

The only issue is still with the way the text scrolls with breaks, no matter whatever is the font size. I have tried changing both the $iScroll and $iDelay too but still doesn't work. If we look at the messages displayed correctly, it looks as though every letter twice as if it's 3D text.

Link to comment
Share on other sites

Adding to this, what I am also seeing is the 'Marquee', is always overlapping the Lable window. Even if I try to keep the Marquee border to 0 and getting lable width a little further to be on top of the left side of Marquee window, Marquee still goes on top of Lable.

Is there a way to keep the lable on top of Marquee? I have already tried GUICtrlSetStyle($Lable1, "",$GUI_ONTOP) and $WS_EX_TOPMOST too.

 

$Lable1 = GUICtrlCreateLabel("Lable", 272, 672, 190, 40)
GUICtrlSetFont($Lable1, 12, 400, 0, "Arial")
GUICtrlSetColor($Lable1, 0x00FFFF)
GUICtrlSetBkColor($Lable1, 0x000000)

$aMarquee[4] = _GUICtrlMarquee_Init()
_GUICtrlMarquee_SetScroll($aMarquee[4], "", "slide", Default, 2, 1)
_GUICtrlMarquee_SetDisplay($aMarquee[4], 0, "cyan", "black", 12, "arial")
_GUICtrlMarquee_Create($aMarquee[4], "Running tests....", 383, 671, 942, 43)

 

Link to comment
Share on other sites

  • Moderators

DigDeep,

You could use a child GUI to hold the label. Here is modified version of your script to show the principles:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>

#include "Marquee.au3"

Global $aMarquee_Coords[4] = [0, 0, @DesktopWidth, 60]
Global $fMarquee_Pos = "top", $hGUI = 0

; Create an array to hold the marquee indices
Global $aMarquee[8]

; Create GUI to display various marquee styles
$hGUI = GUICreate("Marquee Example 1", 320, 320)

$Lable1 = GUICtrlCreateLabel("Lable", 72, 62, 190, 40)
GUICtrlSetFont($Lable1, 12, 400, 0, "Arial")
GUICtrlSetColor($Lable1, 0x00FFFF)
GUICtrlSetBkColor($Lable1, 0xFF0000)

$aMarquee[4] = _GUICtrlMarquee_Init()
_GUICtrlMarquee_SetScroll($aMarquee[4], "", "slide", Default, 2, 1)
_GUICtrlMarquee_SetDisplay($aMarquee[4], 0, "cyan", "black", 12, "arial")
_GUICtrlMarquee_Create($aMarquee[4], "Running tests....", 83, 71, 342, 43)

GUISetState()

GUICreate("Child", 190, 40, 72, 62, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)

$Lable1 = GUICtrlCreateLabel("Lable", 0, 0, 190, 40)
GUICtrlSetFont($Lable1, 12, 400, 0, "Arial")
GUICtrlSetColor($Lable1, 0x00FFFF)
GUICtrlSetBkColor($Lable1, 0xFF0000)

GUISetState()

; main loop
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func On_Exit()
    Exit
EndFunc

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

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