Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Here's a working virtual listview script

  1. #1
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Here's a working virtual listview script

    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.

    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Here's a working virtual listview script



    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

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10

    Re: Here's a working virtual listview script

    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

  4. #4
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: Here's a working virtual listview script

    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
    Attached Files Attached Files

  5. #5
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: Here's a working virtual listview script

    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

  6. #6
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: Here's a working virtual listview script

    problem "solved" by removing doevents instruction

  7. #7

    Re: Here's a working virtual listview script

    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

  8. #8
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: Here's a working virtual listview script

    Quote Originally Posted by lydia_sp
    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
    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=5692

    Please let me know if there's something wrong, i hate errors

  9. #9

    Re: Here's a working virtual listview script

    works fine ! have downloaded another script of this morning

    saludos, lydia
    hasta la vida

  10. #10

    Re: Here's a working virtual listview script

    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
    Attached Images Attached Images
    hasta la vida

Page 1 of 2 12 LastLast

Similar Threads

  1. Microsoft Virtual PC 2007 SP1
    By ErosOlmi in forum Technology
    Replies: 3
    Last Post: 22-05-2008, 00:02

Members who have read this thread: 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •