Modify

Opened 10 years ago

Closed 10 years ago

#3150 closed Feature Request (Rejected)

Add new functions to GuiListView UDF

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

Please add new function to GuiListView UDF:
_GUICtrlListView_GetFirstSelectedIndice($hWnd)

In many cases only first selected indice is needed and also it would be faster, than _GUICtrlListView_GetSelectedIndices()

Func _GUICtrlListView_GetFirstSelectedIndice($hWnd)
	Local $iRet, $iCount = _GUICtrlListView_GetItemCount($hWnd)
	For $iItem = 0 To $iCount
		If IsHWnd($hWnd) Then
			$iRet = _SendMessage($hWnd, $LVM_GETITEMSTATE, $iItem, $LVIS_SELECTED)
		Else
			$iRet = GUICtrlSendMsg($hWnd, $LVM_GETITEMSTATE, $iItem, $LVIS_SELECTED)
		EndIf
		If $iRet Then
			Return Number($iItem)
		EndIf
	Next
	Return SetError(1,0,0)
EndFunc   ;==>_GUICtrlListView_GetSelectedIndices

Attachments (0)

Change History (3)

comment:1 by BrewManNH, 10 years ago

You could use _GUICtrlListview_GetSelectionMark to do that instead of rewriting the _GUICtrlListView_GetSelectedIndices() function, or creating a new one that does basically the same thing.

comment:2 by anonymous, 10 years ago

hmm... it seems yes, especially with $LVS_SINGLESEL. If there are no "underwater rocks" in function logic, _GUICtrlListview_GetSelectionMark should be good alternative...

comment:3 by Melba23, 10 years ago

Resolution: Rejected
Status: newclosed

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


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