Opened 3 years ago

Last modified 3 years ago

#3791 closed Bug

Sort arrow not showing in _ArrayDisplay() — at Initial Version

Reported by: pixelsearch Owned by:
Milestone: 3.3.15.4 Component: Standard UDFs
Version: 3.3.14.5 Severity: None
Keywords: Cc:

Description

Bug described in this link :
https://www.autoitscript.com/forum/topic/204379-sort-arrow-in-_arraydisplay/

==========================
Test reproducing the issue :

#include <Array.au3>
Global $aSortTest[2][3] = 1a", "1b", "1c"], ["2a", "2b", "2c?
_ArrayDisplay($aSortTest)

Clicking on a column header doesn't show the sort arrow for either ascending or descending order.

==========================
Cause :
Line 563 in ArrayDisplayInternals.au3 (version 3.3.14.5) sends a wrong message, because it uses a handle instead of a control id

Local $hHeader = HWnd(GUICtrlSendMsg($hWnd, 0x101F, 0, 0))

==========================
How to fix this (lines 558 to 563)

/ Actual wrong code :

Func ArrayDisplay_RegisterSortCallBack($hWnd, $vCompareType = 2, $bArrows = True, $sSort_Callback = "ArrayDisplay_SortCallBack")

#Au3Stripper_Ignore_Funcs=$sSort_Callback

If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)

;~ Local Const $LVM_GETHEADER = (0x1000 + 31) ; 0x101F

Local $hHeader = HWnd(GUICtrlSendMsg($hWnd, 0x101F, 0, 0))

/ Suggested correct code :

Func ArrayDisplay_RegisterSortCallBack($ControlID, $vCompareType = 2, $bArrows = True, $sSort_Callback = "ArrayDisplay_SortCallBack")

#Au3Stripper_Ignore_Funcs=$sSort_Callback

;~ Local Const $LVM_GETHEADER = (0x1000 + 31) ; 0x101F

Local $hHeader = HWnd(GUICtrlSendMsg($ControlID, 0x101F, 0, 0))

Local $hWnd = GUICtrlGetHandle($ControlID)

Change History (0)

Note: See TracTickets for help on using tickets.