Jump to content

time progress bar


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

christiancdj,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

christiancdj,

Perhaps something like this might get you started: :bye:

#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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

#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
Link to comment
Share on other sites

  • Moderators

christiancdj,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

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.

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 editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...