CandyProgress for v2

Post your working scripts, libraries and tools.
burque505
Posts: 1736
Joined: 22 Jan 2017, 19:37

CandyProgress for v2

27 Aug 2022, 18:43

@moefr01 posted a nice CandyProgress script in the German forum. It's here. .
I modified it a tad, extracted the icons from the ".icl" file (I was trying at first to port it to Keysharp, which doesn't yet support grabbing icons from .icl files, but I'm not there yet :evil: ). Along the way I ended up with this code, which runs under v2.0-beta.7 (and in fact under Keysharp, although it doesn't yet do what it's supposed to there).

Code: Select all

MyGui := Gui("-DPIScale +E0x02080000", "Candy Progress")
MyGui.OnEvent("Close", CloseMe)
MyGui.OnEvent("Escape", CloseMe)
MyGui.BackColor := "FFCC00"
CandyText := MyGui.Add("Text" ,"x20  y24 w436 h20 Center BackgroundTrans")
CandyText.SetFont("cFFFFFF s14")

Icon1 := MyGui.Add("Picture",  "x20 y20 w18  h36  BackgroundTrans", "Icon1.ico")
Icon2 := MyGui.Add("Picture","x38 y20 w400 h36  BackgroundTrans", "Icon2.ico" )
Icon3 := MyGui.Add("Picture", "x438 y20 w18 h36 BackgroundTrans", "Icon3.ico")
CandyProgress := MyGui.Add("Progress", "x20 y20 w436 h36")

MyGui.Show("w480")
value := 0
While True {
     if (value >= 33) and (value <= 66) {
        CandyProgress.Opt("+cPurple")
     }
     else if (value >= 66) {
        CandyProgress.Opt("+cAqua")
    }		
     else {
        CandyProgress.Opt("+cBlack")
    }
    CandyProgress.Value := value
    CandyText.Text := value . "%"
    value := value + 1
    if (value > 100)
	{
            Sleep(1000)
            value := 0
	}
    Sleep(100)
}

CloseMe(*) {
    ExitApp()
}
@moefr01 has got even fancier versions you can find at that link above.
Sorry, the animated GIF is not the greatest.
The icons are in the .zip file.
Attachments
candyprogress.gif
candyprogress.gif (120.47 KiB) Viewed 576 times
candyprogress.zip
(72.65 KiB) Downloaded 37 times

Return to “Scripts and Functions (v2)”

Who is online

Users browsing this forum: No registered users and 48 guests