starting playing the wherigo
Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
50
main/include/ui/wherigo_dialog.h
Normal file
50
main/include/ui/wherigo_dialog.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user