MyGrid UI Component

Hi All

This is a UI component that we need and thought we can share with you, hope it’ll be useful.
Comments and feedback are welcome.

Main Functionalities:

  • Variable Number of Row and Column Headers
  • Hide/Unhide Row or Column: Toggle the visibility of rows or columns.
  • Freeze/Unfreeze Focused Cell: Use the contextual menu to freeze or unfreeze the focus cell.
  • Move Focus Cell: Navigate between cells.
  • Resize Row or Column
  • Block Selection: Select multiple cells using Shift + Arrow keys, or using left click
  • Select Entire Row or Column: Select an entire row or column with Ctrl + Shift + Arrow keys.
  • Customization Options: Customize background and foreground colors, fonts, alignments, and more.
  • Cell Types: Support for two cell types—Text and Checkbox.

How to Use MyGrid in Your Xojo Project:

  1. Copy the MyGrid.xojo_window file to your project directory.
  2. Import the copied file into your Xojo project.
  3. Drag the MyGrid component onto your window to start using it.

Additional Information:

  • MyGrid has been ported from another language to Xojo with the original author’s permission.
  • Licensed under the MIT License.

I’ve also included a file with MyGrid and a demo project to help you get started.
https://drive.google.com/drive/folders/1vNcvs6k6OeNgllSGk9C–GgVK8U7Cnvu?usp=sharing

9 Likes

Hi,
I compiled on Mac Sonoma 14.5. Crash when clicking on cell or on "Show sample grid’. Can send you crash report if you want.

You may want to read this:

Xojo Roadmap. Of course, there is no date of release.

even if xojo releases one day something similar, I really prefer to have an open source alternative I can modify if I need !
in fact I would really like xojo to release the framework open source, all the bugs and non working parts could have been corrected by the community long ago …

I once ago used a nice dev tool called Prograph, that worked this way. all the framework was open source, and you could also change many parts of the IDE. has been rewritten under the name “Marteen” and is no more updated but should still work under non silicon proc.

2 Likes

Yup. Makes a hard crash for the sample grid on Sequoia, too:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x19cfae600 __pthread_kill + 8
1 libsystem_pthread.dylib 0x19cfe6f70 pthread_kill + 288
2 libsystem_c.dylib 0x19cef3908 abort + 128
3 libswiftCore.dylib 0x1adfc0484 swift::fatalErrorv(unsigned int, char const*, char*) + 136
4 libswiftCore.dylib 0x1adfc04a4 swift::fatalError(unsigned int, char const*, …) + 32
5 libswiftCore.dylib 0x1adfc0ad8 swift::runtime::AccessSet::insert(swift::runtime::Access*, void*, void*, swift::ExclusivityFlags) + 540
6 libswiftCore.dylib 0x1adfc0b2c swift_beginAccess + 84
7 AppKit 0x1a1075e9c 0x1a0bd5000 + 4853404
8 AppKit 0x1a1076208 0x1a0bd5000 + 4854280
9 AppKit 0x1a13727a8 -[NSViewBackingLayer display] + 820
10 AppKit 0x1a16a68a8 __25-[NSView displayIfNeeded]_block_invoke + 184
11 AppKit 0x1a0c516f0 NSPerformVisuallyAtomicChange + 108
12 AppKit 0x1a0cb6778 -[NSView displayIfNeeded] + 192
13 My Application.debug 0x10082bf0c DesktopWindow.Refresh%%ob + 96
14 My Application.debug 0x1008d45d8 MyGrid.MyGrid.ColScroll_ValueChanged%%o<MyGrid.MyGrid>o + 396 (/MyGrid:59)
15 My Application.debug 0x1009380ec Delegate.IM_Invoke%%o + 60
16 My Application.debug 0x100938138 AddHandler.Stub.20%% + 56
17 XojoFramework 0x1018dabb0 RuntimeScrollerRouter::ScrollerValueChanged(Scroller*, long, long) + 96
18 XojoFramework 0x10172402c CocoaScroller::SetMinimum(long) + 32
19 XojoFramework 0x1018db0dc scrollerPropSetter + 76
20 My Application.debug 0x100817c24 DesktopScrollbar.MinimumValue.Set%%oi4i8 + 48
21 My Application.debug 0x1008d9268 MyGrid.MyGrid.AdjustScrolls%%o<MyGrid.MyGrid> + 1116 (/MyGrid:247)
22 My Application.debug 0x100906fec MyGrid.MyGrid.i_Draw%%o<MyGrid.MyGrid>ob + 9288 (/MyGrid:1464)
23 My Application.debug 0x100912178 MyGrid.MyGrid.ManagePaint%%o<MyGrid.MyGrid>o + 5548 (/MyGrid:1858)
24 My Application.debug 0x1008d5c70 MyGrid.MyGrid.Event_Paint%%o<MyGrid.MyGrid>oA1o<Xojo.Rect> + 256 (/MyGrid:123)
25 My Application.debug 0x100835ea0 EmbeddedContainer.Event_Paint%%ooA1o<Xojo.Rect> + 16
26 XojoFramework 0x1017d0c64 RuntimeCanvas::Redraw(Graphics*, std::__1::vector<xojo::Rectxojo::Points, std::__1::allocator<xojo::Rectxojo::Points>> const&) + 1124
27 XojoFramework 0x10175f650 0x101664000 + 1029712
28 AppKit 0x1a0d240c8 _NSViewDrawRect + 160
29 AppKit 0x1a16ad5a8 -[NSView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:] + 1084
30 AppKit 0x1a0d23abc -[NSView(NSLayerKitGlue) _drawViewBackingLayer:inContext:drawingHandler:] + 536
31 AppKit 0x1a1372d40 -[NSViewBackingLayer drawInContext:] + 56

the crash arrives at the first

me.ColScroll.MinimumValue = me.FrstTopCol

in the AdjustScrolls method of the grid…

1 Like

Hi
@Jean-Yves_Pochez , @Beatrix_Willius , @Alexander_van_der_Linden
this component is only tested on windows for now , we will develop a mac version soon … inshalla :smile:

replaced all the occurences of Refresh(true)
with Refresh //(true)
and the project now works fine on macos …

edit: don’t know why but it works !

1 Like

Any chance of releasing it on github so we can open issues and send push requests?

3 Likes

"Happy to hear that! :sweat_smile: That’s quite unexpected!

Sure! Here’s the GitHub link: GitHub - Jana373/MyGrid: UI component for Xojo

2 Likes

That’s why i made XojoEZUnit! XojoUnit was even open source but i wanted different ways of using it and an easier setup, Open source is great!

1 Like

Hi, https://github.com/Jana373/MyGrid is no longer available!

1 Like