DeclaredAssetForm.cs 767 B

1234567891011121314151617181920212223242526272829
  1. function DeclaredAssetForm::getFolderPath(%this, %title, %textEdit)
  2. {
  3. %modulePath = pathConcat(getMainDotCsDir(), ProjectManager.getProjectFolder(), %this.module.moduleID);
  4. if(isDirectory(pathConcat(%modulePath, %this.module.versionID)))
  5. {
  6. %modulePath = pathConcat(%modulePath, %this.module.versionID);
  7. }
  8. %dialog = new OpenFolderDialog()
  9. {
  10. Filters = "All Files|*.*";
  11. ChangePath = false;
  12. DefaultFile = "";
  13. defaultPath = %modulePath;
  14. title = %title;
  15. };
  16. %result = %dialog.execute();
  17. if ( %result )
  18. {
  19. %selectedFile = makeRelativePath(%dialog.fileName, %modulePath);
  20. %textEdit.setText(%selectedFile);
  21. %textEdit.setCursorPos(999999);//move it to the far right.
  22. }
  23. // Cleanup
  24. %dialog.delete();
  25. %this.postEvent("FolderOpened", %textEdit);
  26. }