Make window.alert simpler

This commit is contained in:
Joshua Granick
2015-09-02 17:59:30 -07:00
parent dc919adccc
commit f618c4648a
10 changed files with 19 additions and 84 deletions

View File

@@ -105,7 +105,7 @@ namespace lime {
}
void SDLWindow::Alert (int type, const char* title, const char* message) {
void SDLWindow::Alert (const char* message, const char* title) {
#ifdef HX_WINDOWS
@@ -127,30 +127,9 @@ namespace lime {
#endif
if (title && message) {
if (message) {
int flags = 0;
switch (type) {
case 1:
flags = SDL_MESSAGEBOX_WARNING;
break;
case 2:
flags = SDL_MESSAGEBOX_ERROR;
break;
default:
flags = SDL_MESSAGEBOX_INFORMATION;
break;
}
SDL_ShowSimpleMessageBox (flags, title, message, sdlWindow);
SDL_ShowSimpleMessageBox (SDL_MESSAGEBOX_INFORMATION, title, message, sdlWindow);
}

View File

@@ -17,7 +17,7 @@ namespace lime {
SDLWindow (Application* application, int width, int height, int flags, const char* title);
~SDLWindow ();
virtual void Alert (int type, const char* title, const char* message);
virtual void Alert (const char* message, const char* title);
virtual void Close ();
virtual void Focus ();
virtual bool GetEnableTextEvents ();