Skip to content

New Tables API (alpha available for testing) #2957

Closed
@ocornut

Description

@ocornut

TABLES ARE NOW MERGED, MOVING THIS TO #3740

I have pushed an experimental tables branch:
https://github.com/ocornut/imgui/tree/tables
Providing a long awaited full-featured replacement to the old "Columns" API (#125).

I have been working on this for an embarassingly looong time.. What seemingly started as "let's refactor columns" became a multi-month thing with many rewrites/iterations. A large portion of this work been sponsored by Blizzard Entertainment. Several internal changes pushed to 1.71-1.74 were in preparation for this as I often try to have changes trickle down to master whenever possible to reduce complication of branching.

Please read <3
(this post will be occasionally updated)

Basic Usage:
#2957 (comment)

TODO List:
#2957 (comment)

WIP API breaking changes Sept 2020
#2957 (comment)

Question? Feedback? Bug report? Feature request? Please create a NEW ISSUE!

Status

  • Dec 2019: made branch public.
  • (EDIT) Oct 2020: planned for merging in 1.80 (next release). feedback welcome!
  • It is fairly functional but I am sure you will find issues. It can be used in many scenarios down to simple N-way columning without borders.
  • Next post include a TODO list.
  • I'm hoping that this ideally can be in master in 2-3 months (edit: HAHAHA). But that will depends on feedback, how many issues we find and how many we can fix etc.
  • The Columns() api will be marked "obsolete" when this gets merged, it will probably be kept as-is for a few years but we will encourage everyone to use Tables (not harder to use!).

Looking for early testers

  • Looking for early adopters to experiment with this and provide feedback. When I am confident enough that the API can become stable we will merge the feature in Master.
  • Please create New Issues instead of answering in this thread.
  • Some of the API will evolve in the upcoming few months. I would advise using this if you are confortable with following on some API changes (they will be posted here).
  • There are lots of known issues (see post below), but your feedback will help me prioritize them and will probably expand the feature set.
  • When you provide feedback please make it detailed, specify which flags you are using, provide shots, repros, etc. As with many other features, lots of things here are surprisingly more subtle and complex than you'd expect, magic under the hood, and many flags have subtle side-effects, etc. please don't make me guess.
  • If you use this branch I would appreciate if you tried to update regularly or semi-regularly so you can provide feedback and help detect regression.

Git Flow

  • Branch is tables (https://github.com/ocornut/imgui/tree/tables).
  • The branch will merge into docking/viewports without conflict.
  • The branch is based off master. I am expecting to merge this into master before the docking/viewports features.
  • I will rebase/push-force this branch over master in the course of the next few weeks/months.

Features

  • Scrolling on both axises
  • Possibility to freeze/lock rows or columns so they are always visible with scrolling
  • Headers (which can be customized)
  • Cells can contains anything (you can output multiple widgets, etc.) it's a regular canvas for your contents.
  • Stretching (weighted) or static size columns
  • Columns can be reordered
  • Columns can be hidden
  • Columns can be resized
  • Columns can be sorted (actual data sorting is done by user, api gives you the sort specs/infos you need)
  • Various bordering and padding options
  • Per-Columns flags (e.g. honor indent)
  • Borders and odd/even row background colors options
  • Clipper can be used on vertical axis (per column clipping possible as visibility is provided to user)
  • Saved settings (storage is font/dpi change friendly)
  • Context menu (should be customizable later)

Some screenshots

image

image

image

image

image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions