Jump to content

[SOLVED] ProgressBar Marquee Size


Recommended Posts

  • Moderators

Hmmm,

It seems some people are just too lazy to apply the lessons of one script to another. :naughty:

But because I am feeling generous this afternoon:

#include <GUIConstantsEx.au3>

Global $iLoop = 0

$Form1 = GUICreate("Form1", 400, 130)
$Button1 = GUICtrlCreateButton("Start", 10, 90, 80, 30)
$Button2 = GUICtrlCreateButton("Stop", 100, 90, 80, 30)

$sLabel = GUICtrlCreateLabel("", 10, 10, 1, 30)
GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlSetState(-1, $GUI_HIDE)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            _Start()
        Case $Button2
            _Stop()
    EndSwitch
WEnd

Func _Start()
    AdlibRegister("_Marquee", 20)
    GUICtrlSetState($sLabel, $GUI_SHOW)
EndFunc

Func _Stop()
    AdlibUnRegister("_Marquee")
    GUICtrlSetState($sLabel, $GUI_HIDE)
    GUICtrlSetPos($sLabel, 10, 10, 1, 30)
    $iLoop = 0
EndFunc

Func _Marquee()
    $iLoop = Mod($iLoop + 1, 481) + 1
    Switch $iLoop
        Case 1 To 99
            GUICtrlSetPos($sLabel, 10, 10, $iLoop, 30)
        Case 380 To 480
            GUICtrlSetPos($sLabel, $iLoop - 90, 10, 480 - $iLoop, 30)
        Case Else
            GUICtrlSetPos($sLabel, $iLoop - 90, 10, 100, 30)
    EndSwitch
EndFunc   ;==>_Start

And now I really am out of here. :)

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

OliverA,

Do not take advantage of the time of Melba, a bit of effort never hurts.

P.S. I have say to Melba to update that post for a future reference, for avoid people bump this thread for a stupid thing...i was clairvoyant and it happened 10 minutes after...

Have a nice day ;)

Edited by johnmcloud
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

×
×
  • Create New...