00001 #ifndef WDGFILE_H
00002 #define WDGFILE_H
00003
00004
00005
00006
00007
00008
00009 #include <QString>
00010
00011 #include <Qt>
00012 #include <QtGui>
00013 #include <QtCore>
00014
00015 #include "PSQt/Frame.h"
00016
00017 namespace PSQt {
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class WdgFile : public QWidget
00038 {
00039 Q_OBJECT
00040
00041 public:
00042 WdgFile( QWidget *parent = 0,
00043 const std::string& but_title=std::string("File:"),
00044 const std::string& path=std::string(),
00045 const std::string& search_fmt=std::string("*.data *.png *.gif *.jpg *.jpeg\n *"),
00046 const bool& show_frame=true,
00047 const unsigned& but_width=100);
00048
00049
00050 void resizeEvent(QResizeEvent *event = 0) ;
00051 void closeEvent (QCloseEvent *event = 0) ;
00052 std::string& fileName() { return m_path; };
00053
00054 public slots:
00055 void onButFile() ;
00056 void onEdiFile() ;
00057 void testSignalString(const std::string& fname) ;
00058
00059 signals :
00060 void fileNameIsChanged(const std::string& fname) ;
00061 void valueChanged(int value) ;
00062
00063 private :
00064 std::string m_path;
00065 std::string m_search_fmt;
00066 bool m_show_frame;
00067
00068 QFrame* m_frame;
00069 QLineEdit* m_edi_file;
00070 QPushButton* m_but_file;
00071
00072 inline const char* _name_(){return "WdgFile";}
00073 void showTips() ;
00074 void setFrame() ;
00075 bool fileExists(const std::string& fname) ;
00076 bool setNewFileName(const std::string& fname) ;
00077 };
00078
00079 }
00080
00081 #endif // WDGFILE_H