diff --git a/main.cpp b/main.cpp index 3c90ebf..ef37ee6 100644 --- a/main.cpp +++ b/main.cpp @@ -213,9 +213,25 @@ qticon qt_pixmaptoicon(QPixmap* px) } -int qt_message(char *caption, char *text, QWidget *parent, char *b0, char *b1, char *b2) +enum { + INFORMATION = 0, + QUESTION = 1, + WARNING = 2, + CRITICAL = 3 +}; + + +int qt_message(char *caption, char *text, QWidget *parent, char *b0, char *b1, char *b2, int msg_type) { - return QMessageBox::information(parent, caption, text, b0, b1, b2); + switch(msg_type) { + case QUESTION: + return QMessageBox::question(parent, caption, text, b0, b1, b2); + case WARNING: + return QMessageBox::warning(parent, caption, text, b0, b1, b2); + case CRITICAL: + return QMessageBox::critical(parent, caption, text, b0, b1, b2); + } + return QMessageBox::information(parent, caption, text, b0, b1, b2); } diff --git a/prototypes.h b/prototypes.h index d239851..161e7c7 100644 --- a/prototypes.h +++ b/prototypes.h @@ -17,7 +17,7 @@ qticon qt_pixmaptoicon(qtpixmap px); ___bool qt_connect(qtwidget w1, char *sig, qtobject w2, char *slot); qtobject qt_find(qtobject parent, char *name); qtobject qt_receiver(char *name, C_word proc); -int qt_message(char *caption, char *text, qtwidget parent, char *b0, char *b1, char *b2); +int qt_message(char *caption, char *text, qtwidget parent, char *b0, char *b1, char *b2, int msg_type); const char *qt_classname(qtobject w); ___bool qt_setstringproperty(qtwidget w, char *prop, char *val); ___bool qt_setboolproperty(qtwidget w, char *prop, ___bool val); diff --git a/qt-light.scm b/qt-light.scm index e0caf25..5941fb6 100644 --- a/qt-light.scm +++ b/qt-light.scm @@ -131,8 +131,15 @@ extern "C" { (define qt:message (let ((qt:message qt:message)) - (lambda (text #!key (caption "") parent (button1 "OK") (button2 "Cancel") button3) - (qt:message caption text parent button1 button2 button3) ) ) ) + (lambda (text #!key (caption "") (title "") parent + (button1 "OK") (button2 "Cancel") button3 + (type 'information)) + (qt:message (or title caption) text parent button1 button2 button3 + (case type + ['information 3] + ['question 1] + ['warning 2] + ['critical 3]))))) (define (qt:widget fname #!optional parent) (qt:create fname parent) )