AutoHotkey Community

It is currently May 26th, 2012, 9:51 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: September 24th, 2009, 6:25 pm 
Offline

Joined: August 12th, 2009, 6:07 pm
Posts: 26
I have given up trying to actually time my script with the progress bar, to many files and dozens of loops. Is there a simple way to code the progress bar to just loop from 0-100% continuously until the entire script is finished?

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2009, 6:48 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Were you trying to do something like this: loop-read timer, pls help?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2009, 7:31 pm 
Offline

Joined: August 12th, 2009, 6:07 pm
Posts: 26
Thanks for the reply. It appears that it is still trying to base the progress bar in accordance with progress of the script and or its "time." I want a completely unintelligent progress bar that does nothing more than "blink" so the user knows the process isn't dead. Something like:

Loop
{
Gui, Progess, 50
GUI, Progress, 100
Gui, Progress, 0
}

Of course the problem is that the rest of my script wouldn't run because it would be stuck on this loop.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2009, 7:36 pm 
Offline

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
try using a settimer instead of a loop?

_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
"I think Bigfoot is blurry, that's the problem. It's not the photographer's fault, Bigfoot is blurry. So there's a large, out-of-focus monster roaming the countryside."


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 24th, 2009, 8:19 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Uminnsky wrote:
I have given up trying to actually time my script with the progress bar
Don't give up! :) Doesn't the thread I linked to help with this?

Uminnsky wrote:
Is there a simple way to code the progress bar to just loop from 0-100% continuously until the entire script is finished?
You would need a timer, as tidbit suggested. You may also want to use the PBS_MARQUEE style (0x8) on your progress bar.
AHK Help File wrote:
This style is typically used to indicate an ongoing operation whose completion time is unknown.
Code:
Gui, Add, Text,,Please Wait...
Gui, Add, Progress, r2 w200 0x8 -Smooth vPrgs
SetTimer, Progress, 100
;rest of script here

Gui, Show
return
GuiClose:
 ExitApp

Progress:
 GuiControl,,Prgs
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2009, 9:52 pm 
Offline

Joined: July 6th, 2009, 9:58 pm
Posts: 678
This may help, I use this for program messages.

Just use

Code:
Message := "Please Wait..."
GoSub MessageUp
<code to wait for>
GoSub MessageDown


Potentially you could 'animate' this so with GuiControl so that it goes
Please wait.
Please wait..
Please wait...
Please wait.
Etc


Code:
MessageUp:
Gui 3: Margin, 0,0
Gui 3: +LastFound
GUI_ID:=WinExist()
Gui 3: font, s16, Arial
Gui 3: -Caption +AlwaysOnTop +Border
Gui 3: Add, text,,%message%
Gui 3: font, s5, Arial
Gui 3: Show, AutoSize xCenter yCenter NoActivate, Working...
DllCall("AnimateWindow","UInt",GUI_ID,"Int",250,"UInt","0xa0000")
Return

MessageDown:
DllCall("AnimateWindow","UInt",GUI_ID,"Int",250,"UInt","0x90000")
Gui 3: Destroy
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2009, 11:38 pm 
Offline

Joined: August 12th, 2009, 6:07 pm
Posts: 26
Thanks for the help...concerning the timer, I have never played with this before, but it still seems to stick on the label like a loop would. In the code below how can I get beyond the label to my code and still have the label conintually executing?

EDIT: Nevermind, put the code BEFORE the time label, i got it...thanks for the help

EDIT 2: This is still no good though, makes the code run like a snail. Does it break between each line of code to run the label?

Code:
Gui, Add, Progress, x96 y280 w330 h50 vprogress, 25
Gui, Add, Button, x66 y60 w100 h30 , run
Gui, Show, w477 h377, New GUI Window
return

Buttonrun:

SetTimer, timelabel, 1000


timelabel:
GUIcontrol,,progress, 25
sleep 500
GUIcontrol,,progress, 50
sleep, 500
GUIcontrol,, progress, 75
sleep, 500
GUIcontrol,, progress, 100
return

sleep 5000 ; my code

msgbox, test



return

GuiClose:
ExitApp


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 25th, 2009, 12:12 am 
Offline

Joined: August 12th, 2009, 6:07 pm
Posts: 26
Quote:
jaco0646 wrote:
Uminnsky wrote:
I have given up trying to actually time my script with the progress bar
Don't give up! :) Doesn't the thread I linked to help with this?


I am sure it should :D , but I am not easily following how to connect that with my code.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2009, 6:56 am 
Offline

Joined: May 23rd, 2009, 4:48 am
Posts: 361
Location: north bay, california
probably should get rid of the sleeps in there, and call the timer when you want to update...

something like:

Code:
TempProgress = 0
SetTimer, ProgressUpdate, 1000
Return ;=== end auto-execute

ProgressUpdate: ;=== increases TempProgress by 10 each second
 GUIcontrol,,progress, % TempProgress += 10
 If TempProgress > 100
  TempProgess = 0
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2009, 7:04 am 
Offline

Joined: May 23rd, 2009, 4:48 am
Posts: 361
Location: north bay, california
Code:
Gui, Add, Progress, x96 y280 w330 h50 vprogress, 25
Gui, Add, Button, x66 y60 w100 h30 , run
Gui, Show, w477 h377, New GUI Window
Return

Buttonrun:
 TempProgress = 1
 GUIcontrol,,progress, 0
 SetTimer, ProgressUpdate, 200
Return

ProgressUpdate:
 If (TempProgress *= 1.2) > 100
  TempProgress = 1
 GUIcontrol,,progress, % TempProgress
Return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: bekihito, BrandonHotkey, dra, Exabot [Bot], JSLover, patgenn123, rbrtryn and 49 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group