IDE.FilesDesignerForm.pas 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. FFilesHelper := TWizardFormFilesHelper.Create(Self,
  45. NotCreateAppDirCheck, AppFilesListBox, AppFilesAddButton, AppFilesAddDirButton,
  46. AppFilesEditButton, AppFilesRemoveButton);
  47. end;
  48. procedure TFilesDesignerForm.FormDestroy(Sender: TObject);
  49. begin
  50. FFilesHelper.Free;
  51. end;
  52. procedure TFilesDesignerForm.SetCreateAppDir(const Value: Boolean);
  53. begin
  54. NotCreateAppDirCheck.Checked := not Value;
  55. end;
  56. function TFilesDesignerForm.GetText: String;
  57. begin
  58. Result := '';
  59. FFilesHelper.AddScript(Result);
  60. end;
  61. procedure TFilesDesignerForm.InsertButtonClick(Sender: TObject);
  62. begin
  63. if FFilesHelper.FilesCount = 0 then
  64. ModalResult := mrCancel;
  65. end;
  66. end.