FileSelector.pkg 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. $#include "FileSelector.h"
  2. struct FileSelectorEntry
  3. {
  4. String name_ @ name;
  5. bool directory_ @ directory;
  6. };
  7. class FileSelector : public Object
  8. {
  9. public:
  10. // Methods:
  11. FileSelector(Context* context);
  12. virtual ~FileSelector();
  13. void SetDefaultStyle(XMLFile* style);
  14. void SetTitle(const String& text);
  15. void SetButtonTexts(const String& okText, const String& cancelText);
  16. void SetPath(const String& path);
  17. void SetFileName(const String& fileName);
  18. void SetFilters(const Vector<String>& filters, unsigned defaultIndex);
  19. void SetDirectoryMode(bool enable);
  20. void UpdateElements();
  21. XMLFile* GetDefaultStyle() const;
  22. Window* GetWindow() const;
  23. Text* GetTitleText() const;
  24. ListView* GetFileList() const;
  25. LineEdit* GetPathEdit() const;
  26. LineEdit* GetFileNameEdit() const;
  27. DropDownList* GetFilterList() const;
  28. Button* GetOKButton() const;
  29. Button* GetCancelButton() const;
  30. Button* GetCloseButton() const;
  31. const String& GetTitle() const;
  32. const String& GetPath() const;
  33. const String& GetFileName() const;
  34. const String& GetFilter() const;
  35. unsigned GetFilterIndex() const;
  36. bool GetDirectoryMode() const;
  37. // Properties:
  38. tolua_property__get_set XMLFile* defaultStyle;
  39. tolua_readonly tolua_property__get_set Window* window;
  40. tolua_readonly tolua_property__get_set Text* titleText;
  41. tolua_readonly tolua_property__get_set ListView* fileList;
  42. tolua_readonly tolua_property__get_set LineEdit* pathEdit;
  43. tolua_readonly tolua_property__get_set LineEdit* fileNameEdit;
  44. tolua_readonly tolua_property__get_set DropDownList* filterList;
  45. tolua_readonly tolua_property__get_set Button* OKButton;
  46. tolua_readonly tolua_property__get_set Button* cancelButton;
  47. tolua_readonly tolua_property__get_set Button* closeButton;
  48. tolua_property__get_set String& title;
  49. tolua_property__get_set String& path;
  50. tolua_property__get_set String& fileName;
  51. tolua_readonly tolua_property__get_set String& filter;
  52. tolua_readonly tolua_property__get_set unsigned filterIndex;
  53. tolua_property__get_set bool directoryMode;
  54. };