Compiler.ScriptClasses.pas 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. unit Compiler.ScriptClasses;
  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. Script support classes (compile time)
  8. }
  9. interface
  10. uses
  11. uPSCompiler;
  12. procedure ScriptClassesLibraryRegister_C(Cl: TPSPascalCompiler);
  13. implementation
  14. uses
  15. Windows, Shared.SetupTypes,
  16. uPSC_std, uPSC_classes, uPSC_graphics, uPSC_controls, uPSC_stdctrls,
  17. uPSC_forms, uPSC_extctrls, uPSC_comobj;
  18. procedure RegisterWinControl_C(Cl: TPSPascalCompiler);
  19. begin
  20. SIRegisterTWinControl(Cl);
  21. with Cl.FindClass('TWinControl') do
  22. begin
  23. RegisterProperty('ParentBackground', 'Boolean', iptrw);
  24. end;
  25. end;
  26. procedure RegisterNewStaticText_C(Cl: TPSPascalCompiler);
  27. begin
  28. with Cl.AddClassN(Cl.FindClass('TWinControl'), 'TNewStaticText') do
  29. begin
  30. RegisterMethod('function AdjustHeight: Integer');
  31. RegisterProperty('Anchors', 'TAnchors', iptrw);
  32. RegisterProperty('AutoSize', 'Boolean', iptrw);
  33. RegisterProperty('Caption', 'String', iptrw);
  34. RegisterProperty('Color', 'TColor', iptrw);
  35. RegisterProperty('FocusControl', 'TWinControl', iptrw);
  36. RegisterProperty('Font', 'TFont', iptrw);
  37. RegisterProperty('ParentColor', 'Boolean', iptrw);
  38. RegisterProperty('ParentFont', 'Boolean', iptrw);
  39. RegisterProperty('ShowAccelChar', 'Boolean', iptrw);
  40. RegisterProperty('WordWrap', 'Boolean', iptrw);
  41. RegisterProperty('OnClick', 'TNotifyEvent', iptrw);
  42. RegisterProperty('OnDblClick', 'TNotifyEvent', iptrw);
  43. {$IFNDEF PS_MINIVCL}
  44. RegisterProperty('DragCursor', 'Longint', iptrw);
  45. RegisterProperty('DragMode', 'TDragMode', iptrw);
  46. RegisterProperty('ParentShowHint', 'Boolean', iptrw);
  47. RegisterProperty('PopupMenu', 'TPopupMenu', iptrw);
  48. RegisterProperty('OnDragDrop', 'TDragDropEvent', iptrw);
  49. RegisterProperty('OnDragOver', 'TDragOverEvent', iptrw);
  50. RegisterProperty('OnEndDrag', 'TEndDragEvent', iptrw);
  51. RegisterProperty('OnMouseDown', 'TMouseEvent', iptrw);
  52. RegisterProperty('OnMouseMove', 'TMouseMoveEvent', iptrw);
  53. RegisterProperty('OnMouseUp', 'TMouseEvent', iptrw);
  54. RegisterProperty('OnStartDrag', 'TStartDragEvent', iptrw);
  55. {$ENDIF}
  56. end;
  57. end;
  58. procedure RegisterNewCheckListBox_C(Cl: TPSPascalCompiler);
  59. begin
  60. Cl.AddTypeS('TCheckItemOperation', '(coUncheck, coCheck, coCheckWithChildren)');
  61. with Cl.AddClassN(Cl.FindClass('TCustomListBox'), 'TNewCheckListBox') do
  62. begin
  63. RegisterMethod('function AddCheckBox(const ACaption, ASubItem: String; ALevel: Byte; AChecked, AEnabled, AHasInternalChildren, ACheckWhenParentChecked: Boolean; AObject: TObject): Integer');
  64. RegisterMethod('function AddGroup(const ACaption, ASubItem: String; ALevel: Byte; AObject: TObject): Integer');
  65. RegisterMethod('function AddRadioButton(const ACaption, ASubItem: String; ALevel: Byte; AChecked, AEnabled: Boolean; AObject: TObject): Integer');
  66. RegisterMethod('function CheckItem(const Index: Integer; const AOperation: TCheckItemOperation): Boolean');
  67. RegisterProperty('Anchors', 'TAnchors', iptrw);
  68. RegisterProperty('Checked', 'Boolean Integer', iptrw);
  69. RegisterProperty('State', 'TCheckBoxState Integer', iptr);
  70. RegisterProperty('ItemCaption', 'String Integer', iptrw);
  71. RegisterProperty('ItemEnabled', 'Boolean Integer', iptrw);
  72. RegisterProperty('ItemLevel', 'Byte Integer', iptr);
  73. RegisterProperty('ItemObject', 'TObject Integer', iptrw);
  74. RegisterProperty('ItemSubItem', 'String Integer', iptrw);
  75. RegisterProperty('ItemFontStyle', 'TFontStyles Integer', iptrw);
  76. RegisterProperty('SubItemFontStyle', 'TFontStyles Integer', iptrw);
  77. RegisterProperty('Flat', 'Boolean', iptrw);
  78. RegisterProperty('MinItemHeight', 'Integer', iptrw);
  79. RegisterProperty('Offset', 'Integer', iptrw);
  80. RegisterProperty('OnClickCheck', 'TNotifyEvent', iptrw);
  81. RegisterProperty('BorderStyle', 'TBorderStyle', iptrw);
  82. RegisterProperty('Color', 'TColor', iptrw);
  83. RegisterProperty('Font', 'TFont', iptrw);
  84. RegisterProperty('ParentColor', 'Boolean', iptrw);
  85. RegisterProperty('ParentFont', 'Boolean', iptrw);
  86. RegisterProperty('OnClick', 'TNotifyEvent', iptrw);
  87. RegisterProperty('OnDblClick', 'TNotifyEvent', iptrw);
  88. RegisterProperty('OnKeyDown', 'TKeyEvent', iptrw);
  89. RegisterProperty('OnKeyPress', 'TKeyPressEvent', iptrw);
  90. RegisterProperty('OnKeyUp', 'TKeyEvent', iptrw);
  91. RegisterProperty('ShowLines', 'Boolean', iptrw);
  92. RegisterProperty('WantTabs', 'Boolean', iptrw);
  93. RegisterProperty('RequireRadioSelection', 'Boolean', iptrw);
  94. RegisterProperty('OnEnter', 'TNotifyEvent', iptrw);
  95. RegisterProperty('OnExit', 'TNotifyEvent', iptrw);
  96. {$IFNDEF PS_MINIVCL}
  97. RegisterProperty('Ctl3D', 'Boolean', iptrw);
  98. RegisterProperty('DragCursor', 'Longint', iptrw);
  99. RegisterProperty('DragMode', 'TDragMode', iptrw);
  100. RegisterProperty('ParentCtl3D', 'Boolean', iptrw);
  101. RegisterProperty('ParentShowHint', 'Boolean', iptrw);
  102. RegisterProperty('PopupMenu', 'TPopupMenu', iptrw);
  103. RegisterProperty('OnDragDrop', 'TDragDropEvent', iptrw);
  104. RegisterProperty('OnDragOver', 'TDragOverEvent', iptrw);
  105. RegisterProperty('OnEndDrag', 'TEndDragEvent', iptrw);
  106. RegisterProperty('OnMouseDown', 'TMouseEvent', iptrw);
  107. RegisterProperty('OnMouseMove', 'TMouseMoveEvent', iptrw);
  108. RegisterProperty('OnMouseUp', 'TMouseEvent', iptrw);
  109. RegisterProperty('OnStartDrag', 'TStartDragEvent', iptrw);
  110. {$ENDIF}
  111. end;
  112. end;
  113. procedure RegisterNewProgressBar_C(Cl: TPSPascalCompiler);
  114. begin
  115. cl.AddTypeS('TNewProgressBarState', '(npbsNormal, npbsError, npbsPaused)');
  116. cl.AddTypeS('TNewProgressBarStyle', '(npbstNormal, npbstMarquee)');
  117. with Cl.AddClassN(Cl.FindClass('TWinControl'), 'TNewProgressBar') do
  118. begin
  119. RegisterProperty('Anchors', 'TAnchors', iptrw);
  120. RegisterProperty('Min', 'Longint', iptrw);
  121. RegisterProperty('Max', 'Longint', iptrw);
  122. RegisterProperty('Position', 'Longint', iptrw);
  123. RegisterProperty('State', 'TNewProgressBarState', iptrw);
  124. RegisterProperty('Style', 'TNewProgressBarStyle', iptrw);
  125. end;
  126. end;
  127. procedure RegisterRichEditViewer_C(Cl: TPSPascalCompiler);
  128. begin
  129. with Cl.AddClassN(Cl.FindClass('TMemo'), 'TRichEditViewer') do
  130. begin
  131. RegisterProperty('Anchors', 'TAnchors', iptrw);
  132. RegisterProperty('BevelKind', 'TBevelKind', iptrw);
  133. RegisterProperty('BorderStyle', 'TBorderStyle', iptrw);
  134. RegisterProperty('RTFText', 'AnsiString', iptw);
  135. RegisterProperty('UseRichEdit', 'Boolean', iptrw);
  136. end;
  137. end;
  138. procedure RegisterPasswordEdit_C(Cl: TPSPascalCompiler);
  139. begin
  140. with Cl.AddClassN(cl.FindClass('TCustomEdit'), 'TPasswordEdit') do
  141. begin
  142. RegisterProperty('Anchors', 'TAnchors', iptrw);
  143. RegisterProperty('AutoSelect', 'Boolean', iptrw);
  144. RegisterProperty('AutoSize', 'Boolean', iptrw);
  145. RegisterProperty('BorderStyle', 'TBorderStyle', iptrw);
  146. RegisterProperty('Color', 'TColor', iptrw);
  147. RegisterProperty('Font', 'TFont', iptrw);
  148. RegisterProperty('HideSelection', 'Boolean', iptrw);
  149. RegisterProperty('MaxLength', 'Integer', iptrw);
  150. RegisterProperty('ParentColor', 'Boolean', iptrw);
  151. RegisterProperty('ParentFont', 'Boolean', iptrw);
  152. RegisterProperty('Password', 'Boolean', iptrw);
  153. RegisterProperty('ReadOnly', 'Boolean', iptrw);
  154. RegisterProperty('Text', 'string', iptrw);
  155. RegisterProperty('OnChange', 'TNotifyEvent', iptrw);
  156. RegisterProperty('OnClick', 'TNotifyEvent', iptrw);
  157. RegisterProperty('OnDblClick', 'TNotifyEvent', iptrw);
  158. RegisterProperty('OnKeyDown', 'TKeyEvent', iptrw);
  159. RegisterProperty('OnKeyPress', 'TKeyPressEvent', iptrw);
  160. RegisterProperty('OnKeyUp', 'TKeyEvent', iptrw);
  161. RegisterProperty('OnEnter', 'TNotifyEvent', iptrw);
  162. RegisterProperty('OnExit', 'TNotifyEvent', iptrw);
  163. {$IFNDEF PS_MINIVCL}
  164. RegisterProperty('CharCase', 'TEditCharCase', iptrw);
  165. RegisterProperty('Ctl3D', 'Boolean', iptrw);
  166. RegisterProperty('DragCursor', 'Longint', iptrw);
  167. RegisterProperty('DragMode', 'TDragMode', iptrw);
  168. RegisterProperty('OEMConvert', 'Boolean', iptrw);
  169. RegisterProperty('ParentCtl3D', 'Boolean', iptrw);
  170. RegisterProperty('ParentShowHint', 'Boolean', iptrw);
  171. RegisterProperty('PopupMenu', 'TPopupMenu', iptrw);
  172. RegisterProperty('OnDragDrop', 'TDragDropEvent', iptrw);
  173. RegisterProperty('OnDragOver', 'TDragOverEvent', iptrw);
  174. RegisterProperty('OnEndDrag', 'TEndDragEvent', iptrw);
  175. RegisterProperty('OnMouseDown', 'TMouseEvent', iptrw);
  176. RegisterProperty('OnMouseMove', 'TMouseMoveEvent', iptrw);
  177. RegisterProperty('OnMouseUp', 'TMouseEvent', iptrw);
  178. RegisterProperty('OnStartDrag', 'TStartDragEvent', iptrw);
  179. {$ENDIF}
  180. end;
  181. end;
  182. procedure RegisterCustomFolderTreeView_C(Cl: TPSPascalCompiler);
  183. begin
  184. with Cl.AddClassN(Cl.FindClass('TWinControl'),'TCustomFolderTreeView') do
  185. begin
  186. RegisterMethod('procedure ChangeDirectory(const Value: String; const CreateNewItems: Boolean)');
  187. RegisterMethod('procedure CreateNewDirectory(const ADefaultName: String)');
  188. RegisterProperty('Directory', 'String', iptrw);
  189. end;
  190. CL.AddTypeS('TFolderRenameEvent', 'procedure(Sender: TCustomFolderTreeView; var NewName: String; var Accept: Boolean)');
  191. end;
  192. procedure RegisterFolderTreeView_C(Cl: TPSPascalCompiler);
  193. begin
  194. with Cl.AddClassN(Cl.FindClass('TCustomFolderTreeView'),'TFolderTreeView') do
  195. begin
  196. RegisterProperty('Anchors', 'TAnchors', iptrw);
  197. RegisterProperty('OnChange', 'TNotifyEvent', iptrw);
  198. RegisterProperty('OnRename', 'TFolderRenameEvent', iptrw);
  199. end;
  200. end;
  201. procedure RegisterStartMenuFolderTreeView_C(Cl: TPSPascalCompiler);
  202. begin
  203. with Cl.AddClassN(Cl.FindClass('TCustomFolderTreeView'),'TStartMenuFolderTreeView') do
  204. begin
  205. RegisterMethod('procedure SetPaths(const AUserPrograms, ACommonPrograms, AUserStartup, ACommonStartup: String)');
  206. RegisterProperty('Anchors', 'TAnchors', iptrw);
  207. RegisterProperty('OnChange', 'TNotifyEvent', iptrw);
  208. RegisterProperty('OnRename', 'TFolderRenameEvent', iptrw);
  209. end;
  210. end;
  211. procedure RegisterBitmapButton_C(Cl: TPSPascalCompiler);
  212. begin
  213. Cl.AddTypeS('TAlphaFormat', '(afIgnored, afDefined, afPremultiplied)');
  214. with Cl.FindClass('TBitmap') do
  215. begin
  216. RegisterProperty('AlphaFormat', 'TAlphaFormat', iptrw);
  217. end;
  218. with Cl.AddClassN(CL.FindClass('TCustomControl'),'TBitmapButton') do
  219. begin
  220. RegisterProperty('Anchors', 'TAnchors', iptrw);
  221. RegisterProperty('AutoSize', 'Boolean', iptrw);
  222. RegisterProperty('BackColor', 'TColor', iptrw);
  223. RegisterProperty('Caption', 'String', iptrw);
  224. RegisterProperty('Center', 'Boolean', iptrw);
  225. RegisterProperty('Bitmap', 'TBitmap', iptrw);
  226. RegisterProperty('ReplaceColor', 'TColor', iptrw);
  227. RegisterProperty('ReplaceWithColor', 'TColor', iptrw);
  228. RegisterProperty('Stretch', 'Boolean', iptrw);
  229. RegisterProperty('OnClick', 'TNotifyEvent', iptrw);
  230. RegisterProperty('OnDblClick', 'TNotifyEvent', iptrw);
  231. end;
  232. end;
  233. procedure RegisterBitmapImage_C(Cl: TPSPascalCompiler);
  234. begin
  235. with Cl.AddClassN(CL.FindClass('TGraphicControl'),'TBitmapImage') do
  236. begin
  237. RegisterProperty('Anchors', 'TAnchors', iptrw);
  238. RegisterProperty('AutoSize', 'Boolean', iptrw);
  239. RegisterProperty('BackColor', 'TColor', iptrw);
  240. RegisterProperty('Center', 'Boolean', iptrw);
  241. RegisterProperty('Bitmap', 'TBitmap', iptrw);
  242. RegisterProperty('ReplaceColor', 'TColor', iptrw);
  243. RegisterProperty('ReplaceWithColor', 'TColor', iptrw);
  244. RegisterProperty('Stretch', 'Boolean', iptrw);
  245. RegisterProperty('OnClick', 'TNotifyEvent', iptrw);
  246. RegisterProperty('OnDblClick', 'TNotifyEvent', iptrw);
  247. end;
  248. end;
  249. procedure RegisterBidiCtrls_C(Cl: TPSPascalCompiler);
  250. begin
  251. Cl.AddClassN(Cl.FindClass('TEdit'), 'TNewEdit');
  252. Cl.AddClassN(Cl.FindClass('TMemo'), 'TNewMemo');
  253. Cl.AddClassN(Cl.FindClass('TComboBox'), 'TNewComboBox');
  254. Cl.AddClassN(Cl.FindClass('TListBox'), 'TNewListBox');
  255. Cl.AddClassN(Cl.FindClass('TButton'), 'TNewButton');
  256. Cl.AddClassN(Cl.FindClass('TCheckBox'), 'TNewCheckBox');
  257. Cl.AddClassN(Cl.FindClass('TRadioButton'), 'TNewRadioButton');
  258. with Cl.AddClassN(Cl.FindClass('TLinkLabel'), 'TNewLinkLabel') do
  259. begin
  260. RegisterMethod('function AdjustHeight: Integer');
  261. end;
  262. end;
  263. procedure RegisterNewNotebook_C(Cl: TPSPascalCompiler);
  264. begin
  265. Cl.AddClassN(Cl.FindClass('TCustomControl'),'TNewNotebookPage');
  266. with Cl.AddClassN(Cl.FindClass('TWinControl'),'TNewNotebook') do
  267. begin
  268. RegisterMethod('function FindNextPage(CurPage: TNewNotebookPage; GoForward: Boolean): TNewNotebookPage');
  269. RegisterProperty('Anchors', 'TAnchors', iptrw);
  270. RegisterProperty('PageCount', 'Integer', iptr);
  271. RegisterProperty('Pages', 'TNewNotebookPage Integer', iptr);
  272. RegisterProperty('ActivePage', 'TNewNotebookPage', iptrw);
  273. end;
  274. end;
  275. procedure RegisterNewNotebookPage_C(Cl: TPSPascalCompiler);
  276. begin
  277. with Cl.FindClass('TNewNotebookPage') do
  278. begin
  279. RegisterProperty('Color', 'TColor', iptrw);
  280. RegisterProperty('Notebook', 'TNewNotebook', iptrw);
  281. RegisterProperty('PageIndex', 'Integer', iptrw);
  282. end;
  283. end;
  284. procedure RegisterUIStateForm_C(Cl: TPSPascalCompiler);
  285. begin
  286. Cl.AddClassN(Cl.FindClass('TForm'), 'TUIStateForm');
  287. end;
  288. procedure RegisterSetupForm_C(Cl: TPSPascalCompiler);
  289. begin
  290. with Cl.AddClassN(Cl.FindClass('TUIStateForm'), 'TSetupForm') do
  291. begin
  292. RegisterMethod('function CalculateButtonWidth(const ButtonCaptions: array of String): Integer;');
  293. RegisterMethod('function ShouldSizeX: Boolean;');
  294. RegisterMethod('function ShouldSizeY: Boolean;');
  295. RegisterMethod('procedure FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean; const CenterInsideControlCtl: TWinControl; const CenterInsideControlInsideClientArea: Boolean)');
  296. RegisterProperty('ControlsFlipped', 'Boolean', iptr);
  297. RegisterProperty('FlipControlsOnShow', 'Boolean', iptrw);
  298. RegisterProperty('KeepSizeY', 'Boolean', iptrw);
  299. RegisterProperty('RightToLeft', 'Boolean', iptr);
  300. RegisterProperty('SizeAndCenterOnShow', 'Boolean', iptrw);
  301. end;
  302. end;
  303. procedure RegisterWizardForm_C(Cl: TPSPascalCompiler);
  304. begin
  305. with Cl.AddClassN(Cl.FindClass('TSetupForm'), 'TWizardForm') do
  306. begin
  307. RegisterProperty('CancelButton', 'TNewButton', iptr);
  308. RegisterProperty('NextButton', 'TNewButton', iptr);
  309. RegisterProperty('BackButton', 'TNewButton', iptr);
  310. RegisterProperty('OuterNotebook', 'TNewNotebook', iptr);
  311. RegisterProperty('InnerNotebook', 'TNewNotebook', iptr);
  312. RegisterProperty('WelcomePage', 'TNewNotebookPage', iptr);
  313. RegisterProperty('InnerPage', 'TNewNotebookPage', iptr);
  314. RegisterProperty('FinishedPage', 'TNewNotebookPage', iptr);
  315. RegisterProperty('LicensePage', 'TNewNotebookPage', iptr);
  316. RegisterProperty('PasswordPage', 'TNewNotebookPage', iptr);
  317. RegisterProperty('InfoBeforePage', 'TNewNotebookPage', iptr);
  318. RegisterProperty('UserInfoPage', 'TNewNotebookPage', iptr);
  319. RegisterProperty('SelectDirPage', 'TNewNotebookPage', iptr);
  320. RegisterProperty('SelectComponentsPage', 'TNewNotebookPage', iptr);
  321. RegisterProperty('SelectProgramGroupPage', 'TNewNotebookPage', iptr);
  322. RegisterProperty('SelectTasksPage', 'TNewNotebookPage', iptr);
  323. RegisterProperty('ReadyPage', 'TNewNotebookPage', iptr);
  324. RegisterProperty('PreparingPage', 'TNewNotebookPage', iptr);
  325. RegisterProperty('InstallingPage', 'TNewNotebookPage', iptr);
  326. RegisterProperty('InfoAfterPage', 'TNewNotebookPage', iptr);
  327. RegisterProperty('DiskSpaceLabel', 'TNewStaticText', iptr);
  328. RegisterProperty('DirEdit', 'TEdit', iptr);
  329. RegisterProperty('GroupEdit', 'TNewEdit', iptr);
  330. RegisterProperty('NoIconsCheck', 'TNewCheckBox', iptr);
  331. RegisterProperty('PasswordLabel', 'TNewStaticText', iptr);
  332. RegisterProperty('PasswordEdit', 'TPasswordEdit', iptr);
  333. RegisterProperty('PasswordEditLabel', 'TNewStaticText', iptr);
  334. RegisterProperty('ReadyMemo', 'TNewMemo', iptr);
  335. RegisterProperty('TypesCombo', 'TNewComboBox', iptr);
  336. RegisterProperty('Bevel', 'TBevel', iptr);
  337. RegisterProperty('WizardBitmapImage', 'TBitmapImage', iptr);
  338. RegisterProperty('WelcomeLabel1', 'TNewStaticText', iptr);
  339. RegisterProperty('InfoBeforeMemo', 'TRichEditViewer', iptr);
  340. RegisterProperty('InfoBeforeClickLabel', 'TNewStaticText', iptr);
  341. RegisterProperty('MainPanel', 'TPanel', iptr);
  342. RegisterProperty('Bevel1', 'TBevel', iptr);
  343. RegisterProperty('PageNameLabel', 'TNewStaticText', iptr);
  344. RegisterProperty('PageDescriptionLabel', 'TNewStaticText', iptr);
  345. RegisterProperty('WizardSmallBitmapImage', 'TBitmapImage', iptr);
  346. RegisterProperty('ReadyLabel', 'TNewStaticText', iptr);
  347. RegisterProperty('FinishedLabel', 'TNewStaticText', iptr);
  348. RegisterProperty('YesRadio', 'TNewRadioButton', iptr);
  349. RegisterProperty('NoRadio', 'TNewRadioButton', iptr);
  350. RegisterProperty('WizardBitmapImage2', 'TBitmapImage', iptr);
  351. RegisterProperty('WelcomeLabel2', 'TNewStaticText', iptr);
  352. RegisterProperty('LicenseLabel1', 'TNewStaticText', iptr);
  353. RegisterProperty('LicenseMemo', 'TRichEditViewer', iptr);
  354. RegisterProperty('InfoAfterMemo', 'TRichEditViewer', iptr);
  355. RegisterProperty('InfoAfterClickLabel', 'TNewStaticText', iptr);
  356. RegisterProperty('ComponentsList', 'TNewCheckListBox', iptr);
  357. RegisterProperty('ComponentsDiskSpaceLabel', 'TNewStaticText', iptr);
  358. RegisterProperty('BeveledLabel', 'TNewStaticText', iptr);
  359. RegisterProperty('StatusLabel', 'TNewStaticText', iptr);
  360. RegisterProperty('FilenameLabel', 'TNewStaticText', iptr);
  361. RegisterProperty('ProgressGauge', 'TNewProgressBar', iptr);
  362. RegisterProperty('SelectDirLabel', 'TNewStaticText', iptr);
  363. RegisterProperty('SelectStartMenuFolderLabel', 'TNewStaticText', iptr);
  364. RegisterProperty('SelectComponentsLabel', 'TNewStaticText', iptr);
  365. RegisterProperty('SelectTasksLabel', 'TNewStaticText', iptr);
  366. RegisterProperty('LicenseAcceptedRadio', 'TNewRadioButton', iptr);
  367. RegisterProperty('LicenseNotAcceptedRadio', 'TNewRadioButton', iptr);
  368. RegisterProperty('UserInfoNameLabel', 'TNewStaticText', iptr);
  369. RegisterProperty('UserInfoNameEdit', 'TNewEdit', iptr);
  370. RegisterProperty('UserInfoOrgLabel', 'TNewStaticText', iptr);
  371. RegisterProperty('UserInfoOrgEdit', 'TNewEdit', iptr);
  372. RegisterProperty('PreparingErrorBitmapImage', 'TBitmapImage', iptr);
  373. RegisterProperty('PreparingLabel', 'TNewStaticText', iptr);
  374. RegisterProperty('FinishedHeadingLabel', 'TNewStaticText', iptr);
  375. RegisterProperty('UserInfoSerialLabel', 'TNewStaticText', iptr);
  376. RegisterProperty('UserInfoSerialEdit', 'TNewEdit', iptr);
  377. RegisterProperty('TasksList', 'TNewCheckListBox', iptr);
  378. RegisterProperty('RunList', 'TNewCheckListBox', iptr);
  379. RegisterProperty('DirBrowseButton', 'TNewButton', iptr);
  380. RegisterProperty('GroupBrowseButton', 'TNewButton', iptr);
  381. RegisterProperty('SelectDirBitmapImage', 'TBitmapImage', iptr);
  382. RegisterProperty('SelectGroupBitmapImage', 'TBitmapImage', iptr);
  383. RegisterProperty('SelectDirBrowseLabel', 'TNewStaticText', iptr);
  384. RegisterProperty('SelectStartMenuFolderBrowseLabel', 'TNewStaticText', iptr);
  385. RegisterProperty('PreparingYesRadio', 'TNewRadioButton', iptr);
  386. RegisterProperty('PreparingNoRadio', 'TNewRadioButton', iptr);
  387. RegisterProperty('PreparingMemo', 'TNewMemo', iptr);
  388. RegisterProperty('CurPageID', 'Integer', iptr);
  389. RegisterMethod('function AdjustLabelHeight(ALabel: TNewStaticText): Integer');
  390. RegisterMethod('function AdjustLinkLabelHeight(ALinkLabel: TNewLinkLabel): Integer');
  391. RegisterMethod('procedure IncTopDecHeight(AControl: TControl; Amount: Integer)');
  392. RegisterProperty('PrevAppDir', 'String', iptr);
  393. end;
  394. end;
  395. procedure RegisterUninstallProgressForm_C(Cl: TPSPascalCompiler);
  396. begin
  397. with Cl.AddClassN(Cl.FindClass('TSetupForm'), 'TUninstallProgressForm') do
  398. begin
  399. RegisterProperty('OuterNotebook', 'TNewNotebook', iptr);
  400. RegisterProperty('InnerPage', 'TNewNotebookPage', iptr);
  401. RegisterProperty('InnerNotebook', 'TNewNotebook', iptr);
  402. RegisterProperty('InstallingPage', 'TNewNotebookPage', iptr);
  403. RegisterProperty('MainPanel', 'TPanel', iptr);
  404. RegisterProperty('PageNameLabel', 'TNewStaticText', iptr);
  405. RegisterProperty('PageDescriptionLabel', 'TNewStaticText', iptr);
  406. RegisterProperty('WizardSmallBitmapImage', 'TBitmapImage', iptr);
  407. RegisterProperty('Bevel1', 'TBevel', iptr);
  408. RegisterProperty('StatusLabel', 'TNewStaticText', iptr);
  409. RegisterProperty('ProgressBar', 'TNewProgressBar', iptr);
  410. RegisterProperty('BeveledLabel', 'TNewStaticText', iptr);
  411. RegisterProperty('Bevel', 'TBevel', iptr);
  412. RegisterProperty('CancelButton', 'TNewButton', iptr);
  413. end;
  414. end;
  415. procedure RegisterWizardPage_C(Cl: TIFPSPascalCompiler);
  416. var
  417. NewClass: TPSCompileTimeClass;
  418. begin
  419. NewClass := Cl.AddClassN(Cl.FindClass('TComponent'), 'TWizardPage');
  420. CL.AddTypeS('TWizardPageNotifyEvent', 'procedure(Sender: TWizardPage)');
  421. CL.AddTypeS('TWizardPageButtonEvent', 'function(Sender: TWizardPage): Boolean');
  422. CL.AddTypeS('TWizardPageCancelEvent', 'procedure(Sender: TWizardPage; var ACancel, AConfirm: Boolean)');
  423. CL.AddTypeS('TWizardPageShouldSkipEvent', 'function(Sender: TWizardPage): Boolean');
  424. with NewClass do
  425. begin
  426. RegisterProperty('ID', 'Integer', iptr);
  427. RegisterProperty('Caption', 'String', iptrw);
  428. RegisterProperty('Description', 'String', iptrw);
  429. RegisterProperty('Surface', 'TNewNotebookPage', iptr);
  430. RegisterProperty('SurfaceColor', 'TColor', iptr);
  431. RegisterProperty('SurfaceHeight', 'Integer', iptr);
  432. RegisterProperty('SurfaceWidth', 'Integer', iptr);
  433. RegisterProperty('OnActivate', 'TWizardPageNotifyEvent', iptrw);
  434. RegisterProperty('OnBackButtonClick', 'TWizardPageButtonEvent', iptrw);
  435. RegisterProperty('OnCancelButtonClick', 'TWizardPageCancelEvent', iptrw);
  436. RegisterProperty('OnNextButtonClick', 'TWizardPageButtonEvent', iptrw);
  437. RegisterProperty('OnShouldSkipPage', 'TWizardPageShouldSkipEvent', iptrw);
  438. end;
  439. end;
  440. procedure RegisterInputQueryWizardPage_C(Cl: TPSPascalCompiler);
  441. begin
  442. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TInputQueryWizardPage') do
  443. begin
  444. RegisterMethod('function Add(const APrompt: String; const APassword: Boolean): Integer');
  445. RegisterProperty('Edits', 'TPasswordEdit Integer', iptr);
  446. RegisterProperty('PromptLabels', 'TNewStaticText Integer', iptr);
  447. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  448. RegisterProperty('Values', 'String Integer', iptrw);
  449. end;
  450. end;
  451. procedure RegisterInputOptionWizardPage_C(Cl: TPSPascalCompiler);
  452. begin
  453. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TInputOptionWizardPage') do
  454. begin
  455. RegisterMethod('function Add(const ACaption: String): Integer');
  456. RegisterMethod('function AddEx(const ACaption: String; const ALevel: Byte; const AExclusive: Boolean): Integer');
  457. RegisterProperty('CheckListBox', 'TNewCheckListBox', iptr);
  458. RegisterProperty('SelectedValueIndex', 'Integer', iptrw);
  459. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  460. RegisterProperty('Values', 'Boolean Integer', iptrw);
  461. end;
  462. end;
  463. procedure RegisterInputDirWizardPage_C(CL: TPSPascalCompiler);
  464. begin
  465. with CL.AddClassN(CL.FindClass('TWizardPage'),'TInputDirWizardPage') do
  466. begin
  467. RegisterMethod('function Add(const APrompt: String): Integer');
  468. RegisterProperty('Buttons', 'TNewButton Integer', iptr);
  469. RegisterProperty('Edits', 'TEdit Integer', iptr);
  470. RegisterProperty('NewFolderName', 'String', iptrw);
  471. RegisterProperty('PromptLabels', 'TNewStaticText Integer', iptr);
  472. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  473. RegisterProperty('Values', 'String Integer', iptrw);
  474. end;
  475. end;
  476. procedure RegisterInputFileWizardPage_C(Cl: TPSPascalCompiler);
  477. begin
  478. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TInputFileWizardPage') do
  479. begin
  480. RegisterMethod('function Add(const APrompt, AFilter, ADefaultExtension: String): Integer');
  481. RegisterProperty('Buttons', 'TNewButton Integer', iptr);
  482. RegisterProperty('Edits', 'TEdit Integer', iptr);
  483. RegisterProperty('PromptLabels', 'TNewStaticText Integer', iptr);
  484. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  485. RegisterProperty('Values', 'String Integer', iptrw);
  486. RegisterProperty('IsSaveButton', 'Boolean Integer', iptrw);
  487. end;
  488. end;
  489. procedure RegisterOutputMsgWizardPage_C(Cl: TPSPascalCompiler);
  490. begin
  491. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TOutputMsgWizardPage') do
  492. begin
  493. RegisterProperty('MsgLabel', 'TNewStaticText', iptr);
  494. end;
  495. end;
  496. procedure RegisterOutputMsgMemoWizardPage_C(Cl: TPSPascalCompiler);
  497. begin
  498. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TOutputMsgMemoWizardPage') do
  499. begin
  500. RegisterProperty('RichEditViewer', 'TRichEditViewer', iptr);
  501. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  502. end;
  503. end;
  504. procedure RegisterOutputProgressWizardPage_C(Cl: TPSPascalCompiler);
  505. begin
  506. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TOutputProgressWizardPage') do
  507. begin
  508. RegisterMethod('procedure Hide');
  509. RegisterProperty('Msg1Label', 'TNewStaticText', iptr);
  510. RegisterProperty('Msg2Label', 'TNewStaticText', iptr);
  511. RegisterProperty('ProgressBar', 'TNewProgressBar', iptr);
  512. RegisterMethod('procedure SetProgress(const Position, Max: Longint)');
  513. RegisterMethod('procedure SetText(const Msg1, Msg2: String)');
  514. RegisterMethod('procedure Show');
  515. end;
  516. end;
  517. procedure RegisterOutputMarqueeProgressWizardPage_C(Cl: TPSPascalCompiler);
  518. begin
  519. with CL.AddClassN(Cl.FindClass('TOutputProgressWizardPage'),'TOutputMarqueeProgressWizardPage') do
  520. begin
  521. RegisterMethod('procedure Animate');
  522. RegisterMethod('procedure SetProgress(const Position, Max: Longint)'); { Only used to stop the script from called TOutputProgressWizardPage.SetProgress }
  523. end;
  524. end;
  525. procedure RegisterDownloadWizardPage_C(Cl: TPSPascalCompiler);
  526. begin
  527. with CL.AddClassN(Cl.FindClass('TOutputProgressWizardPage'),'TDownloadWizardPage') do
  528. begin
  529. RegisterProperty('AbortButton', 'TNewButton', iptr);
  530. RegisterProperty('AbortedByUser', 'Boolean', iptr);
  531. RegisterProperty('LastBaseNameOrUrl', 'String', iptr);
  532. RegisterProperty('ShowBaseNameInsteadOfUrl', 'Boolean', iptrw);
  533. RegisterMethod('function Add(const Url, BaseName, RequiredSHA256OfFile: String): Integer');
  534. RegisterMethod('function AddWithISSigVerify(const Url, ISSigUrl, BaseName: String; const AllowedKeysRuntimeIDs: TStringList): Integer;');
  535. RegisterMethod('function AddEx(const Url, BaseName, RequiredSHA256OfFile, UserName, Password: String): Integer');
  536. RegisterMethod('function AddExWithISSigVerify(const Url, ISSigUrl, BaseName, UserName, Password: String; const AllowedKeysRuntimeIDs: TStringList): Integer;');
  537. RegisterMethod('procedure Clear');
  538. RegisterMethod('function Download: Int64');
  539. RegisterMethod('procedure Show'); { Without this TOutputProgressWizardPage's Show will be called }
  540. end;
  541. end;
  542. procedure RegisterExtractionWizardPage_C(Cl: TPSPascalCompiler);
  543. begin
  544. with CL.AddClassN(Cl.FindClass('TOutputProgressWizardPage'),'TExtractionWizardPage') do
  545. begin
  546. RegisterProperty('AbortButton', 'TNewButton', iptr);
  547. RegisterProperty('AbortedByUser', 'Boolean', iptr);
  548. RegisterProperty('ShowArchiveInsteadOfFile', 'Boolean', iptrw);
  549. RegisterMethod('function Add(const ArchiveFileName, DestDir: String; const FullPaths: Boolean): Integer');
  550. RegisterMethod('function AddEx(const ArchiveFileName, DestDir, Password: String; const FullPaths: Boolean): Integer');
  551. RegisterMethod('procedure Clear');
  552. RegisterMethod('procedure Extract');
  553. RegisterMethod('procedure Show'); { Without this TOutputProgressWizardPage's Show will be called }
  554. end;
  555. end;
  556. procedure RegisterHandCursor_C(Cl: TPSPascalCompiler);
  557. begin
  558. cl.AddConstantN('crHand', 'Integer').Value.ts32 := crHand;
  559. end;
  560. procedure ScriptClassesLibraryRegister_C(Cl: TPSPascalCompiler);
  561. const
  562. clSystemColor = $FF000000;
  563. begin
  564. { Std }
  565. SIRegister_Std_TypesAndConsts(Cl);
  566. SIRegisterTObject(Cl);
  567. SIRegisterTPersistent(Cl);
  568. SIRegisterTComponent(Cl);
  569. { Classes }
  570. SIRegister_Classes_TypesAndConsts(Cl);
  571. SIRegisterTStream(Cl);
  572. SIRegisterTStrings(Cl, True);
  573. SIRegisterTStringList(Cl);
  574. SIRegisterTHandleStream(Cl);
  575. SIRegisterTFileStream(Cl);
  576. SIRegisterTStringStream(Cl);
  577. { Graphics }
  578. SIRegister_Graphics_TypesAndConsts(Cl);
  579. cl.AddConstantN('clHotLight', 'Integer').Value.ts32 := Integer(clSystemColor or COLOR_HOTLIGHT);
  580. SIRegisterTGraphicsObject(Cl);
  581. SIRegisterTFont(Cl);
  582. SIRegisterTPen(Cl);
  583. SIRegisterTBrush(Cl);
  584. SIRegisterTCanvas(Cl);
  585. SIRegisterTGraphic(Cl);
  586. SIRegisterTBitmap(Cl, True);
  587. { Controls }
  588. SIRegister_Controls_TypesAndConsts(Cl);
  589. SIRegisterTDragObject(Cl);
  590. SIRegisterTSizeConstraints(Cl);
  591. SIRegisterTControl(Cl);
  592. RegisterWinControl_C(Cl);
  593. SIRegisterTGraphicControl(Cl);
  594. SIRegisterTCustomControl(Cl);
  595. { Forms }
  596. SIRegister_Forms_TypesAndConsts(Cl);
  597. SIRegisterTScrollingWinControl(Cl);
  598. SIRegisterTForm(Cl);
  599. { StdCtrls }
  600. SIRegister_StdCtrls_TypesAndConsts(Cl);
  601. SIRegisterTCustomLabel(Cl);
  602. SIRegisterTLabel(Cl);
  603. SIRegisterTCustomEdit(Cl);
  604. SIRegisterTEdit(Cl);
  605. SIRegisterTCustomMemo(Cl);
  606. SIRegisterTMemo(Cl);
  607. SIRegisterTCustomComboBox(Cl);
  608. SIRegisterTComboBox(Cl);
  609. SIRegisterTButtonControl(Cl);
  610. SIRegisterTButton(Cl);
  611. SIRegisterTCustomCheckBox(Cl);
  612. SIRegisterTCheckBox(Cl);
  613. SIRegisterTRadioButton(Cl);
  614. SIRegisterTCustomListBox(Cl);
  615. SIRegisterTListBox(Cl);
  616. { ExtCtrls }
  617. SIRegister_ExtCtrls_TypesAndConsts(cl);
  618. SIRegisterTBevel(Cl);
  619. SIRegisterTCustomPanel(Cl);
  620. SIRegisterTPanel(Cl);
  621. SIRegisterTCustomLinkLabel(Cl);
  622. SIRegisterTLinkLabel(Cl);
  623. { ComObj }
  624. SIRegister_ComObj(Cl);
  625. RegisterNewStaticText_C(Cl);
  626. RegisterNewCheckListBox_C(Cl);
  627. RegisterNewProgressBar_C(Cl);
  628. RegisterRichEditViewer_C(Cl);
  629. RegisterPasswordEdit_C(Cl);
  630. RegisterCustomFolderTreeView_C(Cl);
  631. RegisterFolderTreeView_C(Cl);
  632. RegisterStartMenuFolderTreeView_C(Cl);
  633. RegisterBitmapButton_C(Cl);
  634. RegisterBitmapImage_C(Cl);
  635. RegisterBidiCtrls_C(Cl);
  636. RegisterNewNotebook_C(Cl);
  637. RegisterNewNotebookPage_C(Cl);
  638. RegisterUIStateForm_C(Cl);
  639. RegisterSetupForm_C(Cl);
  640. RegisterWizardForm_C(Cl);
  641. RegisterUninstallProgressForm_C(Cl);
  642. RegisterWizardPage_C(Cl);
  643. RegisterInputQueryWizardPage_C(Cl);
  644. RegisterInputOptionWizardPage_C(Cl);
  645. RegisterInputDirWizardPage_C(Cl);
  646. RegisterInputFileWizardPage_C(Cl);
  647. RegisterOutputMsgWizardPage_C(Cl);
  648. RegisterOutputMsgMemoWizardPage_C(Cl);
  649. RegisterOutputProgressWizardPage_C(Cl);
  650. RegisterOutputMarqueeProgressWizardPage_C(Cl);
  651. RegisterDownloadWizardPage_C(Cl);
  652. RegisterExtractionWizardPage_C(Cl);
  653. RegisterHandCursor_C(Cl);
  654. AddImportedClassVariable(Cl, 'WizardForm', 'TWizardForm');
  655. AddImportedClassVariable(Cl, 'UninstallProgressForm', 'TUninstallProgressForm');
  656. end;
  657. end.