core/vgui/internals/vgui_file_field.h
Go to the documentation of this file.
00001 // This is core/vgui/internals/vgui_file_field.h
00002 #ifndef vgui_file_field_h_
00003 #define vgui_file_field_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author  K.Y.McGaul, VGG, Oxford University
00010 // \brief   File browser in a dialog.
00011 //
00012 // \verbatim
00013 //  Modifications
00014 //   10 Sep. 2004 Peter Vanroose  Inlined all 1-line methods in class decl
00015 // \endverbatim
00016 
00017 #include <vcl_string.h>
00018 #include "vgui_dialog_field.h"
00019 
00020 //: File browser in a dialog.
00021 //
00022 // vgui_file_field is a dialog field implementation that holds a string
00023 // which contains a file name.  In most implementations this will be filled
00024 // in by a file browser, but the default is just a text entry box.
00025 class vgui_file_field : public vgui_dialog_field
00026 {
00027  public:
00028   vgui_file_field(const char *txt, vcl_string& regex, vcl_string& var_to_modify)
00029   : vgui_dialog_field(txt), var_(var_to_modify), regexp_(regex) {}
00030 
00031   ~vgui_file_field() {}
00032 
00033   vcl_string current_value() const { return var_; }
00034   bool update_value(vcl_string const& s) { var_ = s; return true; }
00035 
00036  private:
00037   vcl_string &var_;
00038   vcl_string &regexp_;
00039 };
00040 
00041 #endif // vgui_file_field_h_