Support for showing error dialog
This commit is contained in:
parent
5e2743d9b8
commit
ba0f99d51b
@ -4,3 +4,5 @@
|
||||
|
||||
int Dialog_open(text_t* dest);
|
||||
int Dialog_save(text_t* dest);
|
||||
void Dialog_showError(const text_t* text);
|
||||
|
||||
|
||||
@ -57,6 +57,11 @@ void Dialog_showColorPicker(unsigned int* color)
|
||||
printf("dialog_showColorPicker() not implemented\n");
|
||||
}
|
||||
|
||||
void Dialog_showError(const text_t* text)
|
||||
{
|
||||
printf("Error %s\n", text);
|
||||
}
|
||||
|
||||
int mapSdlEmKeycode(SDLKey key)
|
||||
{
|
||||
switch (key)
|
||||
|
||||
@ -52,6 +52,7 @@ int Dialog_save(char* dest)
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface ColorDelegate : NSObject<NSWindowDelegate>
|
||||
{
|
||||
@ -139,3 +140,15 @@ void Dialog_showColorPicker(uint32_t* color)
|
||||
[thePool release];
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Dialog_showError(const text_t* text)
|
||||
{
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString* message = [[[NSString alloc] initWithUTF8String:text] autorelease];// convert
|
||||
|
||||
NSRunAlertPanel(@"Error", message, @"Ok", @"", @"");
|
||||
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
|
||||
@ -40,6 +40,13 @@ int Dialog_save(wchar_t* path)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Dialog_showError(const wchar_t* text)
|
||||
{
|
||||
MessageBox(NULL, text, L"Error", MB_ICONERROR | MB_OK);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static COLORREF custColors[16];
|
||||
|
||||
void Dialog_showColorPicker(unsigned int* color)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user