25 #include <tdemessagebox.h>
26 #include <kdialogbase.h>
27 #include <tqpushbutton.h>
29 #include "komessagebox.h"
31 int KOMessageBox::fourBtnMsgBox( TQWidget *parent, TQMessageBox::Icon type,
32 const TQString &text, const TQString &caption,
33 const KGuiItem &button1, const KGuiItem &button2,
34 const KGuiItem &button3, int options)
36 KDialogBase *dialog= new KDialogBase( parent, "KOMessageBox", true,
37 caption.isEmpty() ? "" : caption,
38 KDialogBase::Yes | KDialogBase::No | KDialogBase::Ok | KDialogBase::Cancel,
41 dialog->setButtonOK( button3 );
42 dialog->setButtonText( KDialogBase::Yes, button1.text() );
43 dialog->setButtonText( KDialogBase::No, button2.text() );
44 TQObject::connect( dialog->actionButton( KDialogBase::Yes ), TQ_SIGNAL( clicked() ), dialog, TQ_SLOT(slotYes()));
45 TQObject::connect( dialog->actionButton( KDialogBase::No ), TQ_SIGNAL( clicked() ), dialog, TQ_SLOT(slotNo()));
49 bool checkboxResult = false;
50 int result = KMessageBox::createKMessageBox(dialog, type, text, TQStringList(),
51 TQString(), &checkboxResult, options);
53 case KDialogBase::Yes: result = KMessageBox::Yes; break;
54 case KDialogBase::No: result = KMessageBox::No; break;
55 case KDialogBase::Ok: result = KMessageBox::Continue; break;
56 case KDialogBase::Cancel: result = KMessageBox::Cancel; break;
|