Hi,
I wanted to see if anyone would be interested in trying my DataGrid. I started off working on a tutorial for piDogScrollingCanvas, and after a few hours, I ended up with this
This is a display-only version… no clicking/dragging/cell editing yet.
I’m trying to keep things as compatible with the built-in Listbox control api’s as possible… rowtag, celltag etc.
( columnWidths uses the same syntax -100,20%,,2 etc. tab out of the columnwidths field to see changes )
Note that adding 100k rows takes a few seconds, it has not crashed. :x
Please post back with OS and fps@100k rows,10 columns if you don’t mind!
To Do:
Add cell/row selection
Add cellEdit
Add copy/paste (tab or comma delimited data)
Drag selection to select a subgrid of cells
CellCheck
CellBackgroundPaint
CellTextPaint
more
If there are specific features anyone would like to request, now is the best time to do it!
I plan on including this in the piDogScrollingCanvas Class for registered users.
Windows 8.1 AMD Phenom 1090T 3.2 Ghz 8 GB
Screen 1920 * 1080
120,000 rows of 10 columns
15 fps (very simple old videocard)
12 fps while scrolling
Column 4 disappears when making window smaller
Screen not properly refreshed sometimes
Adding rows is not as fast as the original Xojo listbox
Selecting a range doesn’t work yet
Looks very nice, especially the zoom function works great!
I’ve been working on this again. I’ve added quite a bit, including column align, rowpicture, RETINA!, checkbox column and cell types, checkall header option. Please take a look. pidog_Datagrid_Demo.zip
It also includes some keyboard navigation and stuff.
To-do includes:
column resizing
drag and drop
hierarchical (likely implemented differently than Xojo’s listbox)
I’ve tried to keep everything as compatible as possible with the built-in listbox, goal being a 90% or better drop-in replacement.
[quote=130919:@Richard Duke]I did encounter a crash when i add row x 1000000 and then trying to click on ‘row pictures’ and it just crash after the spinning for a little while
[/quote]
Yes, the thing with the rowpictures checkbox, is that a unique picture is created for each row. I wouldn’t expect a real-world app to use rowpictures with 1000000 rows, or it would use a set of images and assign each row a picture based on some state or value. I’m pretty sure that just creating a million pictures is the cause of the crash.
Yep, in debug I get an OutOfMemoryException around 260,000 pictures… when I resume, I get a crash, presumably because the app cannot allocate memory for the error message… I’ll update the demo to use a limited number of pictures.
[quote=130949:@Beatrix Willius]Cool! Looks nice. On Mac OS 10.8 I don’t have vertical or horizontal scrollbars. But the listbox scrolls vertically.
[/quote]
I’ll have to look into this… there should be scrollbars.
[quote=130949:@Beatrix Willius]Cool! Looks nice. On Mac OS 10.8 I don’t have vertical or horizontal scrollbars. But the listbox scrolls vertically.
And yes, the row pictures crash the app:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.CoreGraphics 0x90b5ac2b x_malloc + 22
[/quote]
Yeah that looks like an out of memory crash when it dies in a malloc
Yes, I had nilObjectChecking turned off in that method…
I’ve improved the rowpicture handling and done some internal optimizations (especially accuracy and efficiency with many columns) and a few bugs fixed. Also added column resizing.
[quote=130949:@Beatrix Willius]Cool! Looks nice. On Mac OS 10.8 I don’t have vertical or horizontal scrollbars. But the listbox scrolls vertically.
[/quote]
I haven’t been able to reproduce this…