ASAPCabinetFE
 
Loading...
Searching...
No Matches
SectionRenderer Class Reference

Renderer for generic configuration sections. More...

#include <section_renderer.h>

+ Inheritance diagram for SectionRenderer:
+ Collaboration diagram for SectionRenderer:

Public Member Functions

 SectionRenderer (ConfigUI *configUI, const std::vector< std::string > &orderedKeys)
 Constructs a SectionRenderer instance.
 
void render (const std::string &sectionName, nlohmann::json &sectionData, bool &isCapturing, std::string &capturingKeyName, ImGuiFileDialog *fileDialog, bool defaultOpen=false, bool &isDialogOpen= *(new bool(false)), std::string &dialogKey= *(new std::string()))
 Renders a configuration section in the UI.
 

Additional Inherited Members

- Protected Member Functions inherited from BaseSectionRenderer
void renderBool (const std::string &key, nlohmann::json &value, const std::string &sectionName)
 
void renderFloat (const std::string &key, nlohmann::json &value, const std::string &sectionName, float minVal=0.0f, float maxVal=1.0f, const char *format="%.2f")
 
void renderInt (const std::string &key, nlohmann::json &value, const std::string &sectionName, int minVal=0, int maxVal=10000)
 
void renderString (const std::string &key, nlohmann::json &value, const std::string &sectionName)
 
void renderColor (const std::string &key, nlohmann::json &value, const std::string &sectionName)
 
void renderRotation (const std::string &key, nlohmann::json &value, const std::string &sectionName)
 
void renderKeybind (const std::string &key, nlohmann::json &value, const std::string &sectionName, bool &isCapturing, std::string &capturingKeyName)
 
void renderPathOrExecutable (const std::string &key, nlohmann::json &value, const std::string &sectionName, ImGuiFileDialog *fileDialog, bool &isDialogOpen, std::string &dialogKey)
 
int snapToStep (int value)
 

Detailed Description

Renderer for generic configuration sections.

This class implements the ISectionRenderer interface to render configuration sections with ordered keys, grouped fields, and reset-to-default functionality. It leverages BaseSectionRenderer utilities and integrates with ConfigUI for section management.

Constructor & Destructor Documentation

◆ SectionRenderer()

SectionRenderer::SectionRenderer ( ConfigUI configUI,
const std::vector< std::string > &  orderedKeys 
)
inline

Constructs a SectionRenderer instance.

Initializes the renderer with a ConfigUI instance and a vector of ordered keys.

Parameters
configUIPointer to the ConfigUI instance for section management.
orderedKeysVector of keys defining the rendering order.

Member Function Documentation

◆ render()

void SectionRenderer::render ( const std::string &  sectionName,
nlohmann::json &  sectionData,
bool &  isCapturing,
std::string &  capturingKeyName,
ImGuiFileDialog *  fileDialog,
bool  defaultOpen = false,
bool &  isDialogOpen = *(new bool(false)),
std::string &  dialogKey = *(new std::string()) 
)
virtual

Renders a configuration section in the UI.

Renders the specified section with its JSON data, handling key capture, file dialogs, grouped fields, and reset functionality.

Parameters
sectionNameThe name of the configuration section to render.
sectionDataReference to the JSON data for the section.
isCapturingReference to a flag indicating if a key is being captured.
capturingKeyNameReference to the name of the key being captured.
fileDialogPointer to the ImGuiFileDialog instance for file selection.
defaultOpenOptional flag to open the section by default (default: false).
isDialogOpenReference to a flag indicating if a file dialog is open (default: new bool(false)).
dialogKeyReference to the key associated with the open dialog (default: new std::string()).

Implements ISectionRenderer.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: