Lua: added a message box. messagebox('message'), or messagebox('caption','message'). note that Lua supports concatenation (operator ..) and this function accepts backslash-n for carriage return. It performs word-wrapping if needed. Fixed the Hourglass cursor showing up in some error boxes, instead of the arrow cursor.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1340 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
@@ -1113,7 +1113,9 @@ void Warning_message(char * message)
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
/// Window that shows a big message (up to 34x12), and waits for a click on OK
|
||||
/// Window that shows a big message (up to 34x12), and waits for a click on OK.
|
||||
/// On call: Cursor must be displayed
|
||||
/// On exit: Cursor is displayed
|
||||
void Verbose_message(const char *caption, const char * message )
|
||||
{
|
||||
short clicked_button;
|
||||
@@ -1121,7 +1123,9 @@ void Verbose_message(const char *caption, const char * message )
|
||||
int last_space;
|
||||
int nb_char;
|
||||
char buffer[36];
|
||||
byte original_cursor_shape = Cursor_shape;
|
||||
|
||||
|
||||
Open_window(300,160,caption);
|
||||
|
||||
// Word-wrap the message
|
||||
@@ -1160,6 +1164,7 @@ void Verbose_message(const char *caption, const char * message )
|
||||
|
||||
Window_set_normal_button(300/2-20,160-23,40,14,"OK",1,1,SDLK_RETURN); // 1
|
||||
Update_window_area(0,0,Window_width,Window_height);
|
||||
Cursor_shape=CURSOR_SHAPE_ARROW;
|
||||
Display_cursor();
|
||||
|
||||
do
|
||||
@@ -1168,6 +1173,7 @@ void Verbose_message(const char *caption, const char * message )
|
||||
Key=0;
|
||||
|
||||
Close_window();
|
||||
Cursor_shape=original_cursor_shape;
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user