FileSelector.pkg 2.1 KB

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