mirror of
https://github.com/zetaPRIME/libstarlight.git
synced 2025-06-26 13:42:46 +00:00
32 lines
752 B
C++
32 lines
752 B
C++
#pragma once
|
|
#include "starlight/_global.h"
|
|
|
|
#include <string>
|
|
#include <functional>
|
|
|
|
#include "starlight/ui/Form.h"
|
|
|
|
namespace starlight {
|
|
namespace dialog {
|
|
class MessageBox : public ui::Form, public ui::FormCreator<MessageBox> {
|
|
private:
|
|
//
|
|
|
|
public:
|
|
enum Mode {
|
|
Ok, OkCancel, YesNo
|
|
};
|
|
|
|
std::function<void(int)> eOnSelect;
|
|
int numButtons = 0;
|
|
|
|
MessageBox(Mode m, const std::string& msg, std::function<void(int)> onSelect = {});
|
|
~MessageBox() override { };
|
|
|
|
void Update(bool focused) override;
|
|
|
|
void OnSelect(int buttonId);
|
|
};
|
|
}
|
|
}
|