Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

time progress bar


  • Please log in to reply
9 replies to this topic

#1 christiancdj

christiancdj

    Seeker

  • Active Members
  • 12 posts

Posted 12 March 2012 - 12:03 PM

have some problems with the time

progressbar is running faster the the time




#include <Excel.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>

Local $time, $minlaufer

$Form2 = GUICreate("Hotline Bereitschaft für am "& 1,577, 50, 251, 326)
$progressbar1 = GUICtrlCreateProgress(0, 33, 577, 17)
GUICtrlSetColor(-1, 32250); not working with Windows XP Style
$time = ((@HOUR + @MIN) + $minlaufer)
GUICtrlSetData($progressbar1, $time)

GUISetState(@SW_SHOW, $Form2)


While 1
$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE
Exit
$minlaufer = "9,6"
EndSwitch

WEnd







#2 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 19,886 posts

Posted 12 March 2012 - 12:10 PM

christiancdj,

With that code the Progressbar will not run at all as you never update it. What exactly are you trying to do?

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#3 christiancdj

christiancdj

    Seeker

  • Active Members
  • 12 posts

Posted 12 March 2012 - 01:20 PM

Im trying to make a work timer from 6 to 22 clock
then reading the working time from a exel an making the break time visible
each person has a differen break time so i want to make a progressbar
like
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
6 7 8 9 10 11 12 13 14 ...... 20 21 22
xxx ........ xxx
break ............ break ......


have you an idea?

Edited by christiancdj, 12 March 2012 - 01:23 PM.


#4 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 19,886 posts

Posted 12 March 2012 - 01:39 PM

christiancdj,

Perhaps something like this might get you started: :bye:
AutoIt         
#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $cProgress = GUICtrlCreateProgress(10, 10, 340, 20) ; Set the progress limit to move in 6 minute intervals GUICtrlSetLimit(-1, 16 * 6) For $i = 6 To 22     GUICtrlCreateLabel("|", 10 + (($i - 6) * 20), 30, 20, 20)     GUICtrlCreateLabel($i, 10 + (($i - 6) * 20), 50, 20, 20) Next GUISetState() $iCurr_Min = -1 While 1     Switch GUIGetMsg()         Case $GUI_EVENT_CLOSE             Exit     EndSwitch     ; Has the minute value changed?     If @MIN <> $iCurr_Min Then         ; Calculate the total minutes since 6AM in 6 minute sections         $iTime = Int ((((@HOUR - 6) * 60) + @MIN) / 10)         ; Set the Progressbar         GUICtrlSetData($cProgress, $iTime)         $iCurr_Min = @MIN     EndIf WEnd

Please ask if anything is unclear. :oops:

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#5 christiancdj

christiancdj

    Seeker

  • Active Members
  • 12 posts

Posted 12 March 2012 - 02:38 PM

AutoIt         
#include <Excel.au3> #include <Array.au3> #include <SliderConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> Global $iStart = 6 * 60 ;6 Uhr Global $iGesamt = 16 * 60 ;gesamte Bereitschaftszeit Local $aArray1 $benutzer = "test" $tagID = "MO" #Region ### START Koda GUI section ### Form=c:dokumente und einstellungenadministratordesktophotline compakt.kxf $Form2 = GUICreate("Hotline Bereitschaft für "& $benutzer &" am "& $tagID,577, 50, 251, 326) ;~ $Form2 = GUICreate("Hotline Bereitschaft für " & 1, 587, 50, 251, 326) $idLblPer = GUICtrlCreateLabel("",550,10,30,17) $progressbar1 = GUICtrlCreateProgress(5, 28, 560, 17, $WS_EX_OVERLAPPEDWINDOW,$WS_EX_TOPMOST) GUICtrlSetColor(-1, 32250); not working with Windows XP Style ;~ AdlibRegister("_ShowProgress", 60000) ;show 60 sec ;~ $FS = GUICtrlCreateInput("FS", 392, 8, 20, 16) $Checkbox1 = GUICtrlCreateInput("", 7, 8, 20, 17,"",$TBS_TOP) $schicht = _ArrayToString($aArray1, "", 2,2) ;anzeige() $Checkbox2 = GUICtrlCreateInput("", 25, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 3,3) ;anzeige() $Checkbox3 = GUICtrlCreateInput("", 43, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 4,4) ;anzeige() $Checkbox4 = GUICtrlCreateInput("", 61, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 5,5) ;anzeige() $Checkbox5 = GUICtrlCreateInput("", 79, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 6,6) ;anzeige() $Checkbox6 = GUICtrlCreateInput("", 97, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 7,7) ;anzeige() $Checkbox7 = GUICtrlCreateInput("", 115, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 8,8) ;anzeige() $Checkbox8 = GUICtrlCreateInput("", 133, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 9,9) ;anzeige() $Checkbox9 = GUICtrlCreateInput("", 151, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 10,10) ;anzeige() $Checkbox10 = GUICtrlCreateInput("", 169, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 11,11) ;anzeige() $Checkbox11 = GUICtrlCreateInput("", 187, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 12,12) ;anzeige() $Checkbox12 = GUICtrlCreateInput("", 205, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 20,13) ;anzeige() $Checkbox13 = GUICtrlCreateInput("", 223, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 14,14) ;anzeige() $Checkbox14 = GUICtrlCreateInput("", 241, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 15,15) ;anzeige() $Checkbox15 = GUICtrlCreateInput("", 260, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 16,16) ;anzeige() $Checkbox16 = GUICtrlCreateInput("", 278, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 17,17) ;anzeige() $Checkbox17 = GUICtrlCreateInput("", 295, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 18,18) ;anzeige() $Checkbox18 = GUICtrlCreateInput("", 313, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 19,19) ;anzeige() $Checkbox19 = GUICtrlCreateInput("", 331, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 20,20) ;anzeige() $Checkbox20 = GUICtrlCreateInput("", 349, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 21,21) ;anzeige() $Checkbox21 = GUICtrlCreateInput("", 367, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 22,22) ;anzeige() $Checkbox22 = GUICtrlCreateInput("", 385, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 23,23) ;anzeige() $Checkbox23 = GUICtrlCreateInput("", 403, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 24,24) ;anzeige() $Checkbox24 = GUICtrlCreateInput("", 421, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 25,25) ;anzeige() $Checkbox25 = GUICtrlCreateInput("", 439, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 26,26) ;anzeige() $Checkbox26 = GUICtrlCreateInput("", 457, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 27,27) ;anzeige() $Checkbox27 = GUICtrlCreateInput("", 475, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 28,28) ;anzeige() $Checkbox28 = GUICtrlCreateInput("", 493, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 29,29) ;anzeige() $Checkbox29 = GUICtrlCreateInput("", 511, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 30,30) ;anzeige() $Checkbox30 = GUICtrlCreateInput("", 529, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 31,31) ;anzeige() $Checkbox31 = GUICtrlCreateInput("", 547, 8, 20, 17, $BS_3STATE) $schicht = _ArrayToString($aArray1, "", 32,32) ;anzeige() uhrzeit() _ShowProgress() uhrzeit() GUISetState(@SW_SHOW) ;~ _ArrayDisplay($aArray1, "Horizontal",-1,1) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg   Case $GUI_EVENT_CLOSE    Exit ;~   _ExcelBookClose($oExcel) EndSwitch ;~ $working = "0,104" WEnd Func uhrzeit() ;~ GUICtrlCreateLabel("6.3", 5, 30,20) GUICtrlCreateLabel("7", 22, 30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("8", 57, 30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("9", 93, 30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("10", 127,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("11", 164,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("12", 199,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GuICtrlCreateLabel("13", 235,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("14", 271,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("15", 307,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("16", 343,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("17", 379,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("18", 415,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("19", 451,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("20", 487,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("21", 523,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("22", 559,30,20,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) EndFunc Func _ShowProgress()     Local $iBereits = @HOUR * 60 + @MIN - $iStart     $iPercent = (($iBereits / $iGesamt * 100 ))     ConsoleWrite(@HOUR & ":" & @MIN & @TAB & $iPercent & @CRLF) ;zur Kontrolle     GUICtrlSetData($progressbar1, $iPercent) ;~   GUICtrlSetData($idLblPer,GUICtrlRead($progressbar1) & " %")    ;zur Demo, dass die Progressbar nur ganze Werte annimmt EndFunc   ;==>_ShowProgress


thats my code sorry thats not nice

Edited by christiancdj, 12 March 2012 - 02:39 PM.


#6 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 19,886 posts

Posted 12 March 2012 - 02:46 PM

christiancdj,

So what is the problem you are having with the script? :oops:

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#7 christiancdj

christiancdj

    Seeker

  • Active Members
  • 12 posts

Posted 16 March 2012 - 07:32 AM

The progressbar is running faster the it shoud - if its 12 its nearbly by 12.30 :oops: what do i wrong?

#8 Belini

Belini

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 339 posts

Posted 16 March 2012 - 12:10 PM

I think we need to calculate the total time / 100 and use this time in AdlibRegister

#9 Scriptmaster

Scriptmaster

    Wayfarer

  • Active Members
  • Pip
  • 56 posts

Posted 23 March 2012 - 07:56 PM

have some problems with the time

progressbar is running faster the the time




#include <Excel.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>

Local $time, $minlaufer

$Form2 = GUICreate("Hotline Bereitschaft für am "& 1,577, 50, 251, 326)
$progressbar1 = GUICtrlCreateProgress(0, 33, 577, 17)
GUICtrlSetColor(-1, 32250); not working with Windows XP Style
$time = ((@HOUR + @MIN) + $minlaufer)
GUICtrlSetData($progressbar1, $time)

GUISetState(@SW_SHOW, $Form2)


While 1
$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE
Exit
$minlaufer = "9,6"
EndSwitch

WEnd

you should put in [ code ] and [ /code ] tags
shutdown(1)

#10 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 9,549 posts

Posted 23 March 2012 - 08:14 PM

you should put in [ code ] and [ /code ] tags

You shouldn't quote the whole post just to tell him to add code tags either.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users