Circle progress bar

Post your working scripts, libraries and tools
Bruttosozialprodukt
Posts: 451
Joined: 24 Jan 2014, 22:28

Circle progress bar

31 Mar 2015, 23:43

I posted these functions in another thread and thought, why not share them with everyone:

Code: [Select all] [Expand] [Download] (progressCircle.ahk)GeSHi © Codebox Plus



Example 1: (Slowly fill a small progress circle)

Code: [Select all] [Expand] [Download] (example1.ahk)GeSHi © Codebox Plus



Example 2: (huge progress circle for downloads)

Code: [Select all] [Expand] [Download] (ecample2.ahk)GeSHi © Codebox Plus



Screenshot:
Image
User avatar
Learning one
Posts: 119
Joined: 04 Oct 2013, 13:59
Location: Croatia
Contact:

Re: Circle progress bar

01 Apr 2015, 01:35

Nice work! :) I quickly rewrote it and used Class syntax, auto GDI+ on/off, auto clear-up, click through style and hopefully simplified usage.
Edit: Added more options; ability to display text, draw background, added option to disable click through style, some minor drawing modifications...
Image

Example 1 - simple:

Code: [Select all] [Download] (Script.ahk)GeSHi © Codebox Plus

CircleProgress := new CircleProgressClass()
Loop, 100 {
CircleProgress.Update(A_Index, "Downloading`nAutoHotkey.exe`n`n" A_Index "% done")
Sleep, 50
}
return

Example 2 - intermediate:

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus


Class:

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus

Last edited by Learning one on 08 Apr 2015, 15:31, edited 3 times in total.
User avatar
joedf
Posts: 6007
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Circle progress bar

01 Apr 2015, 08:22

Very nice! :D
User avatar
fischgeek
Posts: 415
Joined: 29 Jan 2014, 21:39

Re: Circle progress bar

01 Apr 2015, 08:55

Oh my God I love this.
Ferry
Posts: 6
Joined: 10 Jul 2014, 15:55

Re: Circle progress bar

01 Apr 2015, 09:39

Nice! but it is not working on Unicode 64 bit for now.
User avatar
fischgeek
Posts: 415
Joined: 29 Jan 2014, 21:39

Re: Circle progress bar

01 Apr 2015, 10:12

I finally get to make my circle clock with ease! Thank you!

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus

User avatar
joedf
Posts: 6007
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Circle progress bar

01 Apr 2015, 13:28

Somebody make a gist!
like "Circle.ahk" or something ;)
FanaticGuru
Posts: 801
Joined: 30 Sep 2013, 22:25

Re: Circle progress bar

01 Apr 2015, 16:37

Ferry wrote:Nice! but it is not working on Unicode 64 bit for now.

You just need the 64 bit version of gdip.

https://www.dropbox.com/s/0e9gdfetbfa8v0o/Gdip_All.ahk

You have to rename that to Gdip.ahk and put in your lib folder.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
FanaticGuru
Posts: 801
Joined: 30 Sep 2013, 22:25

Re: Circle progress bar

01 Apr 2015, 17:34

Learning one wrote:Class:

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus


This line causes an error of Call to nonexistent function:
hbm := CreateDIBSection(this.W, this.W), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm)
It does not seem like this line should occur before a pToken := Gdip_Startup().

Works fine if I forgo the auto detect and insert a pToken := Gdip_Startup().

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
Ferry
Posts: 6
Joined: 10 Jul 2014, 15:55

Re: Circle progress bar

02 Apr 2015, 01:38

FanaticGuru wrote:
Ferry wrote:Nice! but it is not working on Unicode 64 bit for now.

You just need the 64 bit version of gdip.

https://www.dropbox.com/s/0e9gdfetbfa8v0o/Gdip_All.ahk

You have to rename that to Gdip.ahk and put in your lib folder.

FG


That did the trick. Thanks!
User avatar
Learning one
Posts: 119
Joined: 04 Oct 2013, 13:59
Location: Croatia
Contact:

Re: Circle progress bar

02 Apr 2015, 05:08

I'm glad you like it guys :)
Nice example fischgeek!
Ferry, yes, you need Gdip_All.ahk, as FanaticGuru said.
FanaticGuru, I don't get such errors...
Bruttosozialprodukt, it seems I hijacked your thread :( I'm sorry do you want me to stop posting?

In v1.03 (see updated second post of this thread) I added option to disable click through style, and did some minor drawing modifications...

What about this concept - multiple circle progres;
Image
User avatar
joedf
Posts: 6007
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Circle progress bar

02 Apr 2015, 06:55

@learningOne nonsense, Id say just add a comment header with versioning and proper credit to Bruttosozialprodukt and to you, with an open source license of your choice or public domain, etc ;)
Bruttosozialprodukt
Posts: 451
Joined: 24 Jan 2014, 22:28

Re: Circle progress bar

02 Apr 2015, 08:29

Learning one wrote:Bruttosozialprodukt, it seems I hijacked your thread :( I'm sorry do you want me to stop posting?

Yes, stop posting immediately and delete your account or I'm gonna sue you! xD

No, it's great to see that so many people like the idea so much. And I didn't plan to extend/improve the functions anyway. ;)
User avatar
fischgeek
Posts: 415
Joined: 29 Jan 2014, 21:39

Re: Circle progress bar

02 Apr 2015, 08:31

@Learning one - That's awesome. I like that you changed the click-through style - though, I did like that I can click through it. I made some mods to my clock and it stays in the bottom left, but still allows me to click through. Also, thanks for the class implementation. Nice work! ;)

I do have a couple questions though about the capability if anyone can answer them...

1) Is there a physical window for this that would make it move-able? Usually in Gui's I do +ToolWindow -Caption and add a gLabel to a control with PostMessage, 0xA1, 2,,, A so that I can drag it around with a left click and drag. It would be nice to be able to do that with this. I'm assuming without wrapping this in some kind of gui it's not possible.

2) I cannot for the life of me figure out the color code is it hex with a transparency attached to it? What's the format here?

My mind is going crazy with all the possibilities and ideas I have planned for this.
Bruttosozialprodukt
Posts: 451
Joined: 24 Jan 2014, 22:28

Re: Circle progress bar

02 Apr 2015, 08:59

Color format should be 0xAARRGGBB
AA=Alpha (Opacity), RR=Red, GG=Green, BB=Blue
0xFFFF0000 - Red with full opacity
0x440000FF - Blue with low opacity
User avatar
fischgeek
Posts: 415
Joined: 29 Jan 2014, 21:39

Re: Circle progress bar

02 Apr 2015, 09:17

Thank you.
User avatar
Learning one
Posts: 119
Joined: 04 Oct 2013, 13:59
Location: Croatia
Contact:

Re: Circle progress bar

02 Apr 2015, 10:28

@Bruttosozialprodukt: lol :) 8-) As joedf suggested, I would like to put the following text in CircleProgressClass comments: "Credits: Bruttosozialprodukt, Learning one. This code is public domain." Is that OK with you?
fischgeek wrote:... make it move-able ...
No problem :)

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus

toralf
Posts: 432
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: Circle progress bar

02 Apr 2015, 11:22

Wouldn't it be possible to include this in the class itself, since OnMessage() does now work for more then one CallBackFunc?
ciao
toralf
Bruttosozialprodukt
Posts: 451
Joined: 24 Jan 2014, 22:28

Re: Circle progress bar

02 Apr 2015, 12:20

Learning one wrote:As joedf suggested, I would like to put the following text in CircleProgressClass comments: "Credits: Bruttosozialprodukt, Learning one. This code is public domain." Is that OK with you?

Of course. ;)

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 18 guests