00001 // BMenu.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 BMENU_H 00013 #define BMENU_H 00014 00015 /* system includes */ 00016 /* (none) */ 00017 00018 /* my includes */ 00019 #include "BListbox.h" 00020 #include "BDialog.h" 00021 00025 class BMenu: 00026 public BDialog, 00027 public BListbox::Delegate 00028 { 00029 public: 00030 BMenu(BScreen* screen, const BSize& size); 00031 ~BMenu(); 00032 00033 void addEntry(const std::string &title, 00034 u16 color = RGB15(0, 0, 0)|BIT(15), 00035 int tag = 0); 00036 const BListbox::Entry& selectedEntry(); 00037 void setEntrySpacing(int spacing) { _lb->setEntrySpacing(spacing); } 00038 int entrySpacing() { return _lb->entrySpacing(); } 00039 00040 void onEntryDoubleClick(BListbox *box, BListbox::Entry &entry); 00041 void onEntryClick(BListbox *box, BListbox::Entry &entry); 00042 00043 void setRotation(BWidget::Rotation rot); 00044 00045 void handleEvent(const BEvent& event); 00046 00047 bool cancelled() { return _cancelled; } 00048 00049 virtual void run(); 00050 private: 00051 BListbox* _lb; 00052 bool _cancelled; 00053 }; 00054 00055 #endif /* BMENU_H */
1.3-rc3