FileSelector.pkg 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. $#include "UI/FileSelector.h"
  2. struct FileSelectorEntry
  3. {
  4. String name_ @ name;
  5. bool directory_ @ directory;
  6. };
  7. class FileSelector : public Object
  8. {
  9. FileSelector();
  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. };
  52. ${
  53. #define TOLUA_DISABLE_tolua_UILuaAPI_FileSelector_new00
  54. static int tolua_UILuaAPI_FileSelector_new00(lua_State* tolua_S)
  55. {
  56. return ToluaNewObject<FileSelector>(tolua_S);
  57. }
  58. #define TOLUA_DISABLE_tolua_UILuaAPI_FileSelector_new00_local
  59. static int tolua_UILuaAPI_FileSelector_new00_local(lua_State* tolua_S)
  60. {
  61. return ToluaNewObjectGC<FileSelector>(tolua_S);
  62. }
  63. $}