mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
SimpleMessageBox are supported.
Use: SDL_ShowSimpleMessageBox
This commit is contained in:
parent
3e0b0739ba
commit
2c1f055a49
|
@ -488,6 +488,24 @@ namespace MiniEngine
|
||||||
winrnd.rnd.reset(SDL_CreateRenderer(wnd.get(), -1, flags), SDL_DestroyRenderer);
|
winrnd.rnd.reset(SDL_CreateRenderer(wnd.get(), -1, flags), SDL_DestroyRenderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Window::showSimpleMessageBox(MessageBoxType type,std::string Title,std::string Message)
|
||||||
|
{
|
||||||
|
Uint32 flags=0;
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case MessageBoxType::Error:
|
||||||
|
flags=SDL_MESSAGEBOX_ERROR;
|
||||||
|
break;
|
||||||
|
case MessageBoxType::Information:
|
||||||
|
flags=SDL_MESSAGEBOX_INFORMATION;
|
||||||
|
break;
|
||||||
|
case MessageBoxType::Warning:
|
||||||
|
flags=SDL_MESSAGEBOX_WARNING;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SDL_ShowSimpleMessageBox(flags,Title.c_str(),Message.c_str(),wnd.get());
|
||||||
|
}
|
||||||
|
|
||||||
Font::Font(std::string FontFileName, int size) throw(ErrorViewer)
|
Font::Font(std::string FontFileName, int size) throw(ErrorViewer)
|
||||||
{
|
{
|
||||||
if (use(FontFileName, size) != 0)
|
if (use(FontFileName, size) != 0)
|
||||||
|
|
|
@ -163,6 +163,8 @@ namespace MiniEngine
|
||||||
friend class Window;
|
friend class Window;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class MessageBoxType { Error,Warning,Information };
|
||||||
|
|
||||||
class Window
|
class Window
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -186,6 +188,9 @@ namespace MiniEngine
|
||||||
|
|
||||||
void setResizable(bool resizable);
|
void setResizable(bool resizable);
|
||||||
|
|
||||||
|
/// Use UTF8 in Title and Message please.
|
||||||
|
int showSimpleMessageBox(MessageBoxType type,std::string Title,std::string Message);
|
||||||
|
|
||||||
void show();
|
void show();
|
||||||
void hide();
|
void hide();
|
||||||
void raise();
|
void raise();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user