#include <Malena/Graphics/Controls/Table.h>
Public Types | |
| using | Flag = TableManifest::Flag |
| using | manifest_type |
The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations. | |
| using | State = TableManifest::State |
Public Member Functions | |
| void | addColumn (const std::string &header, float width=0.f) |
| Define a column. Call before adding rows. | |
| void | addRow (const std::vector< std::string > &cells) |
| Append a data row. | |
| void | clear () |
| Remove all data rows (columns are kept). | |
| void | clearRowColor (std::size_t rowIndex) |
| Remove the colour override for a specific row. | |
| std::size_t | columnCount () const |
| sf::FloatRect | getGlobalBounds () const override |
| sf::Vector2f | getPosition () const override |
| sf::Vector2f | getSize () const |
| std::enable_if_t<!std::is_void_v< T >, T > | getState () const |
| Return the current state value. | |
| bool | isSettingsLocked () const |
Return true if applySettings() is currently blocked. | |
| std::enable_if_t<!std::is_void_v< T >, bool > | isState (T state) const |
Return true if currently in state. | |
| bool | isThemeLocked () const |
Return true if this component ignores theme changes. | |
| void | lockSettings () |
Prevent applySettings() from taking effect. | |
| void | lockTheme () |
| Prevent automatic re-styling when the global theme changes. | |
| std::enable_if_t<!std::is_void_v< T > > | onStateEnter (std::function< void(T)> callback) |
| Register a callback invoked after each state transition. | |
| std::enable_if_t<!std::is_void_v< T > > | onStateExit (std::function< void(T)> callback) |
| Register a callback invoked before each state transition. | |
| bool | removeRow (std::size_t index) |
| Remove a row by index (0 = oldest). | |
| void | reset () |
| Remove all data rows AND all column definitions. | |
| std::size_t | rowCount () const |
| void | setAltRowBgColor (const sf::Color &c) |
| void | setBorderColor (const sf::Color &c) |
| void | setDividerColor (const sf::Color &c) |
| void | setFontSize (unsigned int s) |
| void | setHeaderBgColor (const sf::Color &c) |
| void | setHeaderHeight (float h) |
| void | setHeaderTextColor (const sf::Color &c) |
| void | setMaxRows (std::size_t max) |
| Cap the number of stored rows; oldest are dropped on overflow. Pass 0 to disable the limit. | |
| void | setPadding (float p) |
| void | setPosition (const sf::Vector2f &pos) override |
| void | setRowBgColor (const sf::Color &c) |
| void | setRowColor (std::size_t rowIndex, sf::Color color) |
| Override the background colour of a specific row. | |
| void | setRowHeight (float h) |
| void | setSize (const sf::Vector2f &size) |
| std::enable_if_t<!std::is_void_v< T > > | setState (T newState) |
| Transition to a new state. | |
| void | setTextColor (const sf::Color &c) |
| Table (const sf::Font &font=FontManager<>::getDefault()) | |
| Table (const Table &)=delete | |
| void | unlockSettings () |
Allow applySettings() to take effect again. | |
| void | unlockTheme () |
| Resume reacting to global theme changes. | |
Protected Member Functions | |
| void | draw (sf::RenderTarget &target, sf::RenderStates states) const override |
| void | onThemeApplied (const Theme &theme) override |
Called by ThemeManager when the active theme changes. | |
|
inherited |
|
inherited |
The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations.
Definition at line 65 of file Customizable.h.
|
inherited |
|
inherited |
Define a column. Call before adding rows.
| header | Column header label. |
| width | Width in pixels; 0 = distribute remaining space evenly. |
|
inherited |
Append a data row.
Extra cells are ignored; missing cells are left blank. If setMaxRows() was called and the row count would exceed the limit, the oldest row is discarded first.
|
inherited |
Remove all data rows (columns are kept).
|
inherited |
Remove the colour override for a specific row.
|
inlinenodiscardinherited |
|
overrideprotectedinherited |
|
overrideinherited |
|
overrideinherited |
|
inlineinherited |
|
inherited |
Return the current state value.
StateEnum value.
|
inlinenodiscardinherited |
Return true if applySettings() is currently blocked.
Definition at line 115 of file Themeable.h.
|
inherited |
Return true if currently in state.
| state | The state value to compare against. |
true if the current state equals state.
|
inlinenodiscardinherited |
Return true if this component ignores theme changes.
Definition at line 97 of file Themeable.h.
|
inlineinherited |
Prevent applySettings() from taking effect.
Explicit individual setter calls still work normally. Only blocks the batch applySettings() path.
Definition at line 107 of file Themeable.h.
|
inlineinherited |
Prevent automatic re-styling when the global theme changes.
The component keeps its current visual state. Explicit individual setter calls still work normally.
Definition at line 85 of file Themeable.h.
|
inherited |
Register a callback invoked after each state transition.
The callback receives the newly entered state. Only one enter callback is active at a time; calling this again replaces it.
| callback | Function called with the new state after each transition. |
|
inherited |
Register a callback invoked before each state transition.
The callback receives the state being left. Only one exit callback is active at a time; calling this again replaces it.
| callback | Function called with the old state before each transition. |
|
overrideprotectedvirtualinherited |
Called by ThemeManager when the active theme changes.
Override in your component to re-style from the new theme. Always check isThemeLocked() first:
| theme | The newly active theme. |
Implements ml::Themeable.
|
inherited |
Remove a row by index (0 = oldest).
|
inherited |
Remove all data rows AND all column definitions.
|
inlinenodiscardinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
Cap the number of stored rows; oldest are dropped on overflow. Pass 0 to disable the limit.
|
overrideinherited |
|
inlineinherited |
|
inherited |
Override the background colour of a specific row.
The override persists until clearRowColor() or clear() is called. Indices shift automatically when rows are inserted or removed.
| rowIndex | 0-based index of the row to highlight. |
| color | Background colour to use instead of the default. |
|
inlineinherited |
|
inherited |
Transition to a new state.
Fires the exit callback with the current state, updates the stored state to newState, then fires the enter callback with the new state. Either callback may be unset (nullptr), in which case it is skipped.
| newState | The state to transition into. |
|
inlineinherited |
|
explicit |
|
delete |
|
inlineinherited |
Allow applySettings() to take effect again.
Definition at line 112 of file Themeable.h.
|
inlineinherited |
Resume reacting to global theme changes.
Does NOT immediately re-apply the current theme — call ThemeManager::get() and pass it to onThemeApplied() manually if you want to re-sync immediately after unlocking.
Definition at line 94 of file Themeable.h.