IDE.FilesDesignerForm.pas 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. unit IDE.FilesDesignerForm;
  2. {
  3. Inno Setup
  4. Copyright (C) 1997-2025 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. AppFilesAddDownloadButton: TButton;
  27. procedure FormCreate(Sender: TObject);
  28. procedure FormDestroy(Sender: TObject);
  29. procedure InsertButtonClick(Sender: TObject);
  30. private
  31. FFilesHelper: TWizardFormFilesHelper;
  32. function GetText: String;
  33. procedure SetCreateAppDir(const Value: Boolean);
  34. public
  35. property CreateAppDir: Boolean write SetCreateAppDir;
  36. property Text: string read GetText;
  37. end;
  38. implementation
  39. {$R *.dfm}
  40. uses
  41. IDE.HelperFunc;
  42. procedure TFilesDesignerForm.FormCreate(Sender: TObject);
  43. begin
  44. InitFormFont(Self);
  45. InitFormTheme(Self);
  46. FFilesHelper := TWizardFormFilesHelper.Create(Self,
  47. NotCreateAppDirCheck, AppFilesListBox, AppFilesAddButton, AppFilesAddDirButton,
  48. AppFilesAddDownloadButton, AppFilesEditButton, AppFilesRemoveButton);
  49. end;
  50. procedure TFilesDesignerForm.FormDestroy(Sender: TObject);
  51. begin
  52. FFilesHelper.Free;
  53. end;
  54. procedure TFilesDesignerForm.SetCreateAppDir(const Value: Boolean);
  55. begin
  56. NotCreateAppDirCheck.Checked := not Value;
  57. end;
  58. function TFilesDesignerForm.GetText: String;
  59. begin
  60. Result := '';
  61. FFilesHelper.AddScript(Result);
  62. end;
  63. procedure TFilesDesignerForm.InsertButtonClick(Sender: TObject);
  64. begin
  65. if FFilesHelper.FilesCount = 0 then
  66. ModalResult := mrCancel;
  67. end;
  68. end.