00001
00002 #ifndef INCLUDED_FileInputControl_h_
00003 #define INCLUDED_FileInputControl_h_
00004
00005 #include "FileBrowserControl.h"
00006 #include <string>
00007
00008
00009 class FileInputControl : public FileBrowserControl {
00010 public:
00011
00012 FileInputControl()
00013 : FileBrowserControl("Select file","Select a file","/ms"), file(NULL), myfile()
00014 {}
00015
00016
00017 FileInputControl(const std::string& nm, const std::string& desc, const std::string& path, std::string* store=NULL)
00018 : FileBrowserControl(nm,desc,path), file(store), myfile()
00019 {}
00020
00021
00022 virtual const std::string& getLastInput() { return myfile; }
00023
00024
00025 virtual void clearLastInput() { selectedFile(""); }
00026
00027
00028 virtual void setStore(std::string* store) { file=store; }
00029
00030 protected:
00031 virtual ControlBase* selectedFile(const std::string& f) {
00032 myfile=f;
00033 if(file!=NULL)
00034 *file=f;
00035 return NULL;
00036 }
00037
00038 std::string* file;
00039 std::string myfile;
00040
00041 private:
00042 FileInputControl(const FileInputControl& );
00043 FileInputControl& operator=(const FileInputControl& );
00044 };
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #endif