Modify

Opened 9 years ago

Closed 9 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 Changed 9 years ago by BrewManNH

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 Changed 9 years ago by anonymous

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 Changed 9 years ago by Melba23

  • Resolution set to Rejected
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.