CompOptions.pas 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. unit CompOptions;
  2. {
  3. Inno Setup
  4. Copyright (C) 1997-2020 Jordan Russell
  5. Portions by Martijn Laan
  6. For conditions of distribution and use, see LICENSE.TXT.
  7. Compiler IDE Options form
  8. }
  9. interface
  10. uses
  11. Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  12. UIStateForm, StdCtrls, ExtCtrls, NewStaticText;
  13. type
  14. TOptionsForm = class(TUIStateForm)
  15. OKButton: TButton;
  16. CancelButton: TButton;
  17. GroupBox1: TGroupBox;
  18. BackupCheck: TCheckBox;
  19. GroupBox2: TGroupBox;
  20. AssocButton: TButton;
  21. StartupCheck: TCheckBox;
  22. WizardCheck: TCheckBox;
  23. GroupBox3: TGroupBox;
  24. ChangeFontButton: TButton;
  25. FontPanel: TPanel;
  26. Label1: TNewStaticText;
  27. FontDialog: TFontDialog;
  28. UseSynHighCheck: TCheckBox;
  29. FullPathCheck: TCheckBox;
  30. CursorPastEOLCheck: TCheckBox;
  31. UndoAfterSaveCheck: TCheckBox;
  32. TabWidthEdit: TEdit;
  33. Label2: TNewStaticText;
  34. PauseOnDebuggerExceptionsCheck: TCheckBox;
  35. RunAsDifferentUserCheck: TCheckBox;
  36. AutosaveCheck: TCheckBox;
  37. WordWrapCheck: TCheckBox;
  38. AutoIndentCheck: TCheckBox;
  39. IndentationGuidesCheck: TCheckBox;
  40. UseTabCharacterCheck: TCheckBox;
  41. AutoCompleteCheck: TCheckBox;
  42. UnderlineErrorsCheck: TCheckBox;
  43. GutterLineNumbersCheck: TCheckBox;
  44. ColorizeCompilerOutputCheck: TCheckBox;
  45. Label3: TNewStaticText;
  46. ThemeComboBox: TComboBox;
  47. OpenIncludedFilesCheck: TCheckBox;
  48. ShowPreprocessorOutputCheck: TCheckBox;
  49. procedure AssocButtonClick(Sender: TObject);
  50. procedure ChangeFontButtonClick(Sender: TObject);
  51. procedure FormCreate(Sender: TObject);
  52. procedure TabWidthEditChange(Sender: TObject);
  53. private
  54. { Private declarations }
  55. public
  56. { Public declarations }
  57. end;
  58. implementation
  59. uses
  60. CmnFunc, CmnFunc2, CompFunc, CompFileAssoc;
  61. {$R *.DFM}
  62. procedure TOptionsForm.FormCreate(Sender: TObject);
  63. begin
  64. InitFormFont(Self);
  65. { On Windows Vista, you can only select administrator accounts in a "Run as"
  66. dialog. On Windows 2000/XP/2003, you can select any account. Earlier
  67. versions of Windows don't support "Run as" at all, so disable the check
  68. box there. }
  69. if Win32MajorVersion >= 6 then
  70. RunAsDifferentUserCheck.Caption := 'Always &launch Setup/Uninstall as administrator'
  71. else
  72. RunAsDifferentUserCheck.Caption := 'Always &launch Setup/Uninstall as different user';
  73. RunAsDifferentUserCheck.Enabled := (Win32MajorVersion >= 5);
  74. { Order must match TThemeType. }
  75. ThemeComboBox.Items.Add('Light');
  76. ThemeComboBox.Items.Add('Dark');
  77. ThemeComboBox.Items.Add('Classic');
  78. end;
  79. procedure TOptionsForm.AssocButtonClick(Sender: TObject);
  80. const
  81. UserStrings: array [Boolean] of String = ('the current user', 'all users');
  82. var
  83. AllUsers: Boolean;
  84. begin
  85. if RegisterISSFileAssociation(True, AllUsers) then
  86. MsgBox('The .iss extension was successfully associated for ' + UserStrings[AllUsers] + ' with:'#13#10 + NewParamStr(0),
  87. 'Associate', mbInformation, MB_OK);
  88. end;
  89. procedure TOptionsForm.ChangeFontButtonClick(Sender: TObject);
  90. begin
  91. FontDialog.Font.Assign(FontPanel.Font);
  92. if FontDialog.Execute then
  93. FontPanel.Font.Assign(FontDialog.Font);
  94. end;
  95. procedure TOptionsForm.TabWidthEditChange(Sender: TObject);
  96. begin
  97. OKButton.Enabled := StrToIntDef(TabWidthEdit.Text, 0) > 0;
  98. end;
  99. end.