00001 // BMessagebox.h (this is -*- C++ -*-) 00002 // 00003 // \author: Bjoern Giesler <bjoern@giesler.de> 00004 // 00005 // 00006 // 00007 // $Author: giesler $ 00008 // $Locker$ 00009 // $Revision$ 00010 // $Date: 2002-08-19 10:41:28 +0200 (Mon, 19 Aug 2002) $ 00011 00012 #ifndef BMESSAGEBOX_H 00013 #define BMESSAGEBOX_H 00014 00015 /* system includes */ 00016 /* (none) */ 00017 00018 /* my includes */ 00019 #include "BButton.h" 00020 #include "BDialog.h" 00021 00028 class BMessagebox: public BDialog, public BButton::Delegate { 00029 public: 00030 typedef enum { 00031 TYPE_NONE, 00032 TYPE_OK, 00033 TYPE_OK_CANCEL 00034 } BMessageboxType; 00035 00036 typedef enum { 00037 RESULT_OK, 00038 RESULT_CANCEL 00039 } BMessageboxResult; 00040 00041 BMessagebox(BScreen* screen, const BSize& size, 00042 const std::string& text, 00043 BMessageboxType type); 00044 ~BMessagebox(); 00045 00052 void run(); 00053 00054 void onButtonClick(BButton* button); 00055 00057 int result() { return _result; } 00058 00060 static void runMessage(BScreen* screen, 00061 const std::string& txt, 00062 BWidget::Rotation rot = BWidget::ROT_0); 00063 private: 00064 int _result; 00065 BMessageboxType _type; 00066 }; 00067 00068 #endif /* BMESSAGEBOX_H */
1.3-rc3