Jump to content

Add a visual counter to a loop!


Go to solution Solved by ioa747,

Recommended Posts

Posted

Good day,

I require a visual counter to the following:

Func ViewCustomCmdsList()
    WinActivate($hSAWSTUDIO_MAIN)
    ; -----------------------------------------------
    ; Select Custom Cmds button
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 250, 378, 1, 0)
    Sleep(1000)
    ; ---------------------
    ; Select each Cmd in turn
    Sleep($iTimeOut)
    Send("{DOWN +3}")
    For $i = 2 To 26
            Sleep($iDelayTime)
        Send("{DOWN}")
    Next
    ; ---------------------
    Sleep(1000)
    Send("{ESC}")
EndFunc   ;==>ViewCustomCmdsList

Any ideas?

  • Solution
Posted
Func ViewCustomCmdsList()
    WinActivate($hSAWSTUDIO_MAIN)
    ; -----------------------------------------------
    ; Select Custom Cmds button
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 250, 378, 1, 0)
    Sleep(1000)
    ; ---------------------
    ; Select each Cmd in turn
    Sleep($iTimeOut)
    Send("{DOWN +3}")
    For $i = 2 To 26
            ToolTip(" from 26", -1, -1, $i )
            Sleep($iDelayTime)
        Send("{DOWN}")
    Next
    ; ---------------------
    ToolTip("")
    Sleep(1000)
    Send("{ESC}")
EndFunc   ;==>ViewCustomCmdsList

 Merry Christmas and a happy new year

🎄

I know that I know nothing

Posted

ioa747,

With  bit of "tweaking"...

Func ViewCustomCmdsList()
    WinActivate($hSAWSTUDIO_MAIN)
    ; -----------------------------------------------
    ; Select Custom Cmds button
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 250, 378, 1, 0)
    Sleep(1000)
    ; ---------------------
    ; Select each Cmd in turn
    Sleep($iTimeOut)
    Send("{DOWN +3}")
    For $i = 2 To 27
        Sleep($iTimeOut)
        ToolTip($i & " of 27", 450, 440)
        Sleep($iDelayTime)
        Send("{DOWN}")
    Next
    ; ---------------------
    ToolTip("")
    Sleep(1000)
    Send("{ESC}")
EndFunc   ;==>ViewCustomCmdsList
; -----------------------------------------------

...and the very, very same to you, iao747!!

Posted

... or also with two counters ... one of which is a little more "visual"

#include <WindowsStylesConstants.au3>

Func ViewCustomCmdsList()
    Local $hwnd = GUICreate("", 200, 30, -1, -1, $WS_POPUP)
    Local $hwPrg = GUICtrlCreateProgress(0, 0, 200, 30)
    GUISetState(@SW_SHOWNOACTIVATE, $hwnd)
    WinActivate($hSAWSTUDIO_MAIN)
    ; -----------------------------------------------
    ; Select Custom Cmds button
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 250, 378, 1, 0)
    Sleep(1000)
    ; ---------------------
    ; Select each Cmd in turn
    Sleep($iTimeOut)
    Send("{DOWN +3}")
    For $i = 2 To 27
        Sleep($iTimeOut)
        ToolTip($i & " of 27", 450, 440)
        GUICtrlSetData($hwPrg, $i * (100 / 27))
        Sleep($iDelayTime)
        Send("{DOWN}")
    Next
    ; ---------------------
    ToolTip("")
    GUIDelete($hwnd)
    Sleep(1000)
    Send("{ESC}")
EndFunc   ;==>ViewCustomCmdsList
; -----------------------------------------------

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Posted

Or this simple :

Example()

Func Example()
  Local Const $iTimeOut = 250, $iDelayTime = 150, $iLen = 27
  SplashTextOn("Counter", "Starting", 150, 60, -1, -1, Default, "Arial", 14)
  Sleep($iTimeOut)
  For $i = 2 To $iLen
    Sleep($iTimeOut)
    ControlSetText("Counter", "", "Static1", $i & " out of " & $iLen)
    Sleep($iDelayTime)
  Next
  SplashOff()
EndFunc   ;==>Example

 

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
×
×
  • Create New...