Jump to content

derblub

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by derblub

  1. i never would have find this! great! thx very much!
  2. well.. you are my hero!! but youre right.. i have to clean up all those messed up loops a bit now - that should make it a little bit more easier for me many thanks for your help!- now i got it! but one thing that i still dont understand, is - why does the disabled state dont remain after the second loop on the print/upload buttons?
  3. yeah - the first "loop" just works fine - but if you wait, till the counter counts to zero, and wait for the second loops, you will see, that the buttons get not deactivated anymore, and instead of stoping it, it starts a new loop
  4. hi all! got another problem with my script (see below) the first loop works just fine - but if the second loop finishes, the "start/stop" button does not work anymore when i click it, it starts another loop, instead of stopping it - and the deactivated stats for uploading and printing process does not work too.. i hope the few german sentances are not disturbing thx for anyone who can help me, or atleast try to #include <GuiConstants.au3> #region start-gui $gui_start = GuiCreate("Quotenlisten-TOOL",166,73,-1,-1,$WS_POPUPWINDOW) WinSetOnTop("Quotenlisten-TOOL","",1) GuiCtrlCreateLabel("Quotenlisten-Tool starten?", 18, 11, 130, 20) $b_ja = GuiCtrlCreateButton("Ja", 14, 40, 60, 20) $b_nein = GuiCtrlCreateButton("Nein", 91, 40, 60, 20) GuiSetState() #endregion end start-gui #region haupt-gui $gui_haupt = GUICreate("Quotenlisten-TOOL", 297, 230, -1, -1,-1,$WS_EX_APPWINDOW,$gui_start) GUICtrlCreateLabel("Quotenlisten alle", 5, 14, 80, 20) $i_mins = GUICtrlCreateInput("10", 90, 11, 50, 20, $ES_NUMBER) GUICtrlCreateUpdown(-1) GUICtrlSetLimit(-1,9999,10) GUICtrlCreateLabel("Minuten drucken und uploaden", 143, 16, 161, 17) $b_start = GUICtrlCreateButton("START", 110, 40, 70, 20) $infotext = GUICtrlCreateLabel(" (im stop-modus)", 50, 70, 220, 20) $pr_print = GuiCtrlCreateProgress(75, 90, 190, 10, $PBS_SMOOTH) $pr_up = GuiCtrlCreateProgress(75, 103, 190, 10, $PBS_SMOOTH) GuiCtrlCreateLabel("print-status", 20, 88, 52, 15) GuiCtrlCreateLabel("upload-status", 9, 101, 64, 15) $printprozent = GuiCtrlCreateLabel("0%", 266, 88, 40, 15) $upprozent = GuiCtrlCreateLabel("0%", 266, 101, 40, 15) $ed_status = GUICtrlCreateEdit("", 10, 120, 277, 100,$ES_READONLY) #endregion haupt-gui ende #region stop?-gui $gui_stop = GuiCreate("ERROR #1337",120,80,-1, -1,$WS_DLGFRAME,-1,$gui_haupt) WinSetOnTop("ERROR #1337","",1) GuiCtrlCreateLabel("Bitte zuerst stoppen!", 15, 9, 130, 20) $b_ok1 = GuiCtrlCreateButton("ok", 30, 33, 60, 20) #endregion end stop?-gui #region mindestwert-gui $gui_mindest = GuiCreate("ERROR #123",120,80,-1, -1,$WS_DLGFRAME,-1,$gui_haupt) WinSetOnTop("ERROR #123","",1) GuiCtrlCreateLabel("Mindestwert: 10", 15, 9, 130, 20) $b_ok2 = GuiCtrlCreateButton("ok", 30, 33, 60, 20) #endregion end mindestwert-gui While 1 $msg = GuiGetMsg(1) Switch $msg[0] Case $b_nein Exit Case $b_ja GuiSetState() GUISetState(@SW_HIDE,$gui_start) GUISetState(@SW_HIDE,$gui_stop) GUISetState(@SW_HIDE,$gui_mindest) GUISetState(@SW_SHOW,$gui_haupt) Case $b_start If GUICtrlRead($b_start) = "START" Then startmodus() Else stopmodus() EndIf Case $b_ok1 GUISetState(@SW_HIDE,$gui_stop) GUISetState(@SW_RESTORE,$gui_haupt) GUISetState(@SW_ENABLE,$gui_haupt) Case $b_ok2 GUISetState(@SW_HIDE,$gui_mindest) GUISetState(@SW_RESTORE,$gui_haupt) GUISetState(@SW_ENABLE,$gui_haupt) Case $GUi_EVENT_CLOSE If GUICtrlRead($b_start) = "stop" Then GUISetState(@SW_SHOW,$gui_stop) GUISetState(@SW_RESTORE,$gui_stop) GUISetState(@SW_DISABLE,$gui_haupt) Else undtschuess() EndIf EndSwitch WEnd Exit Func stopmodus() GUICtrlSetState($i_mins, $GUI_ENABLE) GUICtrlSetData($b_start, "START") GUICtrlSetData($infotext, " (im stop-modus)") GUICtrlSetData($printprozent, "0%") GUICtrlSetData($pr_print, "0") GUICtrlSetData($upprozent, "0%") GUICtrlSetData($pr_up, "0") EndFunc Func startmodus() $mintimer = GUICtrlRead($i_mins) If $mintimer <= 9 Then GUICtrlSetData($i_mins, 10) $mintimer = 10 GUISetState(@SW_DISABLE,$gui_haupt) GUISetState(@SW_RESTORE,$gui_mindest) GUISetState(@SW_SHOW,$gui_mindest) Else GUICtrlSetData($b_start, "stop") GUICtrlSetData($printprozent, "0%") GUICtrlSetData($pr_print, "0") GUICtrlSetData($upprozent, "0%") GUICtrlSetData($pr_up, "0") GUISetState(@SW_DISABLE, $gui_haupt) GUICtrlSetState($i_mins, $GUI_DISABLE) printupdate() EndIf EndFunc Func printupdate() $printprogresstimer = GUICtrlRead($pr_print) GUICtrlSetData($infotext, " printing") GUISetState(@SW_DISABLE, $b_start) While $printprogresstimer < 100 Sleep(1) $printprogresstimer += 1 GUICtrlSetData($b_start, "printing") GUICtrlSetData($pr_print, $printprogresstimer) GUICtrlSetData($printprozent, $printprogresstimer & "%") WEnd If $printprogresstimer = 100 Then uploadupdate() EndFunc Func uploadupdate() $upprogresstimer = GUICtrlRead($pr_up) GUICtrlSetData($infotext, " uploading") While $upprogresstimer < 100 Sleep(1) $upprogresstimer += 1 GUICtrlSetData($b_start, "uploading") GUICtrlSetData($pr_up, $upprogresstimer) GUICtrlSetData($upprozent, $upprogresstimer & "%") WEnd if $upprogresstimer = 100 Then GUICtrlSetData($b_start, "stop") GUICtrlSetState($b_start, $GUI_ENABLE) GUISetState(@SW_ENABLE, $gui_haupt) GUISetState(@SW_ENABLE, $b_start) timer($i_mins) EndIf EndFunc Func timer($label) $label = GUICtrlRead($i_mins) Local $time = TimerInit() While 1 $nMsg = GUIGetMsg(1) Switch $nMsg[0] Case $GUi_EVENT_CLOSE GUISetState(@SW_SHOW,$gui_stop) GUISetState(@SW_RESTORE,$gui_stop) GUISetState(@SW_DISABLE,$gui_haupt) Case $b_ok1 GUISetState(@SW_HIDE,$gui_stop) GUISetState(@SW_RESTORE,$gui_haupt) GUISetState(@SW_ENABLE,$gui_haupt) EndSwitch $new = ($label * 1000) - TimerDiff($time) $seconds = Round($new / 1000) $newMin = Floor($seconds / 60) $newSec = Mod($seconds, 60) If $newSec < 10 Then $newSec = "0" & $newSec If $newMin < 10 Then $newMin = "0" & $newMin If ($newMin > 0 Or Number($newSec) > 0) Then Sleep(30) GUICtrlSetData($infotext, "nächster druck/upload in " & $newMin & " Min " & $newSec & " Sek") If GUIGetMsg() = $b_start Then stopmodus() ExitLoop EndIf ElseIf $newSec = 0 Then GUICtrlSetData($printprozent, "0%") GUICtrlSetData($pr_print, "0") GUICtrlSetData($upprozent, "0%") GUICtrlSetData($pr_up, "0") printupdate() Sleep(30) EndIf WEnd EndFunc Func undtschuess() WinSetOnTop("Quotenlisten-TOOL","",2) MsgBox(64, "thx for using blub-products", "©2007 - xxx", 2) WinSetOnTop("thx for using blub-products","",1) Exit EndFunc ps.: its not an error, that the input is not in minutes
  5. thx very much! very clever - i got it!
  6. hi all and thx in advance! i have finished my tool, and now im recreating the gui.. but i got a "small" error.. everytime i click into the input box on the main window or on the up/down buttons, the window flashes - and im unable to close the window... what can it be?! #include <GuiConstants.au3> GuiCreate("Quotenlisten-TOOL",166,73,-1,-1,$WS_POPUPWINDOW) WinSetOnTop("Quotenlisten-TOOL","",1) $gui_start = GuiCtrlCreateLabel("Quotenlisten-Tool starten?", 18, 11, 130, 20) $b_ja = GuiCtrlCreateButton("Ja", 14, 40, 60, 20) $b_nein = GuiCtrlCreateButton("Nein", 91, 40, 60, 20) GuiSetState() While 1 $msg = GuiGetMsg() Switch $msg Case $b_ja GUIDelete() $gui_haupt = GUICreate("Quotenlisten-TOOL", 297, 230, -1, -1) GUICtrlCreateLabel("Quotenlisten alle", 5, 14, 80, 20) $i_mins = GUICtrlCreateInput("10", 90, 11, 50, 20, $ES_NUMBER) GUICtrlCreateUpdown(-1) GUICtrlSetLimit(-1,9999,10) GUICtrlCreateLabel("Minuten drucken und uploaden", 143, 16, 161, 17) $b_start = GUICtrlCreateButton("START", 110, 40, 70, 20) $ch_aot = GuiCtrlCreateCheckbox("always on top", 200, 42, 90, 20) GUICtrlSetState(-1,$GUI_CHECKED) $infotext = GUICtrlCreateLabel(" (im stop-modus)", 60, 70, 190, 20) $pr_print = GuiCtrlCreateProgress(70, 90, 190, 10, $PBS_SMOOTH) $pr_up = GuiCtrlCreateProgress(70, 103, 190, 10, $PBS_SMOOTH) GuiCtrlCreateLabel("print-status", 15, 88, 52, 15) GuiCtrlCreateLabel("upload-status", 3, 101, 64, 15) $printprozent = GuiCtrlCreateLabel("0%", 261, 88, 40, 15) $upprozent = GuiCtrlCreateLabel("0%", 261, 101, 40, 15) $ed_status = GUICtrlCreateEdit("", 10, 120, 277, 100) GUICtrlSetState(-1, $GUI_DISABLE) GuiSetState() $msg2 = GuiGetMsg() Switch $msg2 Case -3 Exit EndSwitch Case $b_nein Exit EndSwitch WEnd Exit thx for all help!
  7. its a bit difficult to learn the syntax - but i think im gonna love autoit for dev - a great "little" tool it is! (and looks like a nice community too )
  8. great!!! thx gui constants and gui itself where allready there, i only forgot to copy them into the code but with the ctrlread it works flawless now!! many thx for this fast answer!!
  9. hi - im new to autoit and i got allready a question how to change the button-text in a loop? i got a start button - if i click it, it changes the caption to stop - but if i click again, it stays on stop.. can someone help me please? my code sofar Dim $buttontext = "start" $startbutton = GuiCtrlCreateButton ($buttontext,110,50,70,20) GuiSetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $startbutton Then If $buttontext = "start" Then GUICtrlSetData($startbutton, "stop") Else If $buttontext = "stop" Then GUICtrlSetData($startbutton, "start") EndIf EndIf EndIf WEnd thx in advance
×
×
  • Create New...