FileSelector.pkg 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 SetTitle(const char* text);
  14. void SetButtonTexts(const String& okText, const String& cancelText);
  15. void SetButtonTexts(const char* okText, const char* cancelText);
  16. void SetPath(const String& path);
  17. void SetPath(const char* path);
  18. void SetFileName(const String& fileName);
  19. void SetFileName(const char* fileName);
  20. void SetFilters(const Vector<String>& filters, unsigned defaultIndex);
  21. void SetDirectoryMode(bool enable);
  22. void UpdateElements();
  23. XMLFile* GetDefaultStyle() const;
  24. Window* GetWindow() const;
  25. Text* GetTitleText() const;
  26. ListView* GetFileList() const;
  27. LineEdit* GetPathEdit() const;
  28. LineEdit* GetFileNameEdit() const;
  29. DropDownList* GetFilterList() const;
  30. Button* GetOKButton() const;
  31. Button* GetCancelButton() const;
  32. Button* GetCloseButton() const;
  33. const String& GetTitle() const;
  34. const String& GetPath() const;
  35. const String& GetFileName() const;
  36. const String& GetFilter() const;
  37. unsigned GetFilterIndex() const;
  38. bool GetDirectoryMode() const;
  39. tolua_property__get_set XMLFile* defaultStyle;
  40. tolua_readonly tolua_property__get_set Window* window;
  41. tolua_readonly tolua_property__get_set Text* titleText;
  42. tolua_readonly tolua_property__get_set ListView* fileList;
  43. tolua_readonly tolua_property__get_set LineEdit* pathEdit;
  44. tolua_readonly tolua_property__get_set LineEdit* fileNameEdit;
  45. tolua_readonly tolua_property__get_set DropDownList* filterList;
  46. tolua_readonly tolua_property__get_set Button* OKButton;
  47. tolua_readonly tolua_property__get_set Button* cancelButton;
  48. tolua_readonly tolua_property__get_set Button* closeButton;
  49. tolua_property__get_set String& title;
  50. tolua_property__get_set String& path;
  51. tolua_property__get_set String& fileName;
  52. tolua_readonly tolua_property__get_set String& filter;
  53. tolua_readonly tolua_property__get_set unsigned filterIndex;
  54. tolua_property__get_set bool directoryMode;
  55. };