IDE.FilesDesignerForm.pas 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. unit IDE.FilesDesignerForm;
  2. {
  3. Inno Setup
  4. Copyright (C) 1997-2024 Jordan Russell
  5. Portions by Martijn Laan
  6. For conditions of distribution and use, see LICENSE.TXT.
  7. Files Designer form
  8. }
  9. interface
  10. uses
  11. Classes, Controls, Forms, Dialogs, ExtCtrls, StdCtrls,
  12. UIStateForm, NewStaticText, DropListBox, IDE.Wizard.WizardFormFilesHelper;
  13. type
  14. TFilesDesignerForm = class(TUIStateForm)
  15. Panel1: TPanel;
  16. InsertButton: TButton;
  17. CancelButton: TButton;
  18. AppFilesEditButton: TButton;
  19. AppFilesRemoveButton: TButton;
  20. AppFilesAddDirButton: TButton;
  21. AppFilesAddButton: TButton;
  22. AppFilesListBox: TDropListBox;
  23. AppFilesLabel: TNewStaticText;
  24. NotCreateAppDirCheck: TCheckBox;
  25. Bevel1: TBevel;
  26. procedure FormCreate(Sender: TObject);
  27. procedure FormDestroy(Sender: TObject);
  28. procedure InsertButtonClick(Sender: TObject);
  29. private
  30. FFilesHelper: TWizardFormFilesHelper;
  31. function GetText: String;
  32. procedure SetCreateAppDir(const Value: Boolean);
  33. public
  34. property CreateAppDir: Boolean write SetCreateAppDir;
  35. property Text: string read GetText;
  36. end;
  37. implementation
  38. {$R *.dfm}
  39. uses
  40. IDE.HelperFunc;
  41. procedure TFilesDesignerForm.FormCreate(Sender: TObject);
  42. begin
  43. InitFormFont(Self);
  44. InitFormTheme(Self);
  45. FFilesHelper := TWizardFormFilesHelper.Create(Self,
  46. NotCreateAppDirCheck, AppFilesListBox, AppFilesAddButton, AppFilesAddDirButton,
  47. AppFilesEditButton, AppFilesRemoveButton);
  48. end;
  49. procedure TFilesDesignerForm.FormDestroy(Sender: TObject);
  50. begin
  51. FFilesHelper.Free;
  52. end;
  53. procedure TFilesDesignerForm.SetCreateAppDir(const Value: Boolean);
  54. begin
  55. NotCreateAppDirCheck.Checked := not Value;
  56. end;
  57. function TFilesDesignerForm.GetText: String;
  58. begin
  59. Result := '';
  60. FFilesHelper.AddScript(Result);
  61. end;
  62. procedure TFilesDesignerForm.InsertButtonClick(Sender: TObject);
  63. begin
  64. if FFilesHelper.FilesCount = 0 then
  65. ModalResult := mrCancel;
  66. end;
  67. end.