Modify

Opened 15 years ago

Closed 15 years ago

#1517 closed Bug (Fixed)

_GUICtrlListView_SimpleSort not sorts checkboxes defined by $LVS_EX_CHECKBOXES

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

Description

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()

Attachments (0)

Change History (2)

comment:1 Changed 15 years ago by Jpm

I am not sure simplesort support the checkboxing at least from the association of the box checked.
Basically mixing GUI... builtins and _GUICtrl...() UDF works sometime. Mixing must be avoid. Everything become the designer reponsability

comment:2 Changed 15 years ago by Jpm

  • Milestone set to 3.3.7.0
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [5793] in version: 3.3.7.0

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 owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.