Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multicolumn List with Icons - Timing issues
#1
I understand that you can have icons in a multicolumn list using :
Quote:sub.LvSetCellImage

provided that the icons are described using
Quote:SendMessage hsys32 LVM_SETIMAGELIST LVSIL_SMALL t_il

It is implied that the image list is loaded or created previously.

I have such a list with about 8000 items. Actually it is created browsing all menus in my QM file, and it is used as a catalogue to find things that I have forgotten, even if they ever existed.

I have experienced that sub.LvSetCellImage is time consuming and I am thinking over abandoning it. I am not in a position to investigate whether this delay is due to the searching in the imagelist or to the designing of each individual list line. Any advice on these issues and/or ideas about possible alternate solutions will be much appreciated.
#2
When so many items, use virtual listview. Much much faster. Example - function ListDialog in System folder. Or use QM_grid control, it is a virtual listview.
#3
Thanks indeed! I will try and I will let you know if necessary. Best regards.
#4
I wonder whether there exists, in the case of QM_grid control, a routine similar to that for list filtering, dealt with in topic Looking for a Dialog Example with Interactive List Filtering

Many thanks indeed.
#5
Function dlg_grid_filtering
Code:
Copy      Help
\Dialog_Editor

str sItems=
;January
;February
;March
;April
;May
;June
;July
;August
;
rep(10) sItems+sItems
;out numlines(sItems) ;;8192

str dd=
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;3 Edit 0x54030080 0x200 0 0 96 14 ""
;4 QM_Grid 0x5603504D 0x200 0 16 96 98 "0x12,0,0,0x0,0x0[]A,80%,,"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040308 "*" "" "" ""

str controls = "3 4"
str e3 qmg4x
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc v
function# hDlg message wParam lParam
DlgGrid g.Init(hDlg 4)
sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 300 0
,
,case WM_TIMER
,sel wParam
,,case 1
,,KillTimer hDlg wParam
,,g.RowsDeleteAll
,,str s sEdit.getwintext(id(3 hDlg))
,,foreach s sItems
,,,if(sEdit.len and find(s sEdit 0 1)<0) continue
,,,g.RowAddSetSA(-1 &s 1)
,
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case EN_CHANGE<<16|3
,SetTimer hDlg 1 300 0
,
,case IDOK
,case IDCANCEL
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.idFrom
,case 4
,NMITEMACTIVATE* na=+nh
,sel nh.code
,,case NM_CLICK
,,if na.iItem>=0
,,,out "row click: %i %s" na.iItem g.CellGet(na.iItem 0)
#6
It is amazing : QM_grid is incredibly faster!

Much Obliged!
#7
I understand that if the list is multi-column, then the comparison will be done with the string items of the first column, and then the row must be rebuilt with the cells of the row, possibly stored in several adjacent local str variables. It is implied that each of the columns of this grid have to be initially stored in arrays. Unless there is another simpler way to do it. Any advice is mostly welcome.
#8
In the meantime and after further thinking, I concluded that this technique might be better :

Code:
Copy      Help
        int il=-1
        str sln
        foreach s sk
            il=il+1
            if(sEdit.len and find(s sEdit 0 1)<0) continue
            _s.getl(sl il)
            sln.formata("%s[]" _s)
        g.FromCsv(sln ":")

where :
sl : the initial string
sk: the string corresponding to the first column
sln : a new string with the rows which they meet the "find" criterion.

I am still looking forward for comments.


Forum Jump:


Users browsing this thread: 1 Guest(s)