|
MetaImGUI 1.0.0
ImGui Application Template for C++20
|
Manager for common UI dialogs. More...
#include <DialogManager.h>
Classes | |
| struct | Impl |
Public Member Functions | |
| DialogManager () | |
| ~DialogManager () | |
| DialogManager (const DialogManager &)=delete | |
| DialogManager & | operator= (const DialogManager &)=delete |
| DialogManager (DialogManager &&)=delete | |
| DialogManager & | operator= (DialogManager &&)=delete |
| void | Render () |
| Render all active dialogs Call this each frame in your main render loop. | |
| void | ShowMessageBox (const std::string &title, const std::string &message, MessageBoxButtons buttons=MessageBoxButtons::OK, MessageBoxIcon icon=MessageBoxIcon::Info, std::function< void(MessageBoxResult)> callback=nullptr) |
| Show a message box. | |
| void | ShowInputDialog (const std::string &title, const std::string &prompt, const std::string &defaultValue="", std::function< void(const std::string &)> callback=nullptr) |
| Show an input dialog. | |
| int | ShowProgressDialog (const std::string &title, const std::string &message="") |
| Show a progress dialog. | |
| void | UpdateProgress (int dialogId, float progress, const std::string &message="") |
| Update progress dialog. | |
| void | CloseProgress (int dialogId) |
| Close progress dialog. | |
| void | ShowListDialog (const std::string &title, const std::vector< std::string > &items, std::function< void(int)> callback=nullptr) |
| Show a list selection dialog. | |
| void | ShowConfirmation (const std::string &title, const std::string &message, std::function< void(bool)> callback=nullptr) |
| Show a confirmation dialog (Yes/No) | |
| bool | HasOpenDialog () const |
| Check if any dialog is currently open. | |
| void | CloseAll () |
| Close all dialogs. | |
Manager for common UI dialogs.
DialogManager provides reusable dialog components including message boxes, input dialogs, and progress dialogs.
Definition at line 60 of file DialogManager.h.
| MetaImGUI::DialogManager::DialogManager | ( | ) |
Definition at line 74 of file DialogManager.cpp.
|
default |
|
delete |
|
delete |
| void MetaImGUI::DialogManager::CloseAll | ( | ) |
Close all dialogs.
Definition at line 173 of file DialogManager.cpp.
| void MetaImGUI::DialogManager::CloseProgress | ( | int | dialogId | ) |
Close progress dialog.
| dialogId | Dialog ID from ShowProgressDialog |
Definition at line 144 of file DialogManager.cpp.
| bool MetaImGUI::DialogManager::HasOpenDialog | ( | ) | const |
Check if any dialog is currently open.
Definition at line 168 of file DialogManager.cpp.
|
delete |
|
delete |
| void MetaImGUI::DialogManager::Render | ( | ) |
Render all active dialogs Call this each frame in your main render loop.
Definition at line 78 of file DialogManager.cpp.
| void MetaImGUI::DialogManager::ShowConfirmation | ( | const std::string & | title, |
| const std::string & | message, | ||
| std::function< void(bool)> | callback = nullptr |
||
| ) |
Show a confirmation dialog (Yes/No)
| title | Dialog title |
| message | Confirmation message |
| callback | Function called with true if Yes, false if No |
Definition at line 158 of file DialogManager.cpp.
References MetaImGUI::Question, ShowMessageBox(), MetaImGUI::Yes, and MetaImGUI::YesNo.
| void MetaImGUI::DialogManager::ShowInputDialog | ( | const std::string & | title, |
| const std::string & | prompt, | ||
| const std::string & | defaultValue = "", |
||
| std::function< void(const std::string &)> | callback = nullptr |
||
| ) |
Show an input dialog.
| title | Dialog title |
| prompt | Prompt text |
| defaultValue | Default input value |
| callback | Function called with input result (empty if cancelled) |
Definition at line 107 of file DialogManager.cpp.
| void MetaImGUI::DialogManager::ShowListDialog | ( | const std::string & | title, |
| const std::vector< std::string > & | items, | ||
| std::function< void(int)> | callback = nullptr |
||
| ) |
Show a list selection dialog.
| title | Dialog title |
| items | List of items to choose from |
| callback | Function called with selected index (-1 if cancelled) |
Definition at line 148 of file DialogManager.cpp.
| void MetaImGUI::DialogManager::ShowMessageBox | ( | const std::string & | title, |
| const std::string & | message, | ||
| MessageBoxButtons | buttons = MessageBoxButtons::OK, |
||
| MessageBoxIcon | icon = MessageBoxIcon::Info, |
||
| std::function< void(MessageBoxResult)> | callback = nullptr |
||
| ) |
Show a message box.
| title | Dialog title |
| message | Message text |
| buttons | Button configuration |
| icon | Icon type |
| callback | Function called with result (async) |
Definition at line 96 of file DialogManager.cpp.
Referenced by ShowConfirmation().
| int MetaImGUI::DialogManager::ShowProgressDialog | ( | const std::string & | title, |
| const std::string & | message = "" |
||
| ) |
Show a progress dialog.
| title | Dialog title |
| message | Progress message |
Definition at line 122 of file DialogManager.cpp.
References MetaImGUI::ProgressDialogState::id, MetaImGUI::ProgressDialogState::message, MetaImGUI::ProgressDialogState::open, MetaImGUI::ProgressDialogState::progress, and MetaImGUI::ProgressDialogState::title.
| void MetaImGUI::DialogManager::UpdateProgress | ( | int | dialogId, |
| float | progress, | ||
| const std::string & | message = "" |
||
| ) |
Update progress dialog.
| dialogId | Dialog ID from ShowProgressDialog |
| progress | Progress value (0.0 to 1.0) |
| message | Optional status message |
Definition at line 134 of file DialogManager.cpp.