DataGrid Demo- Looking for feedback

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…

DataGrid Demo

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.

Thanks for looking!

OSX 10.9.3 MacBook Air

45 - 55 fps fullscreen

OS X 10.9.3 MacBook Air 1.3 Ghz i5

59fps

If I ever get sitting down in my office, I can check on my 2013 27" iMac.

140 fps @ 100k Rows…
200 - 350 fps @ 10k Rows

MBP 10.9.2
2.3 GHz Intel Core i7 16GB 1600 MHz DDR3

192 fps @ 10K Rows
142 fps @ 100K Rows

MBP 10.9.3
2.3 Ghz Intel Core i7 8GB 1600 MHz DDR3

You guys are just mocking our little MacBook Airs.

Its our MBP “Central NC Editions” :slight_smile:

OS X 10.9.3
MacMini Mid 2010 2.66 Core2Duo, 4GB

cols: 100,100,100,100,100,100,100,100,100,100
19FPS after adding 100k
463FPS after adding another 100k?

19 to 20 FPS scrolling through 200k rows.

[quote=93774:@Tim Parnell]463FPS after adding another 100k?

[/quote]
What you’re probably seeing there is the scrollers fading out, where only a small portion of the control is being updated.

MacPro 3.7G Xeon E5
OS X 10.9.3

100k rows
10 columns

1431 fps non scrolling :slight_smile:
Window sized to fit the 10 columns - while scrolling 95 - 103 fps
Window full screen (27") - while scrolling 23 fps

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.

i have Mac OSX 10.9.5 on iMac 27". I think this data grid is pretty cool where you have the ability to zoom.

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

Cool! Looks nice. On Mac OS 10.8 I don’t have vertical or horizontal scrollbars. But the listbox scrolls vertically.

I wants te codes, pleeze.

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
1 com.apple.CoreGraphics 0x90bca8ed resample_band_data + 196
2 com.apple.CoreGraphics 0x90bc9ba8 img_interpolate_stage + 424
3 com.apple.CoreGraphics 0x90b85592 img_data_lock + 4038
4 com.apple.CoreGraphics 0x90b83913 CGSImageDataLock + 170
5 libRIP.A.dylib 0x92ba738e ripc_AcquireImage + 2236
6 libRIP.A.dylib 0x92ba5e3c ripc_DrawImage + 936
7 com.apple.CoreGraphics 0x90b834e9 CGContextDrawImage + 427
8 com.apple.AppKit 0x9805f9f9 __74-[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:]block_invoke_0 + 1250
9 com.apple.AppKit 0x9805f460 NSUsingGraphicsStateForHints_drawWithBlock
+ 67
10 com.apple.AppKit 0x9805f2c2 -[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:] + 893
11 com.apple.AppKit 0x98077690 __71-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]_block_invoke_0 + 1252
12 com.apple.AppKit 0x9805d7e8 -[NSImage _usingBestRepresentationForRect:context:hints:body:] + 167
13 com.apple.AppKit 0x98077110 -[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:] + 1366
14 com.apple.AppKit 0x9805d00e -[NSImage _drawMappingAlignmentRectToRect:withState:backgroundStyle:operation:fraction:flip:hints:] + 738
15 com.apple.AppKit 0x9811cf52 -[NSImageCell _drawImageWithFrame:inView:] + 256
16 com.apple.AppKit 0x9811c9c4 -[NSImageCell drawInteriorWithFrame:inView:] + 706
17 com.apple.AppKit 0x9811c2e9 -[NSImageCell drawWithFrame:inView:] + 109
18 com.apple.AppKit 0x98056e53 -[NSControl drawRect:] + 379
19 com.apple.AppKit 0x9804a25e -[NSView _drawRect:clip:] + 3492
20 com.apple.AppKit 0x98048c74 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1316
21 com.apple.AppKit 0x98048faa -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2138
22 com.apple.AppKit 0x98048faa -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2138
23 com.apple.AppKit 0x98048572 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5445
24 com.apple.AppKit 0x98046e1f -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 290
25 com.apple.AppKit 0x98042b83 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 4425
26 com.apple.AppKit 0x9800b381 -[NSView displayIfNeeded] + 1468
27 com.apple.AppKit 0x9800ad3d -[NSWindow displayIfNeeded] + 306
28 com.apple.AppKit 0x980c3619 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 1367
29 com.apple.AppKit 0x980c30b6 -[NSWindow _doOrderWindowWithoutAnimation:relativeTo:findKey:forCounter:force:isModal:] + 79
30 com.apple.AppKit 0x980c29bd -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 524
31 com.apple.AppKit 0x97ef476a -[NSApplication _orderFrontModalWindow:relativeToWindow:] + 812
32 com.apple.AppKit 0x97ef3ea1 -[NSApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:] + 844
33 com.apple.AppKit 0x9825aa7d -[NSApplication beginModalSessionForWindow:] + 72
34 com.apple.AppKit 0x9825a4d3 -[NSApplication runModalForWindow:] + 132
35 com.apple.AppKit 0x9824b9f6 -[NSAlert runModal] + 212
36 com.xojo.XojoFramework 0x0030f932 0x2ff000 + 67890
37 com.xojo.XojoFramework 0x003b70d9 0x2ff000 + 753881
38 com.xojo.XojoFramework 0x00418d7f UnhandledException + 767
39 com.pidog.myapp 0x0007aa8b Application._CallFunctionWithExceptionHandling%%op + 562
40 com.xojo.XojoFramework 0x00419911 0x2ff000 + 1157393
41 com.xojo.XojoFramework 0x00326675 0x2ff000 + 161397
42 com.apple.AppKit 0x97ffd62c -[NSApplication run] + 951
43 com.xojo.XojoFramework 0x00419997 0x2ff000 + 1157527
44 com.xojo.XojoFramework 0x00418021 RuntimeRun + 49
45 com.pidog.myapp 0x001315f0 REALbasic._RuntimeRun + 34
46 com.pidog.myapp 0x00003048 _Main + 257
47 com.pidog.myapp 0x00002594 % main + 36
48 com.pidog.myapp 0x00284db9 _start + 116
49 com.pidog.myapp 0x00284d0f start + 43

[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.

or only create image if test data is around 1000 record. it work ok when i try that

Very nice! Works with Windows 8.1 x64, more or less.

I wasn’t able to use the option RowPictures

There are some issues with some controls UI. Vertical and Horizontal Scroll controls seems to live their own lives.

In the Option Window Align and Type and ColumnCheckAll.

Should it exist a column for rownumbers?.

[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.

pidog_Datagrid_Demo.zip

[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…

You can keep just a reference to the original Picture, that’s what the built in Listbox does.