Compiler.ScriptClasses.pas 32 KB

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