Leaderboard
Popular Content
Showing content with the highest reputation on 03/10/2013 in all areas
-
This UDF has been rewritten - the new version can be found here. ---------------------------------------------------------------------------------------------- [New version] - 28 Aug 16 Added: The UDF is now RTL sensitive. Thanks to shai for the request. New UDF and examples below. Details of previous versions: The GUIExtender UDF allows you to have multiple sections within your GUIs which can be either static or extendable. The extendable sections can be extended and retracted either by UDF created buttons or programmatically by other controls or HotKeys. The controls on the sections are fully functional and there is no overlap problem when retracted (see the details section if you want to know how). The UDF can be used in both MessageLoop and OnEvent modes and with both native and UDF created controls, as well as embedded objects and child GUIs. Details of how the UDF works for those who are interested: The UDF and plenty of commented examples are in the attached zip: As always, happy to receive brickbats or bouquets. M231 point
-
Why create an oop c system, when there is an obvious alternative... If you run the code in debug mode, your debugger should tell you, that youre accessing uninitialized variables.1 point
-
Help With Block Input with Toggle Pause
IIIRAZORIII reacted to PhoenixXL for a topic
#include <BlockInputEx.au3> ;================== Exclude usage Example ================== Global $Paused = False, $iBlocked = False, $iExit_Timeout = 11000 ;11secs HotKeySet("{PAUSE}", "TogglePause") HotKeySet("^{PAUSE}", "Quit") ;All keyboard keys and mouse clicks are blocked except these keys: 0x13 = {PAUSE} _BlockInputEx(1, "0x13") AdlibRegister("Quit", $iExit_Timeout ) While 1 If $Paused Then While $Paused Sleep(10) If $iBlocked Then _BlockInputEx(0) $iBlocked = False ToolTip('Script is Paused', 1047, 0, " Warning", 0, 4) AdlibRegister("Tip", 4000) EndIf WEnd ElseIf Not $iBlocked Then _BlockInputEx(1, "0x13") $iBlocked = True EndIf WEnd Func TogglePause() $Paused = Not $Paused EndFunc ;==>TogglePause Func Tip() ToolTip('') AdlibUnRegister("Tip") EndFunc ;==>Tip Func Quit() _BlockInputEx(0) Exit EndFunc1 point -
"Loops"
Hallistorm1989 reacted to Melba23 for a topic
Hallistorm1989, Glad I could help. I see you got me to code a GUI in the end! M231 point -
"Loops"
Hallistorm1989 reacted to Melba23 for a topic
Hallistorm1989, Do as I suggested - get the content of the input and run some error-checking on it to make sure it is within bounds. Or you could force the input to accept only digits. Something like this should do the trick: #include <GUIConstantsEx.au3> #include <EditConstants.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateLabel("Only digits accepted!", 10, 10, 200, 20) $cInput_1 = GUICtrlCreateInput("", 10, 30, 200, 20, $ES_NUMBER) ; Force digits only $cInput_2 = GUICtrlCreateInput("", 10, 100, 200, 20) $cButton = GUICtrlCreateButton("Read", 10, 200, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton $sContent_1 = GUICtrlRead($cInput_1) $sContent_2 = GUICtrlRead($cInput_2) ; Convert content of Input 2 to an integer $vContent_2 = Int(Number($sContent_2)) ; Check this value to see if it is at least 1 or above If $vContent_2 < 1 Then $vContent_2 = "Error" EndIf MsgBox(0, "Result", "Input 1: " & $sContent_1 & @CRLF & "Input 2: " & $vContent_2) GUICtrlSetData($cInput_1, "") GUICtrlSetData($cInput_2, "") EndSwitch WEnd All clear? M231 point -
"Loops"
Hallistorm1989 reacted to Melba23 for a topic
Hallistorm1989, The "3" was just for testing as I did not feel like creating a GUI to hold the input. It will still work with your code - but you might think of ensuring that you have a number in the input before you start looping. M231 point -
"Loops"
Hallistorm1989 reacted to Melba23 for a topic
Hallistorm1989, Remove the "=" from the condition - then you get the correct number of MsgBoxes: $Amount = 3 $counter = 0 While $counter < $Amount $counter = $counter + 1 MsgBox(0, "Value of $counter is:", $counter) WEndBut it would be best to use a For...Next loop and let AutoIt count for you - like this: For $i = 1 To $Amount MsgBox(0, "Value of $counter is:", $i) NextAll clear? M231 point -
Hodahel, See my post above - there is no problem with this question. M231 point
-
Help With Block Input with Toggle Pause
IIIRAZORIII reacted to PhoenixXL for a topic
Maybe this would do how you are preferring BTW: I have removed the Quit after 10secs #include <BlockInputEx.au3> ;================== Exclude usage Example ================== Global $Paused = False, $iBlocked = False HotKeySet("{PAUSE}", "TogglePause") ;All keyboard keys and mouse clicks are blocked except these keys: 0x13 = {PAUSE} _BlockInputEx(1, "0x13") While 1 If $Paused Then While $Paused Sleep(10) If $iBlocked Then _BlockInputEx(0) $iBlocked = False ToolTip('Script is Paused', 1047, 0, " Warning", 0, 4) AdlibRegister("Tip", 4000) EndIf WEnd ElseIf Not $iBlocked Then _BlockInputEx(1, "0x13") $iBlocked = True EndIf WEnd Func TogglePause() $Paused = Not $Paused EndFunc ;==>TogglePause Func Tip() ToolTip('') AdlibUnRegister("Tip") EndFunc ;==>Tip Thumbs up if it helped1 point -
Help With Block Input with Toggle Pause
IIIRAZORIII reacted to PhoenixXL for a topic
Nowhere we are freeing the input Hence input would remain blocked Where do you want to unblock the user input1 point -
Help With Block Input with Toggle Pause
IIIRAZORIII reacted to PhoenixXL for a topic
Strange. I tested in my computer and it perfectly works The mouse and keyboard are blocked except the PAUSE key pressing the pause key shows a tooltip that the Script it paused, again pressing it removes the tooltip The script remains in state for 10secs... Which version of Autoit are you using and what is your environment ?1 point -
Help With Block Input with Toggle Pause
IIIRAZORIII reacted to PhoenixXL for a topic
I couldn't test because I'm currently on a laptop without {PAUSE} key but it should work #include <BlockInputEx.au3> ;================== Exclude usage Example ================== Global $Paused = False HotKeySet("{PAUSE}", "TogglePause") HotKeySet("^{PAUSE}", "_Quit") ;~ HotKeySet("{PAUSE}", "_Quit") ;<<<<<<<<<<<<<<<<<<<<<<<<<< you cannot register two functions simultaneously for the same key. ;All keyboard keys and mouse clicks are blocked except these keys: 0x13 = {PAUSE} _BlockInputEx(1, "0x13") ;This is only for testing, so if anything go wrong, the script will exit after 10 seconds. AdlibRegister("_Quit", 10000) While 1 If $Paused Then While $Paused Sleep(100) ToolTip('Script is Paused', 1047, 0, " Warning", 0, 4) WEnd Else ToolTip('') EndIf WEnd Func _Quit() Exit EndFunc ;==>_Quit Func TogglePause() $Paused = Not $Paused EndFunc ;==>TogglePause1 point -
Poor Man's Version Control
Mat reacted to Richard Robertson for a topic
It's worth noting that git is compatible with svn using the git-svn commands. It saves having to install two toolchains.1 point -
1 point