summaryrefslogtreecommitdiff
path: root/src/dialogues/TextPrompt.h
blob: 1c4a672cfb0cd26ad3c93fd9846ad193f524770c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * ConfirmPrompt.h
 *
 *  Created on: Apr 6, 2012
 *      Author: Simon
 */

#ifndef TEXTPROMPT_H_
#define TEXTPROMPT_H_

#include "interface/Window.h"
#include "interface/Textbox.h"

class TextDialogueCallback;
class TextPrompt: public ui::Window {
protected:
	ui::Textbox * textField;
public:
	friend class CloseAction;
	enum DialogueResult { ResultCancel, ResultOkay };
	TextPrompt(std::string title, std::string message, std::string text, std::string placeholder, bool multiline, TextDialogueCallback * callback_);
	static std::string Blocking(std::string title, std::string message, std::string text, std::string placeholder, bool multiline);
	virtual void OnDraw();
	virtual ~TextPrompt();
	TextDialogueCallback * callback;
};

class TextDialogueCallback
{
	public:
		virtual void TextCallback(TextPrompt::DialogueResult result, std::string resultText) {}
		virtual ~TextDialogueCallback() {}
};

#endif /* TEXTPROMPT_H_ */