Custom Query


Show under each result:

Results (103 - 105 of 3841)

Ticket Resolution Summary Owner Reporter
#656 Fixed _FileCountLines and AutoIt v3.2.13.9 (Beta) - wrong return on one line Gary maraaa

When only one line is present in file, _FileCountLines will return 0 instead of 1

Most Venerable Penguin
Group Icon

Group: AutoIt MVPs (MVP)
Posts: 7,190
Joined: 12-December 05
From: Victoria Crater, Mars
Member No.: 9,334

Issue is not present with but is present with Example script:
#include <File.au3>
$sFile = _TempFile()
$hFile = FileOpen($sFile, 2)
FileWrite($hFile, "One line of text.")
ConsoleWrite("Count = " & _FileCountLines($sFile) & @LF)
#674 Fixed _GUICtrlTab_ClickTab() Clicks in the wrong place when $fMove = True Gary Bowmore

Enviroment: Win XP Pro SP2 Autoit Autoit Beta

If the $fMove option is set to True the mouse is moved to the wrong location when the window is not maximised. In the code below I've added the 2 highlighted lines to temporarily change the "MouseCoordMode" move the curusor and then reset "MouseCoordMode" to what it was. I've tested this on a few different scenarios and it works OK for me.

Func _GUICtrlTab_ClickTab($hWnd, $iIndex, $sButton = "left", $fMove = False, $iClicks = 1, $iSpeed = 1)
	Local $iX, $iY, $tPoint, $tRect, $iMode, $aPos
	If $Debug_TAB Then _GUICtrlTab_ValidateClassName($hWnd)
	If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
	$tRect = _GUICtrlTab_GetItemRectEx($hWnd, $iIndex)
	$tPoint = _WinAPI_PointFromRect($tRect, True)
	$tPoint = _WinAPI_ClientToScreen($hWnd, $tPoint)
	_WinAPI_GetXYFromPoint($tPoint, $iX, $iY)
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iX = ' & $iX & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iY = ' & $iY & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
	If Not $fMove Then
		$iMode = Opt("MouseCoordMode", 1)
		$aPos = MouseGetPos()
		Opt("MouseCoordMode", $iMode)
		MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed)
		MouseMove($aPos[0], $aPos[1], 0)
		$iMode = Opt("MouseCoordMode", 1) ;;ADDED THIS LINE
		MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed)
		Opt("MouseCoordMode", $iMode) ;;ADDED THIS LINE
EndFunc   ;==>_GUICtrlTab_ClickTab
#683 No Bug Setting new text with _GUICtrlTab_SetItemText Gary Josbe

Setting text with _GUICtrlTab_SetItemText() doesn't update the width of tabitem. The bug it seems produced from _GUICtrlTab_SetItem. Example taken from Helpfile:

#include <GuiConstantsEx.au3>
#include <GuiTab.au3>

Opt('MustDeclareVars', 1)

$Debug_TAB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work


Func _Main()
	Local $hTab

	; Create GUI
	GUICreate("Tab Control Set Item Text", 400, 300)
	$hTab = GUICtrlCreateTab(2, 2, 396, 296)

	; Add tabs
	_GUICtrlTab_InsertItem($hTab, 0, "Tab 1")
	_GUICtrlTab_InsertItem($hTab, 1, "Tab 2")
	_GUICtrlTab_InsertItem($hTab, 2, "Tab 3")
	; Get/Set tab 1 text
	_GUICtrlTab_SetItemText($hTab, 0, "New Text")
	MsgBox(4160, "Information", "Tab 1 text: " & _GUICtrlTab_GetItemText($hTab, 0))

	; Loop until user exits
EndFunc   ;==>_Main
Note: See TracQuery for help on using queries.