Jump to content

Virtual listviews for huge number of rows


LarsJ
 Share

Recommended Posts

LarsJ,
Intresting the "Data stored in arrays" but seems not work with the extended style $LVS_EX_CHECKBOXES, one checkbox for row, maybe because we need to draw by ourself. In this cases i think has many drawback ( like not working the function Get-SetItemChecked and the other related ) or i'm wrong and can be added in a easy way?
Thanks

EDIT: A source in PowerBASIC --> %LVS_EX_CHECKBOXES in Virtual Listview control

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to comment
Share on other sites

Most functions in the GuiListView UDF to maintain data and state information does not work for a virtual listview ($LVS_OWNERDATA), because the information is not stored in the listview. But something that works and works well and fast is custom drawn rows and items (for and back color). See this post.

Link to comment
Share on other sites

That link you posted is always a virtual listview. If you mean to use "NM_CUSTOMDRAW" i'm already using it for coloring the row. But there is many difference of speed between the "real" and the "virtual" one, with the real i need to wait minutes before see the list full loaded ( yes i'm using BeginUpdate/EndUpdate ) for items goes to 20.000 to 60.000 approx. The "virtual" is faster, no doubt on it.

Too bad i can't use the virtual listview with checkbox...

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to comment
Share on other sites

Added two array-examples. An example that shows how to use checkboxes and icons, and an example that shows how to draw every second row with a different background color. The listviews are still lightning fast and can handle millions of rows. Zip in first post updated.

Link to comment
Share on other sites

LarsJ,

Very cool. I'm not an expert like you but i have a suggestion for the checkbox. Clicking on the row automatically check-uncheck the chechbox ( this behavor depends by $LVS_EX_FULLROWSELECT )

I think you have to get only the message $LVHT_ONITEMSTATEICON for detect only the click on the checkbox and not on the entire row

I'll appreciate your work, thanks :D

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to comment
Share on other sites

I'm understanding this virtual listview, the basic thing is not treat this listview like a listview but like an array. For example this is the funtion i'll use for check-uncheck a checkbox

The funtion i'm miss is InsertItem/AddItem, increasing the array is not sufficient for add a new value. There's something I don't get!

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to comment
Share on other sites

You have to tell the LV that you have added more rows:

 

GUICtrlSendMsg( $idLV, $LVM_SETITEMCOUNT, $iRows, 0 )

$iRows is the new (total) number of rows.

Link to comment
Share on other sites

You have right ;)

Seems _GUICtrlListView_SetColumnWidth with $LVSCW_AUTOSIZE not work, and most badly GUICtrlRegisterListViewSort seems don't have any effect when you click on the colum...For the first there are some solution ( like use LVM_GETSTRINGWIDTHW? ) but for custom sort i don't have found nothing. Do you know why?

EDIT: Why you truncate any string over the 50 character?

Local Static $tText = DllStructCreate("wchar[50]")

I have just notice it, if a string is longer then 50 char it will show truncated. How to set to indefinite? Or i just need to put an higher value like 100,200?

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to comment
Share on other sites

Link to comment
Share on other sites

Thanks. Waiting for sorting. Example using ini file ( sql independent example ) ? ????

K L M
------------------
Real Fakenamovich
------------------
K L M
------------------
Real Fakenamovich
------------------

Link to comment
Share on other sites

Link to comment
Share on other sites

I have added some more examples:

  • Data stored in fixed-length record files.

    An example where $LVN_ODCACHEHINT messages are used to extract data directly from a fixed-length record file into an array cache by setting the file pointer to the current record and reading the required number of bytes.

  • Sorting rows in a virtual listview.
  • $LVN_ODFINDITEM notifications.

    Used to find a row when you press one or a few keys on the keyboard.

  • Using standard listviews.

    If not more than 10,000 rows have to be inserted in a listview, a standard listview should be used. An example shows how you can quickly fill a listview with native commands. Another example shows how you can quickly fill a listview from an inifile.

More information and new zip in first post.
Link to comment
Share on other sites

Thanks for replying.

Thanks for the ini example.

Can you please share how to get Window 7 Explorer ListView Details such as columns & rows data ? ( folder details ) USING WINAPI

Where is syslistview32 class in win 7 explorer ?

Edited by KLM

K L M
------------------
Real Fakenamovich
------------------
K L M
------------------
Real Fakenamovich
------------------

Link to comment
Share on other sites

There is no SysListView32 control in Windows Explorer on Vista and later. Instead of there is a DirectUIHWND control, which is a virtual listview like in this example. Because it's a virtual listview it only contains information about the files and folders which are visible. There is no easy way to get all files and folders in the current folder.

Fortunately, there is an Automating Windows Explorer UDF, that can extract the information you are looking for. Take a look at the examples in post 7.

If there isn't an example that fits on the information you need, please let me know. It should not be too hard to add more examples.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...