﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1517	_GUICtrlListView_SimpleSort not sorts checkboxes defined by $LVS_EX_CHECKBOXES	anonymous	Jpm	"Below is example script
- shows files and directories in C:\

Step to reproduce bug.
1) run script
2) select checkbox in AUTOEXEC.BAT row
3) 2xClick to ""filename"" table header to sort descending 
4) see the checkbox - is in row that has not AUTOEXEC.BAT

P.S.: check: GUICtrlRegisterListViewSort for this bug



#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#include <GuiListView.au3>

;zakladni titulek pro dialogova okna
Global Const $str_MainGuiTitle = ""pacoDirFilesList""

Global Const $VERSION = ""0.22""

Dim $DIRsource = """"
Dim $DIRdestination = """"
Dim $FILES_ListView = """"
Dim $SOURCE_PathNameHeader = """"
Dim $SOURCE_PathNameValue = """"
Dim $SOURCE_btnChange = """"
Dim $DEST_PathNameHeader = """"
Dim $DEST_PathNameValue = """"
Dim $DEST_btnChange = """"
Dim $MAIN_btnSelectALL = """"
Dim $MAIN_btnUnselectALL = """"
Dim $MAIN_btnDirFilesList = """"
Dim $MAIN_btnHELP = """"
Dim $MAIN_btnEND = """"
Dim $Status = """"
Dim $copyright = $str_MainGuiTitle & ""   "" & ""ver.:"" & $VERSION & ""   "" & ""© PACO+RIC""
Dim $B_DESCENDING = False

createMainGui()
flushListView()

While 1
  $msg = GUIGetMsg()
  Select
;    Case $msg = $GUI_EVENT_CLOSE Or $msg = $MAIN_btnEND
    Case $msg = $MAIN_btnEND
      Exit
    Case $msg = $FILES_ListView
      ; sort the list by the column header clicked on
      ;MsgBox(0,""GUICtrlGetState($FILES_ListView) & $B_DESCENDING"",GUICtrlGetState($FILES_ListView) & "" "" & $B_DESCENDING)
      If GUICtrlGetState($FILES_ListView) <> 0 Then ; nesortovat prvni sloupec (prvni sloupec je urcen pro checkboxy)
        _GUICtrlListView_SimpleSort($FILES_ListView, $B_DESCENDING, GUICtrlGetState($FILES_ListView))
      EndIf
  EndSelect
Wend

Func flushListView()
  _GUICtrlListView_DeleteAllItems($FILES_ListView)
  $search = FileFindFirstFile(""C:\*.*"")
  ; Check if the search was successful
  If $search = -1 Then
    ;MsgBox(0, ""Error"", ""No files/directories matched the search pattern"")
    Return 0
  EndIf
  While 1
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
    ;MsgBox(0, ""File:"", $file)
      ; pokud neobsahuje uvozovky, lze jej zaradit na seznam
      $fileSize = FileGetSize(""C:\"" & $file)
      $arrFileDate = FileGetTime(""C:\"" & $file)
      $fileDate = $arrFileDate[0] & ""-"" & $arrFileDate[1] & ""-"" & _
                  $arrFileDate[2] & "" "" & $arrFileDate[3] & "":"" & _
                  $arrFileDate[4] & "":"" & $arrFileDate[5]
      $polozka = ""|"" & $file & ""|"" & $fileSize & ""|"" & $fileDate
      GuiCtrlCreateListViewItem($polozka, $FILES_ListView)
  WEnd
  FileClose($search)
  Return _GUICtrlListView_GetItemCount($FILES_ListView)
EndFunc   ; END ===>  flushListView()

Func createMainGui()
  GUICreate($str_MainGuiTitle, 650, 360, -1, -1, 0)

  $FILES_ListView = GuiCtrlCreateListView( ""|filename|size [bytes]|date""           ,   5,  50, 635, 230, _
                                           $LVS_SINGLESEL + $LVS_SHOWSELALWAYS + $LVS_REPORT, _
                                           BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_REGIONAL, $LVS_EX_CHECKBOXES))
  $MAIN_btnEND          = GUICtrlCreateButton( ""EXIT""                              , 560, 283,  80,  22)

  GUISetState()  ;SHOW the window

EndFunc   ; END ===>  createMainGui()
"	Bug	closed	3.3.7.0	AutoIt	3.3.6.0	None	Fixed		
