00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GUIFILELIST_H
00023 #define GUIFILELIST_H
00024
00025 #include "guilist.h"
00026 #include <vector>
00027 #include <string>
00028 #ifndef MAX_PATH
00029 #define MAX_PATH 256
00030 #endif
00031
00043 class DECLSPEC GuiFileList : public GuiList
00044 {
00045 public:
00046 struct FIND_DATA
00047 {
00048 Uint32 ulType;
00049 char chFileName[MAX_PATH];
00050 };
00051 DECLSPEC GuiFileList(const SDL_Rect &r, GuiElement * el, const char *name);
00060 DECLSPEC GuiFileList(TiXmlElement *el, GuiElement *p);
00061 virtual DECLSPEC ~GuiFileList();
00062
00063 virtual const char *getClassName() { return "GuiFileList"; }
00064
00065 DECLSPEC char * getFilename(unsigned int i) const;
00066 DECLSPEC char * getSelFilename() const;
00067 DECLSPEC FIND_DATA getAttribute(unsigned int i) const;
00068 DECLSPEC FIND_DATA getSelAttr() const;
00069
00070 DECLSPEC void setFiletypes( bool files, bool dirs, bool others = false );
00076 DECLSPEC void setPath(const char * path);
00077 DECLSPEC void setSeekstr(const char * str);
00078 DECLSPEC void hideExtension(bool hide = true);
00079
00080 DECLSPEC void refresh();
00081
00082 static void newguiobject(void *presult, BasicObject *o, void *xmldata)
00083 {
00084 GuiElement *r = new GuiFileList((TiXmlElement*)xmldata, (GuiElement*)o);
00085 *(GuiElement**)presult = r;
00086 }
00087
00088 protected:
00089 virtual DECLSPEC void onInit();
00090
00091 private:
00092 Uint32 showtypes;
00093 bool hideext;
00094 char * seekstr;
00095
00096 std::string strPath;
00097 typedef vector<FIND_DATA> attrlist;
00098 attrlist attributes;
00099 };
00100
00101 #endif