Modify

Opened 11 years ago

Closed 11 years ago

#3085 closed Bug (Fixed)

wrong examples

Reported by: Tweaky Owned by: J-Paul Mesnage
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 by guinness, 11 years ago

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.

comment:2 by mLipok, 11 years ago

_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 by mLipok, 11 years ago

_IEFormElementSetValue[3]
_IEFormElementSetValue[4]

are explained in Remarks:

Note: You cannot use _IEFormElementSetValue() to set the value of an INPUT TYPE=FILE element. Browser security restrictions prevent this element from being scripted. See the example below for a workaround.

comment:4 by mLipok, 11 years ago

_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 by mLipok, 11 years ago

_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 by mLipok, 11 years ago

_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 by J-Paul Mesnage, 11 years ago

Milestone: 3.3.15.1
Owner: set to J-Paul Mesnage
Resolution: Fixed
Status: newclosed

Fixed by revision [11489] in version: 3.3.15.1

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.