Jump to content

Recommended Posts

Posted

@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

 

Posted

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

  Reveal hidden contents

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted

@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")
  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted (edited)

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
  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted

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.

Posted

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)

 

  • Moderators
Posted

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:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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