#include <MainTable.h>
Classes | |
struct | Table |
struct | TableColumn |
struct | TableColumnSettings |
struct | TableSettings |
Public Types | |
typedef std::bitset< MaxColumnCount > | ColumnBitMask |
Public Member Functions | |
MainTable (const std::vector< MainTableColumn > &pColumns, MainWindow *pMainWindow, MainTableFlags pFlags=0) | |
virtual | ~MainTable ()=default |
MainTable (const MainTable &pOther)=delete | |
MainTable (MainTable &&pOther) noexcept=delete | |
MainTable & | operator= (const MainTable &pOther)=delete |
MainTable & | operator= (MainTable &&pOther) noexcept=delete |
void | Draw () |
void | DrawColumnSetupMenu () |
void | RequestSort () |
void | SetSpecificColumnSetup (const std::vector< size_t > &pNewColumns) |
void | ResetSpecificColumnSetup () |
bool | GetSpecificColumnsActive () const |
Static Public Member Functions | |
static size_t | GetMaxColumnCount () |
Protected Member Functions | |
virtual void | DrawRows (TableColumnIdx pFirstColumnIndex)=0 |
virtual void | Sort (const ImGuiTableColumnSortSpecs *mColumnSortSpecs)=0 |
virtual void | DrawStyleSubMenu () |
virtual void | DrawColumnSetupSubMenu () |
virtual Alignment & | getAlignment ()=0 |
virtual Alignment & | getHeaderAlignment ()=0 |
virtual bool | getShowScrollbar () |
virtual std::string | getTableId ()=0 |
virtual bool | getMaxHeightActive () |
virtual int & | getMaxDisplayed ()=0 |
virtual bool & | getShowAlternatingBackground ()=0 |
virtual TableSettings & | getTableSettings ()=0 |
virtual bool & | getHighlightHoveredRows ()=0 |
virtual bool & | getShowHeaderAsText ()=0 |
virtual bool | getCustomColumnsFeatureActive () |
virtual bool & | getCustomColumnsActive () |
virtual int | getCustomColumnsFirstColumn () |
virtual void | MigrateSettings () |
virtual const char * | getCategoryName (const std::string &pCat)=0 |
void | NextRow (ImGuiTableRowFlags row_flags=0, float min_row_height=0.0f) |
bool | NextColumn () |
void | EndMaxHeightRow () |
ImGuiTableSortSpecs * | GetSortSpecs () |
void | SetupColumn (const char *label, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_id) |
void | ColumnHeader (const char *label, bool show_label, ImTextureID texture, Alignment alignment, const char *popupText) |
void | AlignedTextColumn (const char *text) |
void | AlignedTextColumn (const std::string &text) |
template<typename... Args> requires SmallerThanMaxColumnAmount<MaxColumnCount> | |
void | AlignedTextColumn (std::string_view format, Args &&... args) |
bool | SpinnerAligned (const char *label, float radius, float thickness, const ImU32 &color) |
void | ApplySpecificColumnSetup () |
bool | Begin (const char *str_id, int columns_count, ImGuiTableFlags flags, const ImVec2 &outer_size, float inner_width, ImGuiWindowFlags child_window_flags) |
void | End () |
void | MenuItemColumnVisibility (int TableColumnIdx) |
const char * | GetColumnName (int column_n) |
void | SetupScrollFreeze (int columns, int rows) |
ImRect | GetCellBgRect (int column_n) |
bool | IsCurrentColumnHovered () |
bool | IsCurrentRowHovered () |
int | GetColumnIndex () |
Protected Attributes | |
Table | mTable |
This class also contains the whole ImGui implementation of a table! It is a copy of the Table implementation of ImGui.
The template is used to define the max size of the table. This is needed cause the ImGui table was changed to use std::bitset
How to use:
pColumns
in the constructor is saved as reference in this class, the calling object has to be valid the whole lifetime of this class!Draw()
in DrawContent()
DrawColumnSetupMenu()
in DrawContextMenu()
if you want to hide your columns.MigrateSettings
when you made changes to the table, that need the settings to be migrated. NEVER migrate within the Settings object itself, cause that would be too early.Hoe do settings work:
Settings are still similar to how ImGui has designed them to be. The biggest difference is that columns are now saved based on the UserID instead of the index. The uniqueness of that ID has to be handled by the caller. When Migrating settings, delete what you removed, when adding new elements, only migrate the (still indexbased) DisplayOrder. When removing elements, only migrate the DisplayOrder as well. That is not all, there are some weird byproducts with the TableFlags and the SavedFlags.
!!! TEST THE SETTINGS MIGRATION REALLY WELL, IT IS SOMETIMES UNPREDICTABLE !!!
typedef std::bitset<MaxColumnCount> ArcdpsExtension::MainTable< MaxColumnCount >::ColumnBitMask |
ArcdpsExtension::MainTable< MaxColumnCount >::MainTable | ( | const std::vector< MainTableColumn > & | pColumns, |
MainWindow * | pMainWindow, | ||
MainTableFlags | pFlags = 0 |
||
) |
|
virtualdefault |
|
delete |
|
deletenoexcept |
|
protected |
Print text aligned to the current column. Use so text is aligned within the table. Alternatively use ImGui::Text()
directly.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
void ArcdpsExtension::MainTable< MaxColumnCount >::Draw | ( | ) |
HEADER
SORTING
CONTENT
void ArcdpsExtension::MainTable< MaxColumnCount >::DrawColumnSetupMenu | ( | ) |
|
protectedvirtual |
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
protectedvirtual |
|
protected |
|
protected |
Call this at the end of each Row. This is used to calculate max-heights. Only call it on rows, you want to add to the max displayed amount. (e.g. killproof.me plugin doesn't add linked account rows)
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
protectedpure virtual |
Get the name of each column category. Categories are defined in MainTableColumn
.
Implemented in ArcdpsExtension::DemoTable.
|
protected |
|
protected |
|
protected |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Set this to true if you want to use the feature "custom columns". Set a custom column setup with SetSpecificColumnSetup
. If you want to go back to normal columns call ResetSpecificColumnSetup
. While custom columns are active the settings saving is disabled.
|
inlineprotectedvirtual |
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
inlinestatic |
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
inlineprotectedvirtual |
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
inlineprotectedvirtual |
|
protected |
|
inline |
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
protected |
Check if the current table column is hovered.
|
protected |
Check if the current table row is hovered.
|
protected |
|
inlineprotectedvirtual |
Called when the migration of this TableSetting should be done.
Also migrate the settings when you ADD new columns, else they have the absolute default values (which will show them)
|
protected |
Set the next column, will call ImGui::TableNextColumn
|
protected |
Set the next Row, will call ImGui::TableNextRow
|
delete |
|
deletenoexcept |
|
inline |
void ArcdpsExtension::MainTable< MaxColumnCount >::ResetSpecificColumnSetup | ( | ) |
void ArcdpsExtension::MainTable< MaxColumnCount >::SetSpecificColumnSetup | ( | const std::vector< size_t > & | pNewColumns | ) |
|
protected |
|
protected |
|
protectedpure virtual |
Implemented in ArcdpsExtension::DemoTable.
|
protected |
Aligned Spinner
|
protected |