Martin, this is very elegant solution,
thanks a lot for sharing!
I'm sure somebody can use this someday....
You can 'load' millions of items within a second into the listview. The listview shows in fact only the records that should be visible. Instead of an array you can also use a database (FILE_GETR command for example). The 4th listview column in this example is a hidden column with the record numbers.
Key handling (up/down/home/end/pgup/pgdn) is done by the script
Horizontal and vertical scrollbars are virtual
Although I am pretty proud of it, I couldn't make this without the help of our master Eros, who solved some problems for me.
Martin, this is very elegant solution,
thanks a lot for sharing!
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Thank you very much martin.
I think it can be a great teaching example of anyone in need of a method to manage a lot of data.
Ciao
Eros
PS: I attached the script as file + added an image. Better for those willing to test it or get source.
To run the script, you need to have thinBasic at least version 1.7.9.0 beta or above
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Hi Eros,
First of all, thanks for your hard work on the new ThinAir version. Unfortunately a lot of things aren't working yet, but I am very happy that the Undo problem has been solved!!
Now my problem for today
I discovered a problem with the script I posted in this topic.
I have add small code to callback function cbSlave():
[code=thinbasic]
CASE %LVN_COLUMNCLICK 'sort the listview
do while not Terminate
'some commands here
doevents
loop
[/code]
In the dialog callback function WindowMainProc() I set the global viariable Terminate to %TRUE when the dialog is closed
[code=thinbasic]
CASE %WM_CLOSE
terminate=%true
STOP
[/code]
You can find complete code in attachment....
If execute this script and then close the dialog by clicking the red closing-button (X) at the right top, the program crash. Is there a way to solve this? I tried the same code in another listview script and then everything works fine, I am pretty sure that this has something to do with the cbSlave callback function (i know....you already warned me that using this could be tricky )
Thanks in advance for your reply!
Martin
Oh, I forgot to tell that you must first click on a (grey) listview column and then close the dialog! Only then the program will crash
problem "solved" by removing doevents instruction
martin, how to use your script ?
some minutes before I wanted to write you, that your script causes at my pc more than one gpf`s. you are faster, good guy! I will test your script again thanks!
bye, lydia
hasta la vida
Lydia, as fas as I know my script should work fine, but please download the one at the top of this topic http://community.thinbasic.com/index....0;attach=5692Originally Posted by lydia_sp
Please let me know if there's something wrong, i hate errors
works fine ! have downloaded another script of this morning
saludos, lydia
hasta la vida
hello martin.
my instincts are correct
your last script has the problem I have noticed yesterday morning. your first script (first post) is ok.
the last script: may be a problem in line 32 (please use debug modus!) with F8 you will come into a loop and cannot check whole script.
if I push grey column then any line below, close the window the gpf will come.
lydia
hasta la vida
Bookmarks