51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
#ifndef WHERIGO_DIALOG_H
|
|
#define WHERIGO_DIALOG_H
|
|
|
|
#include <wx/wx.h>
|
|
#include <wx/dialog.h>
|
|
#include <vector>
|
|
#include <string>
|
|
#include <functional>
|
|
|
|
namespace wherigo {
|
|
|
|
struct DialogEntry {
|
|
std::string text;
|
|
std::string mediaName;
|
|
std::vector<std::string> buttons;
|
|
};
|
|
|
|
class WherigoMessageDialog : public wxDialog {
|
|
public:
|
|
WherigoMessageDialog(wxWindow *parent, const wxString &text,
|
|
const wxString &title = "Wherigo",
|
|
const std::vector<wxString> &buttons = {},
|
|
const wxString &mediaName = "");
|
|
|
|
int getSelectedButton() const { return m_selectedButton; }
|
|
|
|
private:
|
|
void onButton(wxCommandEvent &event);
|
|
|
|
int m_selectedButton = -1;
|
|
};
|
|
|
|
class WherigoDialogRunner {
|
|
public:
|
|
static WherigoDialogRunner& getInstance();
|
|
|
|
void showMessageBox(const wxString &text, const wxString &title = "Wherigo",
|
|
std::function<void(int)> callback = nullptr);
|
|
|
|
void showDialog(const std::vector<DialogEntry> &entries,
|
|
std::function<void(int)> callback = nullptr);
|
|
|
|
private:
|
|
WherigoDialogRunner() = default;
|
|
};
|
|
|
|
} // namespace wherigo
|
|
|
|
#endif // WHERIGO_DIALOG_H
|
|
|