Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchical table view #2683

Closed
LPeter1997 opened this issue May 29, 2023 · 2 comments
Closed

Hierarchical table view #2683

LPeter1997 opened this issue May 29, 2023 · 2 comments

Comments

@LPeter1997
Copy link

LPeter1997 commented May 29, 2023

This is more of a suggestion request, as I don't think this control would be general enough that too many applications could benefit from it. Feel free to close it, if it's not something you want to deal with in this library directly, which is understandable.

My problem arose, when I wanted to visualize local values in our debugger. In something like VS, this is solved by a table view, where names are in the first column and values are in the second. If a value is compound (like an instance), the row becomes expandable, and subelements are shown as table rows indented. Example:
image

A table view is not enough here, as if I understood from #1285, I can't just embed a tree-view in the second column or something. A tree-view feels very noisy, and values are hard to align after the field names. It's also harder to read, because there's no visual hint about separating names and values anymore.

Could table view be extended somehow to support this? If so, what would it involve? I'd imagine it would have to be a pretty hefty change, considering it builds on DataTable.

@tznind
Copy link
Collaborator

tznind commented May 29, 2023

Could table view be extended somehow to support this? If so, what would it involve? I'd imagine it would have to be a pretty hefty change, considering it builds on DataTable.

In v2 the DataTable layer has been abstracted away and there is a new ITableSource which might be able to support this kind of thing.

I can have a think about it

@tznind
Copy link
Collaborator

tznind commented May 29, 2023

Ok I think this approach might work.

#2685

  • We have one or more TreeView but we don't actually mount them to a view.
  • We route events to the TreeView so it can expand / change selections
  • We implement drawing using users func delegates

TODO:
Need to make the first column use the TreeView actual draw so it gets branch lines etc

Its sort of working but would need a lot of polish

tableOfTrees

tig added a commit that referenced this issue Jul 5, 2023
* WIP: Add TreeTableSource

* Improve expand/collapse

* Render branch/tree properly

* Simplify TreeTableSource to only allow one TreeView

* Add TestTreeTableSource_BasicExpanding test

* Add test combining checkbox and tree together

* Move tree example into main TableEditor scenario
(deleting TreeTableExample.cs)

* Mouse support for expanding/collapsing branches

* Make TreeTableSource work with CheckBoxTableSourceWrapperByObject<T>

* Add tests for mouse expand/collapse

* Improve quality of TableEditor scenario

* Fix mouse expanding not refreshing screen

* Fixed null reference when clicking in header lines

* Add null checks to scenario now it can show trees as well as data tables

* Switch to underscore prefix on private members

* Remove accidentally committed file

* Add setup/teardown to explicitly set driver checked/unchecked glyphs

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
@tig tig closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants