Jump to content



Photo

Custom Progress Bar


  • Please log in to reply
9 replies to this topic

#1 ConsultingJoe

ConsultingJoe

    ConsultingJoe.com

  • Active Members
  • PipPipPipPipPipPip
  • 1,667 posts

Posted 20 September 2006 - 01:02 AM

AutoIt         
#include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 622, 448, 192, 125) $progress = create_progress(128, 128, 193, 21, "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg") GUISetState(@SW_SHOW) For $i = 0 To 101 Step 10     set_progress( $progress, $i )     ConsoleWrite($i & @CRLF)     Sleep(100) Next For $i = 101 To 0 Step -10     set_progress( $progress, $i )     ConsoleWrite($i & @CRLF)     Sleep(100) Next While 1     $msg = GuiGetMsg()     Select     Case $msg = $GUI_EVENT_CLOSE         ExitLoop     Case Else         ;;;;;;;     EndSelect WEnd Exit Func create_progress($left, $top, $width, $height, $progressbar)     If Not FileExists( $progressbar ) Then         SetError( 1 )         Return -1     Else         $progressbg = GUICtrlCreateLabel( "", $left-2, $top-2, $width+4, $height+4, -1, $WS_EX_CLIENTEDGE )         $progresspic = GUICtrlCreatePic( $progressbar, $left, $top, 0, $height)         Dim $data[3] = [$width, $progressbg, $progresspic]         Return $data     EndIf EndFunc Func set_progress( $progress, $percent )     If Not IsArray( $progress ) Then         SetError( 1 )         Return -1     ElseIf $percent < 101 And $percent > -1 Then         $percent = $progress[0]*($percent*.01)         ConsoleWrite($progress[0])         GUICtrlSetPos ( $progress[2], -1, -1, $percent )     Else         Return -1         SetError( 2 )     EndIf EndFunc








#2 rbhkamal

rbhkamal

    I just can't leave this forum!!!!!

  • Active Members
  • PipPipPipPipPipPip
  • 503 posts

Posted 20 September 2006 - 01:07 AM

lol I didn't expect that.. very nice.

RK
"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

#3 ConsultingJoe

ConsultingJoe

    ConsultingJoe.com

  • Active Members
  • PipPipPipPipPipPip
  • 1,667 posts

Posted 20 September 2006 - 01:08 AM

lol I didn't expect that.. very nice.

RK

Its really simple I'm sure it could be made into a real ctrl or an option could be added to the progress control

#4 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 20 September 2006 - 03:09 PM

This is really good. Easy to use also.
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

#5 ConsultingJoe

ConsultingJoe

    ConsultingJoe.com

  • Active Members
  • PipPipPipPipPipPip
  • 1,667 posts

Posted 20 September 2006 - 03:37 PM

This is really good. Easy to use also.

Thanks, do you know if there is a way to send it functions like guictrlsetdata()??

#6 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 20 September 2006 - 03:55 PM

I'm not sure I understand the question, can you explain?
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

#7 ConsultingJoe

ConsultingJoe

    ConsultingJoe.com

  • Active Members
  • PipPipPipPipPipPip
  • 1,667 posts

Posted 20 September 2006 - 03:58 PM

I'm not sure I understand the question, can you explain?

so my functions that create the control make it act like a control so instead of my func to set the progress you can just do guictrlsetdata, or guictrldelete

#8 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 20 September 2006 - 04:35 PM

You can't do that.
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

#9 ConsultingJoe

ConsultingJoe

    ConsultingJoe.com

  • Active Members
  • PipPipPipPipPipPip
  • 1,667 posts

Posted 20 September 2006 - 05:32 PM

You can't do that.

ok, just seeing if there was a way, I was thinking of a dummy control to emulate the real control

#10 ConsultingJoe

ConsultingJoe

    ConsultingJoe.com

  • Active Members
  • PipPipPipPipPipPip
  • 1,667 posts

Posted 20 September 2006 - 11:55 PM

Nice Larry. I just did the indented label to show that it was a progress bar so the user know that and its not just an empy space until the progress begins

BTW: do you know when the menu gui function was add? I love it




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users