Re: [Win32lib] Listview speed

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hey Derek,

Ive modified Win32lib's ColumnClick Notification to use loadLVInfo( ),
theres only one problem I see with this.

You must declare your alldata sequence ahead of including Win32lib.ew
Im not sure if I'll even try to work this out until later next week.

The good news is that for 1500+ items it seems to take (visually) about the
same time as it would to normally load your LV. 
This is pretty fast, folks!

Here's what Ive done thus far:

global integer SORT_BY
SORT_BY=0

global function CS_byElement(sequence s1,sequence s2)
    return compare(s1[SORT_BY],s2[SORT_BY])
end function

global constant ByElement=routine_id("CS_byElement")

----------------------------------------------------
function fDoLVN_COLUMNCLICK(integer id, atom hWnd, atom wParam, atom lParam)
----------------------------------------------------
integer
    lColumn,
    lOwner
   
    id = getId( fetch( lParam, NMHDR_hwndFrom ))  
    if id != 0 then
        lColumn = fetch( lParam, NMLISTVIEW_iSubItem ) + 1
        SORT_BY=lColumn
        alldata=custom_sort(ByElement,alldata)
        VOID = sendMessage(id,WM_SETREDRAW,0,0)
        loadLVInfo(id, alldata)
        VOID = sendMessage(id,WM_SETREDRAW,1,0)
    end if

    return {kReturnNow}
end function


Euman
euman at bellsouth.net

==================================================================
The information contained in this message may be confidential 
and is intended to be exclusively for the addressee. Should you 
receive this message unintentionally, please do not use the contents 
herein and notify the sender immediately by return e-mail.
==================================================================

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu