Custom Query
Results (151 - 153 of 3883)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#705 | Fixed | _GUICtrlToolbar_ClickButton() function does not always click on buttons | Gary | Bowmore |
Description |
Enviroment: WinXP Home SP3 AutoIt 3.2.12.1 AutoIt Beta 3.2.13.11 The coords of the centre of button are calculated in screen coords, but the click is preformed using whatever MouseCoordMode the user has set. The MouseCoordMode option needs setting to 1 and then resetting back to the original value before exiting the function. Code to demonstrate existing behaviour of existing function and that of the suggested fix below. ToolbaButtonClickTest.exe is a compiled version of the Create a Toolbar control help file example to give some buttons to click. ToolbaButtonClickTest.exe is the compliled version of the attached file Opt("MustDeclareVars", 1) Opt("WinWaitDelay", 100) Opt("WinTitleMatchMode", 4) Opt("WinDetectHiddenText", 1) Opt("MouseCoordMode", 2) Opt("PixelCoordMode", 2) #include <GuiToolBar.au3> Local $hWnd = 0 Local $iCommandID = 0 Run(@ScriptDir & "\ToolbaButtonClickTest.exe") WinActivate("Toolbar") $hWnd = ControlGetHandle("Toolbar", "", "ToolbarWindow321") ;Display behaviour of standard function first and the the modified version For $ifunc = 0 To 1 ;Display behaviour when mouse is not moved and then when mouse is moved For $iMove = 0 To 1 ;Use each of the MouseCoordMode in turn For $iCoordMode = 0 To 2 Opt("MouseCoordMode", $iCoordMode) For $i = 0 To 4 $iCommandID = _GUICtrlToolbar_IndexToCommand($hWnd, $i) If $ifunc = 0 Then ToolTip("Standard UDF Function '_GUICtrlTab_ClickTab()' MouseCoordMod = " & $iCoordMode & @CRLF & "Attempting To click on button " & $i & " mouse moving is " & ($iMove <> 0), 20, 20) _GUICtrlToolbar_ClickButton($hWnd, $iCommandID, "left", ($iMove <> 0), 1, 50) Else ToolTip("Modified UDF Function '_GUICtrlTab_ClickTab()' MouseCoordMode = " & $iCoordMode & @CRLF & "Attempting To click on button " & $i & " mouse moving is " & ($iMove <> 0), 20, 20) MOD_GUICtrlToolbar_ClickButton($hWnd, $iCommandID, "left", ($iMove <> 0), 1, 50) EndIf Sleep(3000) ;time to see what happens Next Next Next Next Exit Func MOD_GUICtrlToolbar_ClickButton($hWnd, $iCommandID, $sButton = "left", $fMove = False, $iClicks = 1, $iSpeed = 1) If $Debug_TB Then _GUICtrlToolbar_ValidateClassName($hWnd) Local $tPoint, $tRect, $iX, $iY, $iMode, $aPos $tRect = _GUICtrlToolbar_GetButtonRectEx($hWnd, $iCommandID) $tPoint = _WinAPI_PointFromRect($tRect) $tPoint = _WinAPI_ClientToScreen($hWnd, $tPoint) _WinAPI_GetXYFromPoint($tPoint, $iX, $iY) ;Switch to screen MouseCoordMode $iMode = Opt("MouseCoordMode", 1) If Not $fMove Then $aPos = MouseGetPos() _WinAPI_ShowCursor(False) ;_WinAPI_ShowCursor does not seem to work on XP so set mouse speed it instant MouseClick($sButton, $iX, $iY, $iClicks, 0) MouseMove($aPos[0], $aPos[1], 0) _WinAPI_ShowCursor(True) Else MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed) EndIf ;Switch back to user MouseCoordMode Opt("MouseCoordMode", $iMode) EndFunc ;==>MOD_GUICtrlToolbar_ClickButton |
|||
#848 | Completed | Tidy.exe - enhancement to '/rel : Remove empty lines from the source.' parameter | Bowmore | |
Description |
It would be nice if the Tidy.exe parameter /rel : Remove empty lines from the source. could have an optional flag 0|1 /rel 0 (default) would work as it currently does and remove all empty lines. /rel 1 would reduce consecuative lines containing only whitespace to a single empty line. I believe that this will help to make the code more readable by removing excessive whitespace but leaving it where the author intended. Example: Running Tidy on the following code with proposed /rel 1 parameter ;-------------------------------------------- $g_sTestRun = GUICtrlRead($GUI_edtTestRun) If $g_sTestRun = "" Then $iMsgBoxAnswer = MsgBox(53, "Warning", $sMessage) Switch $iMsgBoxAnswer Case 4 ;Retry Return Case 2 ;Cancel Exit EndSwitch EndIf $g_sTestCase = GUICtrlRead($GUI_edtTestCaseId) If $g_sTestCase = "" Then $iMsgBoxAnswer = MsgBox(53, "Warning", $sMessage) Switch $iMsgBoxAnswer Case 4 ;Retry Return Case 2 ;Cancel Exit EndSwitch EndIf ;-------------------------------------------- would produce the following output. ;-------------------------------------------- $g_sTestRun = GUICtrlRead($GUI_edtTestRun) If $g_sTestRun = "" Then $iMsgBoxAnswer = MsgBox(53, "Warning", $sMessage) Switch $iMsgBoxAnswer Case 4 ;Retry Return Case 2 ;Cancel Exit EndSwitch EndIf $g_sTestCase = GUICtrlRead($GUI_edtTestCaseId) If $g_sTestCase = "" Then $iMsgBoxAnswer = MsgBox(53, "Warning", $sMessage) Switch $iMsgBoxAnswer Case 4 ;Retry Return Case 2 ;Cancel Exit EndSwitch EndIf ;-------------------------------------------- |
|||
#1046 | No Bug | Hard crash when parsing larger strings using StringSplit() | Bowmore | |
Description |
Environment = 3.3.1.1 under WIN_XP/Service Pack 3 X86 Environment = 3.3.0.0 under WIN_XP/Service Pack 3 X86 When loading a large file to an array using string split Autoit crashes i.e. The error message 'Error allocating memory' is displayed and AutoIt exits I've checked that string length and array limits are not been exceeded Perhaps I am expecting too much but I would have hoped for a more controlled way of handling a memory error, so that if my data is too large for StringSplit() to split, I could branch to a disk storage based method of processing the data I have $sTemp = '' $aTemp = 0 ;Increase the size of the string until problem occurs For $j = 1 To 5 ; Create string to replicate a medium sized file having being read. For $i = 1 To 1000000 * $j Step 1 $sTemp &= String ($i) & " This is the average length of line that is in my data file" & @CRLF Next MsgBox(0, "String Split Test", "Length of string = " & StringLen($sTemp)) $aTemp = StringSplit($sTemp, @LF ) ; Memory error occurs at this point. MsgBox(0, "String Split Test", "Array Ubound = " & UBound($aTemp)) $sTemp = '' $aTemp = 0 Next |