00001 // BFileSelector.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 BFILESELECTOR_H 00013 #define BFILESELECTOR_H 00014 00015 /* system includes */ 00016 /* (none) */ 00017 00018 /* my includes */ 00019 #include "BDialog.h" 00020 #include "BButton.h" 00021 #include "BListbox.h" 00022 #include "BScroller.h" 00023 00031 class BFileSelector: 00032 public BDialog, 00033 public BButton::Delegate, 00034 public BListbox::Delegate 00035 { 00036 public: 00037 BFileSelector(BScreen* screen, const std::string& startingDirectory = ""); 00038 ~BFileSelector(); 00039 00041 bool cancelled() { return _cancelled; } 00042 00044 std::string selectedFilename(); 00045 00046 void onButtonClick(BButton* button); 00047 void onEntryClick(BListbox* box, BListbox::Entry& entry); 00048 void onEntryDoubleClick(BListbox* box, BListbox::Entry& entry); 00049 00051 void addFileType(const std::string& filetype); 00052 00054 virtual void run(); 00055 00056 protected: 00057 void fillBox(); 00058 00059 private: 00060 BScroller* _scroller; 00061 BListbox* _box; 00062 BButton *_ok, *_cancel, *_dirhier; 00063 BLabel *_toplabel; 00064 bool _cancelled; 00065 std::string _curdir; 00066 std::string _selected; 00067 std::vector<std::string> _filetypes; 00068 }; 00069 00070 #endif /* BFILESELECTOR_H */
1.3-rc3