Listview.dll with and without SQLite-Interface

agraham

Expert
Licensed User
Longtime User
I assume you are running on the desktop. That is a previous desktop version of System.Data.Sqlite.dll that your program is looking for. It looks like you have an old version of SQLDesktop.dll in your project directory (although I thought 6.80 would automatically copy the latest over) and don't have the matching System.Data.Sqlite.dll it was compiled against in the same folder.
 

RichardW

Member
Licensed User
Longtime User
I have checked and the sample program does have the current SQLDesktop.dll (2009/05/09) in its directory and in B4PPC Library Path.

System.Data.SQLite.DLL (820k 2009/03/24) is in C:\Program Files\Anywhere Software\Basic4ppc Desktop\Libraries\SQLNative\Desktop

I can also confirm that 6.80 does update the old dlls when i start up previous 6.5 projects.
 

RichardW

Member
Licensed User
Longtime User
Copied the ListviewExample.SBP and the sqlite database northwind.sl3 into a new folder. when i loaded it into b4ppc ide it copied 4 dlls into the folder

listviewsqldesktop.dll 2009/04/12 12:46am 40kb
listviewsqldevice.dll 2009/04/12 12:47am 40kb
sqldesktop.dll 2009/05/09 1:45pm 10kb
sqldevice.dll 2009/05/09 1:49pm 10kb

Ran it and clicked on menu to run LOADSQL and got exactly same error as before.

Is there some old path or registry setting I should remove?
 

agraham

Expert
Licensed User
Longtime User
Is there some old path or registry setting I should remove?
No, I tried what you did and got the same error. Looking inside ListviewSQLDesktop.dll with Reflector it references the missing (old) "System.Data.SQLite, Version=1.0.40.0 ... " library. I don't know why it needs this reference as I would have thought that access to SQLite would be done via SQLDesktop.dll. ListviewSQLDesktop will need to be recompiled with this reference updated or removed in order to work with the SQLite files supplied with version 6.80.

I note that System.Data.SQLite.DLL for the desktop will need to be manually copied to the project folder for the program to run.

I also note the slightly odd behaviour that Basic4ppc lowercases the filenames of SQLDesktop.dll and SQLDevice.dll when it copies them to the project folder.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I note that System.Data.SQLite.DLL for the desktop will need to be manually copied to the project folder for the program to run.
Actually this step is not required. The correct System.Data.SQLite.dll is deployed in Basic4ppc folder during installation. When you run a program from the IDE, all additional libraries (not directly referenced by Basic4ppc) should be placed together with the main executable which is Basic4ppc Desktop.exe in that case.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You are correct. But when you compile a program that references SQLDesktop or SQLDevice then the correct native dlls will be copied during compilation to the target folder. So there is no need to manually copy it.

Note that in v6.80 the dll files are now:
Desktop - System.Data.Sqlite.dll (820kb)
Device - System.Data.Sqlite.device.dll and SQlite.interop.060.dll

There is a new functionality in v6.80 which allows copying files during compilation:
B4X:
 (from SQLDevice.cs)
//version: 1.51
//ref: SQLNative\Device\System.Data.SQLite.Device.dll
//copy: SQLNative\Device\SQLite.Interop.060.dll
//ref - This library will be referenced during compilation and it will also be copied to the target folder.
//copy - This file will be copied to the target folder during compilation.

You can use these 'keywords' multiple times if needed.
 
D

Deleted member 103

Guest
Hi,

i have updated my library v1.0.7.6

1. Error in module LoadCSV fixed, same function as Table-Control.
2. ListviewSQLDesktop.dll and ListviewSQLDevice.dll is now compatible with Basic4ppc V6.8


Ciao,
Filippo
 

RichardW

Member
Licensed User
Longtime User
Thank you Filippo, that was fast. All my programs are now compiling and working fine.

I am curious; how do you reduce the padding between the rows of the listview so that they are so compact?
 
D

Deleted member 103

Guest
Hi RichardW,

I'm sorry but I do not understand what you mean, my "google-English" is not so good. :sign0013:

Ciao,
Filippo
 
D

Deleted member 103

Guest
Please provide a picture inside, a picture says more than 1000 words.
 

agraham

Expert
Licensed User
Longtime User
I am curious; how do you reduce the padding between the rows of the listview so that they are so compact?
If you mean what I think you mean (how have you reduced ...) then the answer is he hasn't, that is how a Listview in Details view draws itself. The line spacing seems to be governed by the Font in use and I can't see that Filippo has exposed a way of changing that.
 

RichardW

Member
Licensed User
Longtime User
That is what I meant. All references below are for Detail view with fontsize=8.

I noticed when I used Filippo's listview with the checkboxes set to TRUE, the height of the rows is the same as a listview setup with ControlsExDevice(Dummy).

However if I create Filippo's listview with checkboxes FALSE, then the rows are narrower or tighter together as if the padding between rows or the height of each row has been decreased. On the 320x240 device screen a full sized listview displays 16 rows versus 14. This is very useful especially so on the desktop when you want to see a lot of data at one time and when used in combination with FormEx to allow Form resizing.

I was looking at the listview properties/methods at MS web site but couldn't really gleam anything from it. I was looking for a row height/padding/margin property but no such luck. Too much Javascript/CSS I guess.

Anyway Filippo's Listview is really great for SQL. I can load 1200 records in 5-7 seconds on my Ipaq. A regular listview requires at least twice that time.
 

RichardW

Member
Licensed User
Longtime User
Side by side view of the difference in row height between Filippo's listview and the listview accessible via Agraham's libraries. These were taken from the desktop but similar effect on the device.
 

Attachments

  • sample1.JPG
    sample1.JPG
    63.9 KB · Views: 68

agraham

Expert
Licensed User
Longtime User
Side by side view of the difference in row height between Filippo's listview and the listview accessible via Agraham's libraries.
This is because my Listview is ready set up with large and small icon ImageLists ready to be populated and Filippos' Listview is not. Because of this lines in Details view in my Listview are spaced to accept 16 x16 pixel images whereas Filippos is not. As you have noticed if you put checkboxes (which servo their size to the expected image size) in Filippos Listview the line spacing will now match mine. If you invoke Listview.SetSmallImageSize(1,1) in my Listview it will closely match Filippos but checkboxes will be too small to see. If you play with the height and width values of SetSmallImageSize you can see the effect on line height and inset of the left hand column items.

However your image of my Listview puzzles me slightly. Because of the existence of the Imagelists I would have expected the left hand column items to be inset by an allowance for the images but they are not. Have you tweaked something to achieve this?

Filippo's Listview is really great for SQL.
Yes, that's what he designed it for while mine has no added functionality and just exposes the Listview control. His accesses SQLite directly to populate itself, hence the need to recompile the library for 6.80 but also hence its' performance advantage.
 

RichardW

Member
Licensed User
Longtime User
Yes I did tweak it but I didn't consider the full implications of lv1.SetSmallImageSize(1,16). I was at first just interested in removing the gap for the image width and forgot about the height. I just now set it to (1,1) and sure enough it looks like Filippo's listview.

As most of my projects do not require SQL, I like to use your dlls (.cs) with the listview so as to compile down to one EXE.

I made a version of my database program to work with the unadulterated listview to see what performance would be like. While desktop performance is ok, the device does leave something to be desired. But again how many people would want to load 1000+ records all at once. Defeats the purpose of SQLite.

Thanks again for the explanation.
 

pano

Member
Licensed User
adding mouse events to listview

Hello guys :sign0144:,

In this post Erel explain how to add mouse events to a regular table control :

http://www.b4x.com/forum/code-samples-tips/2103-table-mousedown-event-more.html

I'm trying to do the same with the listview object :
PHP:
obj.FromLibrary ("Main.lv","_LV", B4PObject(2))
evlv1.New1(obj.value,"MouseMove")
...
Sub evlv1_NewEvent
  o.Value = evlv1.Data
  x = o.GetProperty("X")
  y = o.GetProperty("Y")
  o.Value = obj.RunMethod3("HitTest",x,"System.Int32",y,"System.Int32")
  col = o.GetProperty("Column")
  ...

but when the event fire o.value = o.GetProperty("Column") generate this error :"an Object reference not set to an instance of an object."

Perhaps "HiTest" is not implemented in the listview object ? Thanks for your answers. René
 
Top