Modify ↓
#4093 new Feature Request
_GUICtrlListView_GetItem() - Item state - $aItem[0] = 0
| Reported by: | mLipok | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | Standard UDFs | |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
I was trying to find a solution to one of my problem here:
https://www.autoitscript.com/forum/topic/213679-listview-get-igroupid-and-igroup-for-listviewitem/#findComment-1552336
And I notice that according to:
https://www.autoitscript.com/autoit3/files/beta/autoit/docs/libfunctions/_GUICtrlListView_GetItem.htm
Returns an array with the following format:
[0] - Item state, which can be a combination of the following:
1 - The item is marked for a cut-and-paste operation
2 - The item is highlighted as a drag-and-drop target
4 - The item has the focus
8 - The item is selected
For this reason I expected one of these values or a combination of them, and if not, I expected a value of 0.
please consider to add this one line:
$aItem[0] = 0
like this:
| Line | |
|---|---|
| 1 | Func _GUICtrlListView_GetItem($hWnd, $iIndex, $iSubItem = 0) |
| 2 | Local $tItem = $__g_tListViewItem |
| 3 | |
| 4 | DllStructSetData($tItem, "Mask", BitOR($LVIF_GROUPID, $LVIF_IMAGE, $LVIF_INDENT, $LVIF_PARAM, $LVIF_STATE)) |
| 5 | DllStructSetData($tItem, "Item", $iIndex) |
| 6 | DllStructSetData($tItem, "SubItem", $iSubItem) |
| 7 | DllStructSetData($tItem, "StateMask", -1) |
| 8 | _GUICtrlListView_GetItemEx($hWnd, $tItem) |
| 9 | |
| 10 | Local $iState = DllStructGetData($tItem, "State") |
| 11 | Local $aItem[8] |
| 12 | $aItem[0] = 0 |
| 13 | If BitAND($iState, $LVIS_CUT) <> 0 Then $aItem[0] = BitOR($aItem[0], 1) |
| 14 | If BitAND($iState, $LVIS_DROPHILITED) <> 0 Then $aItem[0] = BitOR($aItem[0], 2) |
| 15 | If BitAND($iState, $LVIS_FOCUSED) <> 0 Then $aItem[0] = BitOR($aItem[0], 4) |
| 16 | If BitAND($iState, $LVIS_SELECTED) <> 0 Then $aItem[0] = BitOR($aItem[0], 8) |
| 17 | $aItem[1] = __GUICtrlListView_OverlayImageMaskToIndex($iState) |
| 18 | $aItem[2] = __GUICtrlListView_StateImageMaskToIndex($iState) |
| 19 | $aItem[3] = _GUICtrlListView_GetItemText($hWnd, $iIndex, $iSubItem) |
| 20 | $aItem[4] = DllStructGetData($tItem, "Image") |
| 21 | $aItem[5] = DllStructGetData($tItem, "Param") |
| 22 | $aItem[6] = DllStructGetData($tItem, "Indent") |
| 23 | $aItem[7] = DllStructGetData($tItem, "GroupID") |
| 24 | |
| 25 | Return $aItem |
| 26 | EndFunc ;==>_GUICtrlListView_GetItem |
Attachments (0)
Note:
See TracTickets
for help on using tickets.
