bonsai-rx / bonsai

The compiler, IDE, and standard library for the Bonsai visual programming language for reactive systems
https://bonsai-rx.org
MIT License
136 stars 28 forks source link

Display nested categories in Properties Pane #1984

Open jonnew opened 3 weeks ago

jonnew commented 3 weeks ago

The [Category] attribute can be used to group common properties of an operator in the Property Pane of the IDE:

image

However, if the property belongs to a nested class, they are ignored.

image

I'm not sure if there is a way to extend categories into nested Properties or if its even advisable since it might cause visual clutter.

PathogenDavid commented 3 weeks ago

This is unfortunately not possible with the property grid control currently used by Bonsai.

The category entries are only added by SingleSelectRootGridEntry.CategorizePropertyEntries. As the name implies, it's only used for the root of the grid. All the GridEntry stuff is internal to WinForms, so we can't manipulate it either. (Even if we could, I'm doubtful that the underlying Windows control supports nested categories.)

I also briefly investigated the possibility of injecting our own dummy properties with custom formatting to signify nested categories, but as far as I can find the WinForms property grid doesn't allow tweaking the formatting of individual properties.

This is however something that'd be trivial with Dear ImGui, but that UI migration might be a long ways off.

jonnew commented 3 weeks ago

Thanks for the response David! Yeah that makes complete sense. Not a big enough deal to spend any effort on especially if a long term goal is to replace winforms.

Thanks for looking into it and feel free to close unless you think it's useful.