Opened 10 years ago
Closed 10 years ago
#3085 closed Bug (Fixed)
wrong examples
| Reported by: | Tweaky | Owned by: | Jpm | 
|---|---|---|---|
| Milestone: | 3.3.15.1 | Component: | Documentation | 
| Version: | 3.3.14.0 | Severity: | None | 
| Keywords: | Cc: | 
Description
Hi,
the examples of the two functions are swap
_Excel_ColumnToLetter / _Excel_ColumnToNumber
in the examples of the following functions, the function does not appear
_GDIPlus_PathBrushGetWrapMode
_GDIPlus_StringFormatGetMeasurableCharacterRangeCount
_GUICtrlRebar_GetBandMarginsEx
_GUICtrlTreeView_GetFirstItem
_GUICtrlTreeView_SetHeight
_GUIScrollBars_GetScrollInfoEx
_GUIToolTip_GetText[2]
_IECreate[5]
_IEFormElementSetValue[3]
_IEFormElementSetValue[4]
_IELinkClickByText[2]
Attachments (0)
Change History (7)
comment:1 Changed 10 years ago by guinness
comment:2 Changed 10 years ago by mLipok
_GUICtrlTreeView_GetFirstItem
Please change this:
Local $hFirst = _GUICtrlTreeView_GetFirstVisible($idTreeView) MsgBox($MB_SYSTEMMODAL, "Information", "The handle of the first visible item: " & $hFirst)
to this:
Local $hFirst = _GUICtrlTreeView_GetFirstItem($idTreeView) MsgBox($MB_SYSTEMMODAL, "Information", "The handle of the topmost or very first item: " & $hFirst)
comment:3 Changed 10 years ago by mLipok
comment:4 Changed 10 years ago by mLipok
_IELinkClickByText[2]
is showing how to: ; using a sub-string match.
This would be beter to add new parameter:
Here is proposal:
Func _IELinkClickByText(ByRef $oObject, $sLinkText, $iIndex = 0, $iWait = 1''', $bRegExp = False''')
	If Not IsObj($oObject) Then
		__IEConsoleWriteError("Error", "_IELinkClickByText", "$_IESTATUS_InvalidDataType")
		Return SetError($_IESTATUS_InvalidDataType, 1, 0)
	EndIf
	;
	Local $iFound = 0, $sModeLinktext, $oLinks = $oObject.document.links
	$iIndex = Number($iIndex)
	For $oLink In $oLinks
		$sModeLinktext = String($oLink.outerText)
''';~ 		If $sModeLinktext = $sLinkText Then'''
		If $sModeLinktext = $sLinkText Or ($bRegExp And StringRegExp($sModeLinktext, $sLinkText, 0) = 1) Then
			If ($iFound = $iIndex) Then
				$oLink.click()
				If @error Then ; Trap COM error, report and return
					__IEConsoleWriteError("Error", "_IELinkClickByText", "$_IESTATUS_COMError", @error)
					Return SetError($_IESTATUS_COMError, @error, 0)
				EndIf
				If $iWait Then
					_IELoadWait($oObject)
					Return SetError(@error, 0, -1)
				EndIf
				Return SetError($_IESTATUS_Success, 0, -1)
			EndIf
			$iFound = $iFound + 1
		EndIf
	Next
	__IEConsoleWriteError("Warning", "_IELinkClickByText", "$_IESTATUS_NoMatch")
	Return SetError($_IESTATUS_NoMatch, 0, 0) ; Could be caused by parameter 2, 3 or both
EndFunc   ;==>_IELinkClickByText
add:
#include <StringConstants.au3>
comment:5 Changed 10 years ago by mLipok
_GUICtrlTreeView_SetHeight.au3
Proposal:
#include <GUIConstantsEx.au3>
#include <GuiTreeView.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
	Local $aidItem[2], $idTreeView
	Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES)
	GUICreate("TreeView Set Height", 400, 300)
	$idTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE)
	GUISetState(@SW_SHOW)
	_GUICtrlTreeView_BeginUpdate($idTreeView)
	For $x = 0 To UBound($aidItem) - 1
		$aidItem[$x] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $x + 1), $idTreeView)
	Next
	_GUICtrlTreeView_EndUpdate($idTreeView)
	MsgBox($MB_SYSTEMMODAL, "Information", StringFormat("Item Height? %s", _GUICtrlTreeView_GetHeight($idTreeView)))
	_GUICtrlTreeView_SetHeight($idTreeView,100)
	MsgBox($MB_SYSTEMMODAL, "Information", StringFormat("Item Height? %s", _GUICtrlTreeView_GetHeight($idTreeView)))
	; Loop until the user exits.
	Do
	Until GUIGetMsg() = $GUI_EVENT_CLOSE
	GUIDelete()
EndFunc   ;==>Example
    comment:6 Changed 10 years ago by mLipok
_GUIScrollBars_GetScrollInfoEx.au3
proposal:
#include <GUIConstantsEx.au3>
#include <GuiScrollBars.au3>
#include <StructureConstants.au3>
#include <WindowsConstants.au3>
Global $g_idMemo
Example()
Func Example()
	Local $hGUIMsg, $hGUI, $tag_SCROLLINFO
	$hGUI = GUICreate("ScrollBar Example", 400, 400, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
	$g_idMemo = GUICtrlCreateEdit("", 2, 32, 380, 226, BitOR($WS_HSCROLL, $WS_VSCROLL))
	GUICtrlSetResizing($g_idMemo, $GUI_DOCKALL)
	GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
	GUISetBkColor(0x88AABB)
	GUISetState(@SW_SHOW)
	_GUIScrollBars_Init($hGUI)
	MemoWrite("--------------------------------------" & @CRLF)
	$tag_SCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hGUI, $SB_CTL)
	MemoWrite("scroll bar control" & @CRLF)
	MemoWrite("cbSize.......: " & DllStructGetData($tag_SCROLLINFO, "cbSize"))
	MemoWrite("fMask........: " & DllStructGetData($tag_SCROLLINFO, "fMask"))
	MemoWrite("nMin.........: " & DllStructGetData($tag_SCROLLINFO, "nMin"))
	MemoWrite("nPage........: " & DllStructGetData($tag_SCROLLINFO, "nPage"))
	MemoWrite("nPos.........: " & DllStructGetData($tag_SCROLLINFO, "nPos"))
	MemoWrite("nTrackPos....: " & DllStructGetData($tag_SCROLLINFO, "nTrackPos"))
	MemoWrite("--------------------------------------" & @CRLF)
	$tag_SCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hGUI, $SB_HORZ)
	MemoWrite("Horizontal" & @CRLF)
	MemoWrite("cbSize.......: " & DllStructGetData($tag_SCROLLINFO, "cbSize"))
	MemoWrite("fMask........: " & DllStructGetData($tag_SCROLLINFO, "fMask"))
	MemoWrite("nMin.........: " & DllStructGetData($tag_SCROLLINFO, "nMin"))
	MemoWrite("nPage........: " & DllStructGetData($tag_SCROLLINFO, "nPage"))
	MemoWrite("nPos.........: " & DllStructGetData($tag_SCROLLINFO, "nPos"))
	MemoWrite("nTrackPos....: " & DllStructGetData($tag_SCROLLINFO, "nTrackPos"))
	MemoWrite("--------------------------------------" & @CRLF)
	$tag_SCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hGUI, $SB_VERT)
	MemoWrite("Vertical" & @CRLF)
	MemoWrite("cbSize.......: " & DllStructGetData($tag_SCROLLINFO, "cbSize"))
	MemoWrite("fMask........: " & DllStructGetData($tag_SCROLLINFO, "fMask"))
	MemoWrite("nMin.........: " & DllStructGetData($tag_SCROLLINFO, "nMin"))
	MemoWrite("nPage........: " & DllStructGetData($tag_SCROLLINFO, "nPage"))
	MemoWrite("nPos.........: " & DllStructGetData($tag_SCROLLINFO, "nPos"))
	MemoWrite("nTrackPos....: " & DllStructGetData($tag_SCROLLINFO, "nTrackPos"))
	MemoWrite("--------------------------------------" & @CRLF)
	While 1
		$hGUIMsg = GUIGetMsg()
		Switch $hGUIMsg
			Case $GUI_EVENT_CLOSE
				ExitLoop
		EndSwitch
	WEnd
	Exit
EndFunc   ;==>Example
; Write a line to the memo control
Func MemoWrite($sMessage)
	GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite
    comment:7 Changed 10 years ago by Jpm
- Milestone set to 3.3.15.1
- Owner set to Jpm
- Resolution set to Fixed
- Status changed from new to closed
Fixed by revision [11489] in version: 3.3.15.1
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.


I have fixed the first part but not your second. I will leave it here for people to comment on the best course of action.