Table.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #include "imguiWrapperTypes.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. IggBool iggBeginTable(const char *str_id, int column, int flags,
  7. IggVec2 const *outer_size, float inner_width);
  8. void iggEndTable(); // only call EndTable() if BeginTable() returns true!
  9. void iggTableNextRow(
  10. int row_flags,
  11. float min_row_height); // append into the first cell of a new row.
  12. IggBool iggTableNextColumn(); // append into the next column (or first column of
  13. // next row if currently in last column). Return
  14. // true when column is visible.
  15. IggBool
  16. iggTableSetColumnIndex(int column_n); // append into the specified column.
  17. // Return true when column is visible.
  18. void iggTableSetupColumn(const char *label, int flags,
  19. float init_width_or_weight, unsigned int user_id);
  20. void iggTableSetupScrollFreeze(
  21. int cols,
  22. int rows); // lock columns/rows so they stay visible when scrolled.
  23. void iggTableHeadersRow(); // submit all headers cells based on data provided to
  24. // TableSetupColumn() + submit context menu
  25. void iggTableHeader(
  26. const char *label); // submit one header cell manually (rarely used)
  27. typedef void *IggImGuiTableSortSpecs;
  28. IggImGuiTableSortSpecs *iggTableGetSortSpecs(); // get latest sort specs for the
  29. // table (NULL if not sorting).
  30. int iggTableGetColumnCount(); // return number of columns (value passed to
  31. // BeginTable)
  32. int iggTableGetColumnIndex(); // return current column index.
  33. int iggTableGetRowIndex(); // return current row index.
  34. const char *iggTableGetColumnName(
  35. int column_n); // return "" if column didn't have a name declared by
  36. // TableSetupColumn(). Pass -1 to use current column.
  37. void iggTableSetBgColor(
  38. int target, unsigned int color,
  39. int column_n); // change the color of a cell, row, or column. See
  40. // ImGuiTableBgTarget_ flags for details.
  41. int iggTableGetColumnFlags(
  42. int column_n); // return column flags so you can query their
  43. // Enabled/Visible/Sorted/Hovered status flags. Pass -1 to
  44. // use current column.
  45. #ifdef __cplusplus
  46. }
  47. #endif