Compiler.ScriptClasses.pas 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  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 RegisterBitmapImage_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('TGraphicControl'),'TBitmapImage') do
  219. begin
  220. RegisterProperty('Anchors', 'TAnchors', iptrw);
  221. RegisterProperty('AutoSize', 'Boolean', iptrw);
  222. RegisterProperty('BackColor', 'TColor', iptrw);
  223. RegisterProperty('Center', 'Boolean', iptrw);
  224. RegisterProperty('Bitmap', 'TBitmap', iptrw);
  225. RegisterProperty('ReplaceColor', 'TColor', iptrw);
  226. RegisterProperty('ReplaceWithColor', 'TColor', iptrw);
  227. RegisterProperty('Stretch', 'Boolean', iptrw);
  228. RegisterProperty('OnClick', 'TNotifyEvent', iptrw);
  229. RegisterProperty('OnDblClick', 'TNotifyEvent', iptrw);
  230. end;
  231. end;
  232. procedure RegisterBidiCtrls_C(Cl: TPSPascalCompiler);
  233. begin
  234. Cl.AddClassN(Cl.FindClass('TEdit'), 'TNewEdit');
  235. Cl.AddClassN(Cl.FindClass('TMemo'), 'TNewMemo');
  236. Cl.AddClassN(Cl.FindClass('TComboBox'), 'TNewComboBox');
  237. Cl.AddClassN(Cl.FindClass('TListBox'), 'TNewListBox');
  238. Cl.AddClassN(Cl.FindClass('TButton'), 'TNewButton');
  239. Cl.AddClassN(Cl.FindClass('TCheckBox'), 'TNewCheckBox');
  240. Cl.AddClassN(Cl.FindClass('TRadioButton'), 'TNewRadioButton');
  241. with Cl.AddClassN(Cl.FindClass('TLinkLabel'), 'TNewLinkLabel') do
  242. begin
  243. RegisterMethod('function AdjustHeight: Integer');
  244. end;
  245. end;
  246. procedure RegisterNewNotebook_C(Cl: TPSPascalCompiler);
  247. begin
  248. Cl.AddClassN(Cl.FindClass('TCustomControl'),'TNewNotebookPage');
  249. with Cl.AddClassN(Cl.FindClass('TWinControl'),'TNewNotebook') do
  250. begin
  251. RegisterMethod('function FindNextPage(CurPage: TNewNotebookPage; GoForward: Boolean): TNewNotebookPage');
  252. RegisterProperty('Anchors', 'TAnchors', iptrw);
  253. RegisterProperty('PageCount', 'Integer', iptr);
  254. RegisterProperty('Pages', 'TNewNotebookPage Integer', iptr);
  255. RegisterProperty('ActivePage', 'TNewNotebookPage', iptrw);
  256. end;
  257. end;
  258. procedure RegisterNewNotebookPage_C(Cl: TPSPascalCompiler);
  259. begin
  260. with Cl.FindClass('TNewNotebookPage') do
  261. begin
  262. RegisterProperty('Color', 'TColor', iptrw);
  263. RegisterProperty('Notebook', 'TNewNotebook', iptrw);
  264. RegisterProperty('PageIndex', 'Integer', iptrw);
  265. end;
  266. end;
  267. procedure RegisterUIStateForm_C(Cl: TPSPascalCompiler);
  268. begin
  269. Cl.AddClassN(Cl.FindClass('TForm'), 'TUIStateForm');
  270. end;
  271. procedure RegisterSetupForm_C(Cl: TPSPascalCompiler);
  272. begin
  273. with Cl.AddClassN(Cl.FindClass('TUIStateForm'), 'TSetupForm') do
  274. begin
  275. RegisterMethod('function CalculateButtonWidth(const ButtonCaptions: array of String): Integer;');
  276. RegisterMethod('function ShouldSizeX: Boolean;');
  277. RegisterMethod('function ShouldSizeY: Boolean;');
  278. RegisterMethod('procedure FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean; const CenterInsideControlCtl: TWinControl; const CenterInsideControlInsideClientArea: Boolean)');
  279. RegisterProperty('ControlsFlipped', 'Boolean', iptr);
  280. RegisterProperty('FlipControlsOnShow', 'Boolean', iptrw);
  281. RegisterProperty('KeepSizeY', 'Boolean', iptrw);
  282. RegisterProperty('RightToLeft', 'Boolean', iptr);
  283. RegisterProperty('SizeAndCenterOnShow', 'Boolean', iptrw);
  284. end;
  285. end;
  286. procedure RegisterWizardForm_C(Cl: TPSPascalCompiler);
  287. begin
  288. with Cl.AddClassN(Cl.FindClass('TSetupForm'), 'TWizardForm') do
  289. begin
  290. RegisterProperty('CancelButton', 'TNewButton', iptr);
  291. RegisterProperty('NextButton', 'TNewButton', iptr);
  292. RegisterProperty('BackButton', 'TNewButton', iptr);
  293. RegisterProperty('OuterNotebook', 'TNewNotebook', iptr);
  294. RegisterProperty('InnerNotebook', 'TNewNotebook', iptr);
  295. RegisterProperty('WelcomePage', 'TNewNotebookPage', iptr);
  296. RegisterProperty('InnerPage', 'TNewNotebookPage', iptr);
  297. RegisterProperty('FinishedPage', 'TNewNotebookPage', iptr);
  298. RegisterProperty('LicensePage', 'TNewNotebookPage', iptr);
  299. RegisterProperty('PasswordPage', 'TNewNotebookPage', iptr);
  300. RegisterProperty('InfoBeforePage', 'TNewNotebookPage', iptr);
  301. RegisterProperty('UserInfoPage', 'TNewNotebookPage', iptr);
  302. RegisterProperty('SelectDirPage', 'TNewNotebookPage', iptr);
  303. RegisterProperty('SelectComponentsPage', 'TNewNotebookPage', iptr);
  304. RegisterProperty('SelectProgramGroupPage', 'TNewNotebookPage', iptr);
  305. RegisterProperty('SelectTasksPage', 'TNewNotebookPage', iptr);
  306. RegisterProperty('ReadyPage', 'TNewNotebookPage', iptr);
  307. RegisterProperty('PreparingPage', 'TNewNotebookPage', iptr);
  308. RegisterProperty('InstallingPage', 'TNewNotebookPage', iptr);
  309. RegisterProperty('InfoAfterPage', 'TNewNotebookPage', iptr);
  310. RegisterProperty('DiskSpaceLabel', 'TNewStaticText', iptr);
  311. RegisterProperty('DirEdit', 'TEdit', iptr);
  312. RegisterProperty('GroupEdit', 'TNewEdit', iptr);
  313. RegisterProperty('NoIconsCheck', 'TNewCheckBox', iptr);
  314. RegisterProperty('PasswordLabel', 'TNewStaticText', iptr);
  315. RegisterProperty('PasswordEdit', 'TPasswordEdit', iptr);
  316. RegisterProperty('PasswordEditLabel', 'TNewStaticText', iptr);
  317. RegisterProperty('ReadyMemo', 'TNewMemo', iptr);
  318. RegisterProperty('TypesCombo', 'TNewComboBox', iptr);
  319. RegisterProperty('Bevel', 'TBevel', iptr);
  320. RegisterProperty('WizardBitmapImage', 'TBitmapImage', iptr);
  321. RegisterProperty('WelcomeLabel1', 'TNewStaticText', iptr);
  322. RegisterProperty('InfoBeforeMemo', 'TRichEditViewer', iptr);
  323. RegisterProperty('InfoBeforeClickLabel', 'TNewStaticText', iptr);
  324. RegisterProperty('MainPanel', 'TPanel', iptr);
  325. RegisterProperty('Bevel1', 'TBevel', iptr);
  326. RegisterProperty('PageNameLabel', 'TNewStaticText', iptr);
  327. RegisterProperty('PageDescriptionLabel', 'TNewStaticText', iptr);
  328. RegisterProperty('WizardSmallBitmapImage', 'TBitmapImage', iptr);
  329. RegisterProperty('ReadyLabel', 'TNewStaticText', iptr);
  330. RegisterProperty('FinishedLabel', 'TNewStaticText', iptr);
  331. RegisterProperty('YesRadio', 'TNewRadioButton', iptr);
  332. RegisterProperty('NoRadio', 'TNewRadioButton', iptr);
  333. RegisterProperty('WizardBitmapImage2', 'TBitmapImage', iptr);
  334. RegisterProperty('WelcomeLabel2', 'TNewStaticText', iptr);
  335. RegisterProperty('LicenseLabel1', 'TNewStaticText', iptr);
  336. RegisterProperty('LicenseMemo', 'TRichEditViewer', iptr);
  337. RegisterProperty('InfoAfterMemo', 'TRichEditViewer', iptr);
  338. RegisterProperty('InfoAfterClickLabel', 'TNewStaticText', iptr);
  339. RegisterProperty('ComponentsList', 'TNewCheckListBox', iptr);
  340. RegisterProperty('ComponentsDiskSpaceLabel', 'TNewStaticText', iptr);
  341. RegisterProperty('BeveledLabel', 'TNewStaticText', iptr);
  342. RegisterProperty('StatusLabel', 'TNewStaticText', iptr);
  343. RegisterProperty('FilenameLabel', 'TNewStaticText', iptr);
  344. RegisterProperty('ProgressGauge', 'TNewProgressBar', iptr);
  345. RegisterProperty('SelectDirLabel', 'TNewStaticText', iptr);
  346. RegisterProperty('SelectStartMenuFolderLabel', 'TNewStaticText', iptr);
  347. RegisterProperty('SelectComponentsLabel', 'TNewStaticText', iptr);
  348. RegisterProperty('SelectTasksLabel', 'TNewStaticText', iptr);
  349. RegisterProperty('LicenseAcceptedRadio', 'TNewRadioButton', iptr);
  350. RegisterProperty('LicenseNotAcceptedRadio', 'TNewRadioButton', iptr);
  351. RegisterProperty('UserInfoNameLabel', 'TNewStaticText', iptr);
  352. RegisterProperty('UserInfoNameEdit', 'TNewEdit', iptr);
  353. RegisterProperty('UserInfoOrgLabel', 'TNewStaticText', iptr);
  354. RegisterProperty('UserInfoOrgEdit', 'TNewEdit', iptr);
  355. RegisterProperty('PreparingErrorBitmapImage', 'TBitmapImage', iptr);
  356. RegisterProperty('PreparingLabel', 'TNewStaticText', iptr);
  357. RegisterProperty('FinishedHeadingLabel', 'TNewStaticText', iptr);
  358. RegisterProperty('UserInfoSerialLabel', 'TNewStaticText', iptr);
  359. RegisterProperty('UserInfoSerialEdit', 'TNewEdit', iptr);
  360. RegisterProperty('TasksList', 'TNewCheckListBox', iptr);
  361. RegisterProperty('RunList', 'TNewCheckListBox', iptr);
  362. RegisterProperty('DirBrowseButton', 'TNewButton', iptr);
  363. RegisterProperty('GroupBrowseButton', 'TNewButton', iptr);
  364. RegisterProperty('SelectDirBitmapImage', 'TBitmapImage', iptr);
  365. RegisterProperty('SelectGroupBitmapImage', 'TBitmapImage', iptr);
  366. RegisterProperty('SelectDirBrowseLabel', 'TNewStaticText', iptr);
  367. RegisterProperty('SelectStartMenuFolderBrowseLabel', 'TNewStaticText', iptr);
  368. RegisterProperty('PreparingYesRadio', 'TNewRadioButton', iptr);
  369. RegisterProperty('PreparingNoRadio', 'TNewRadioButton', iptr);
  370. RegisterProperty('PreparingMemo', 'TNewMemo', iptr);
  371. RegisterProperty('CurPageID', 'Integer', iptr);
  372. RegisterMethod('function AdjustLabelHeight(ALabel: TNewStaticText): Integer');
  373. RegisterMethod('function AdjustLinkLabelHeight(ALinkLabel: TNewLinkLabel): Integer');
  374. RegisterMethod('procedure IncTopDecHeight(AControl: TControl; Amount: Integer)');
  375. RegisterProperty('PrevAppDir', 'String', iptr);
  376. end;
  377. end;
  378. procedure RegisterUninstallProgressForm_C(Cl: TPSPascalCompiler);
  379. begin
  380. with Cl.AddClassN(Cl.FindClass('TSetupForm'), 'TUninstallProgressForm') do
  381. begin
  382. RegisterProperty('OuterNotebook', 'TNewNotebook', iptr);
  383. RegisterProperty('InnerPage', 'TNewNotebookPage', iptr);
  384. RegisterProperty('InnerNotebook', 'TNewNotebook', iptr);
  385. RegisterProperty('InstallingPage', 'TNewNotebookPage', iptr);
  386. RegisterProperty('MainPanel', 'TPanel', iptr);
  387. RegisterProperty('PageNameLabel', 'TNewStaticText', iptr);
  388. RegisterProperty('PageDescriptionLabel', 'TNewStaticText', iptr);
  389. RegisterProperty('WizardSmallBitmapImage', 'TBitmapImage', iptr);
  390. RegisterProperty('Bevel1', 'TBevel', iptr);
  391. RegisterProperty('StatusLabel', 'TNewStaticText', iptr);
  392. RegisterProperty('ProgressBar', 'TNewProgressBar', iptr);
  393. RegisterProperty('BeveledLabel', 'TNewStaticText', iptr);
  394. RegisterProperty('Bevel', 'TBevel', iptr);
  395. RegisterProperty('CancelButton', 'TNewButton', iptr);
  396. end;
  397. end;
  398. procedure RegisterWizardPage_C(Cl: TIFPSPascalCompiler);
  399. var
  400. NewClass: TPSCompileTimeClass;
  401. begin
  402. NewClass := Cl.AddClassN(Cl.FindClass('TComponent'), 'TWizardPage');
  403. CL.AddTypeS('TWizardPageNotifyEvent', 'procedure(Sender: TWizardPage)');
  404. CL.AddTypeS('TWizardPageButtonEvent', 'function(Sender: TWizardPage): Boolean');
  405. CL.AddTypeS('TWizardPageCancelEvent', 'procedure(Sender: TWizardPage; var ACancel, AConfirm: Boolean)');
  406. CL.AddTypeS('TWizardPageShouldSkipEvent', 'function(Sender: TWizardPage): Boolean');
  407. with NewClass do
  408. begin
  409. RegisterProperty('ID', 'Integer', iptr);
  410. RegisterProperty('Caption', 'String', iptrw);
  411. RegisterProperty('Description', 'String', iptrw);
  412. RegisterProperty('Surface', 'TNewNotebookPage', iptr);
  413. RegisterProperty('SurfaceColor', 'TColor', iptr);
  414. RegisterProperty('SurfaceHeight', 'Integer', iptr);
  415. RegisterProperty('SurfaceWidth', 'Integer', iptr);
  416. RegisterProperty('OnActivate', 'TWizardPageNotifyEvent', iptrw);
  417. RegisterProperty('OnBackButtonClick', 'TWizardPageButtonEvent', iptrw);
  418. RegisterProperty('OnCancelButtonClick', 'TWizardPageCancelEvent', iptrw);
  419. RegisterProperty('OnNextButtonClick', 'TWizardPageButtonEvent', iptrw);
  420. RegisterProperty('OnShouldSkipPage', 'TWizardPageShouldSkipEvent', iptrw);
  421. end;
  422. end;
  423. procedure RegisterInputQueryWizardPage_C(Cl: TPSPascalCompiler);
  424. begin
  425. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TInputQueryWizardPage') do
  426. begin
  427. RegisterMethod('function Add(const APrompt: String; const APassword: Boolean): Integer');
  428. RegisterProperty('Edits', 'TPasswordEdit Integer', iptr);
  429. RegisterProperty('PromptLabels', 'TNewStaticText Integer', iptr);
  430. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  431. RegisterProperty('Values', 'String Integer', iptrw);
  432. end;
  433. end;
  434. procedure RegisterInputOptionWizardPage_C(Cl: TPSPascalCompiler);
  435. begin
  436. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TInputOptionWizardPage') do
  437. begin
  438. RegisterMethod('function Add(const ACaption: String): Integer');
  439. RegisterMethod('function AddEx(const ACaption: String; const ALevel: Byte; const AExclusive: Boolean): Integer');
  440. RegisterProperty('CheckListBox', 'TNewCheckListBox', iptr);
  441. RegisterProperty('SelectedValueIndex', 'Integer', iptrw);
  442. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  443. RegisterProperty('Values', 'Boolean Integer', iptrw);
  444. end;
  445. end;
  446. procedure RegisterInputDirWizardPage_C(CL: TPSPascalCompiler);
  447. begin
  448. with CL.AddClassN(CL.FindClass('TWizardPage'),'TInputDirWizardPage') do
  449. begin
  450. RegisterMethod('function Add(const APrompt: String): Integer');
  451. RegisterProperty('Buttons', 'TNewButton Integer', iptr);
  452. RegisterProperty('Edits', 'TEdit Integer', iptr);
  453. RegisterProperty('NewFolderName', 'String', iptrw);
  454. RegisterProperty('PromptLabels', 'TNewStaticText Integer', iptr);
  455. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  456. RegisterProperty('Values', 'String Integer', iptrw);
  457. end;
  458. end;
  459. procedure RegisterInputFileWizardPage_C(Cl: TPSPascalCompiler);
  460. begin
  461. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TInputFileWizardPage') do
  462. begin
  463. RegisterMethod('function Add(const APrompt, AFilter, ADefaultExtension: String): Integer');
  464. RegisterProperty('Buttons', 'TNewButton Integer', iptr);
  465. RegisterProperty('Edits', 'TEdit Integer', iptr);
  466. RegisterProperty('PromptLabels', 'TNewStaticText Integer', iptr);
  467. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  468. RegisterProperty('Values', 'String Integer', iptrw);
  469. RegisterProperty('IsSaveButton', 'Boolean Integer', iptrw);
  470. end;
  471. end;
  472. procedure RegisterOutputMsgWizardPage_C(Cl: TPSPascalCompiler);
  473. begin
  474. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TOutputMsgWizardPage') do
  475. begin
  476. RegisterProperty('MsgLabel', 'TNewStaticText', iptr);
  477. end;
  478. end;
  479. procedure RegisterOutputMsgMemoWizardPage_C(Cl: TPSPascalCompiler);
  480. begin
  481. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TOutputMsgMemoWizardPage') do
  482. begin
  483. RegisterProperty('RichEditViewer', 'TRichEditViewer', iptr);
  484. RegisterProperty('SubCaptionLabel', 'TNewStaticText', iptr);
  485. end;
  486. end;
  487. procedure RegisterOutputProgressWizardPage_C(Cl: TPSPascalCompiler);
  488. begin
  489. with CL.AddClassN(Cl.FindClass('TWizardPage'),'TOutputProgressWizardPage') do
  490. begin
  491. RegisterMethod('procedure Hide');
  492. RegisterProperty('Msg1Label', 'TNewStaticText', iptr);
  493. RegisterProperty('Msg2Label', 'TNewStaticText', iptr);
  494. RegisterProperty('ProgressBar', 'TNewProgressBar', iptr);
  495. RegisterMethod('procedure SetProgress(const Position, Max: Longint)');
  496. RegisterMethod('procedure SetText(const Msg1, Msg2: String)');
  497. RegisterMethod('procedure Show');
  498. end;
  499. end;
  500. procedure RegisterOutputMarqueeProgressWizardPage_C(Cl: TPSPascalCompiler);
  501. begin
  502. with CL.AddClassN(Cl.FindClass('TOutputProgressWizardPage'),'TOutputMarqueeProgressWizardPage') do
  503. begin
  504. RegisterMethod('procedure Animate');
  505. RegisterMethod('procedure SetProgress(const Position, Max: Longint)'); { Only used to stop the script from called TOutputProgressWizardPage.SetProgress }
  506. end;
  507. end;
  508. procedure RegisterDownloadWizardPage_C(Cl: TPSPascalCompiler);
  509. begin
  510. with CL.AddClassN(Cl.FindClass('TOutputProgressWizardPage'),'TDownloadWizardPage') do
  511. begin
  512. RegisterProperty('AbortButton', 'TNewButton', iptr);
  513. RegisterProperty('AbortedByUser', 'Boolean', iptr);
  514. RegisterProperty('ShowBaseNameInsteadOfUrl', 'Boolean', iptrw);
  515. RegisterMethod('function Add(const Url, BaseName, RequiredSHA256OfFile: String): Integer');
  516. RegisterMethod('function AddWithISSigVerify(const Url, IssigUrl, BaseName: String; const AllowedKeysRuntimeIDs: TStringList): Integer;');
  517. RegisterMethod('function AddEx(const Url, BaseName, RequiredSHA256OfFile, UserName, Password: String): Integer');
  518. RegisterMethod('function AddExWithISSigVerify(const Url, IssigUrl, BaseName, UserName, Password: String; const AllowedKeysRuntimeIDs: TStringList): Integer;');
  519. RegisterMethod('procedure Clear');
  520. RegisterMethod('function Download: Int64');
  521. RegisterMethod('procedure Show'); { Without this TOutputProgressWizardPage's Show will be called }
  522. end;
  523. end;
  524. procedure RegisterExtractionWizardPage_C(Cl: TPSPascalCompiler);
  525. begin
  526. with CL.AddClassN(Cl.FindClass('TOutputProgressWizardPage'),'TExtractionWizardPage') do
  527. begin
  528. RegisterProperty('AbortButton', 'TNewButton', iptr);
  529. RegisterProperty('AbortedByUser', 'Boolean', iptr);
  530. RegisterProperty('ShowArchiveInsteadOfFile', 'Boolean', iptrw);
  531. RegisterMethod('function Add(const ArchiveFileName, DestDir: String; const FullPaths: Boolean): Integer');
  532. RegisterMethod('function AddEx(const ArchiveFileName, DestDir, Password: String; const FullPaths: Boolean): Integer');
  533. RegisterMethod('procedure Clear');
  534. RegisterMethod('procedure Extract');
  535. RegisterMethod('procedure Show'); { Without this TOutputProgressWizardPage's Show will be called }
  536. end;
  537. end;
  538. procedure RegisterHandCursor_C(Cl: TPSPascalCompiler);
  539. begin
  540. cl.AddConstantN('crHand', 'Integer').Value.ts32 := crHand;
  541. end;
  542. procedure ScriptClassesLibraryRegister_C(Cl: TPSPascalCompiler);
  543. const
  544. clSystemColor = $FF000000;
  545. begin
  546. { Std }
  547. SIRegister_Std_TypesAndConsts(Cl);
  548. SIRegisterTObject(Cl);
  549. SIRegisterTPersistent(Cl);
  550. SIRegisterTComponent(Cl);
  551. { Classes }
  552. SIRegister_Classes_TypesAndConsts(Cl);
  553. SIRegisterTStream(Cl);
  554. SIRegisterTStrings(Cl, True);
  555. SIRegisterTStringList(Cl);
  556. SIRegisterTHandleStream(Cl);
  557. SIRegisterTFileStream(Cl);
  558. SIRegisterTStringStream(Cl);
  559. { Graphics }
  560. SIRegister_Graphics_TypesAndConsts(Cl);
  561. cl.AddConstantN('clHotLight', 'Integer').Value.ts32 := Integer(clSystemColor or COLOR_HOTLIGHT);
  562. SIRegisterTGraphicsObject(Cl);
  563. SIRegisterTFont(Cl);
  564. SIRegisterTPen(Cl);
  565. SIRegisterTBrush(Cl);
  566. SIRegisterTCanvas(Cl);
  567. SIRegisterTGraphic(Cl);
  568. SIRegisterTBitmap(Cl, True);
  569. { Controls }
  570. SIRegister_Controls_TypesAndConsts(Cl);
  571. SIRegisterTDragObject(Cl);
  572. SIRegisterTSizeConstraints(Cl);
  573. SIRegisterTControl(Cl);
  574. RegisterWinControl_C(Cl);
  575. SIRegisterTGraphicControl(Cl);
  576. SIRegisterTCustomControl(Cl);
  577. { Forms }
  578. SIRegister_Forms_TypesAndConsts(Cl);
  579. SIRegisterTScrollingWinControl(Cl);
  580. SIRegisterTForm(Cl);
  581. { StdCtrls }
  582. SIRegister_StdCtrls_TypesAndConsts(Cl);
  583. SIRegisterTCustomLabel(Cl);
  584. SIRegisterTLabel(Cl);
  585. SIRegisterTCustomEdit(Cl);
  586. SIRegisterTEdit(Cl);
  587. SIRegisterTCustomMemo(Cl);
  588. SIRegisterTMemo(Cl);
  589. SIRegisterTCustomComboBox(Cl);
  590. SIRegisterTComboBox(Cl);
  591. SIRegisterTButtonControl(Cl);
  592. SIRegisterTButton(Cl);
  593. SIRegisterTCustomCheckBox(Cl);
  594. SIRegisterTCheckBox(Cl);
  595. SIRegisterTRadioButton(Cl);
  596. SIRegisterTCustomListBox(Cl);
  597. SIRegisterTListBox(Cl);
  598. { ExtCtrls }
  599. SIRegister_ExtCtrls_TypesAndConsts(cl);
  600. SIRegisterTBevel(Cl);
  601. SIRegisterTCustomPanel(Cl);
  602. SIRegisterTPanel(Cl);
  603. SIRegisterTCustomLinkLabel(Cl);
  604. SIRegisterTLinkLabel(Cl);
  605. { ComObj }
  606. SIRegister_ComObj(Cl);
  607. RegisterNewStaticText_C(Cl);
  608. RegisterNewCheckListBox_C(Cl);
  609. RegisterNewProgressBar_C(Cl);
  610. RegisterRichEditViewer_C(Cl);
  611. RegisterPasswordEdit_C(Cl);
  612. RegisterCustomFolderTreeView_C(Cl);
  613. RegisterFolderTreeView_C(Cl);
  614. RegisterStartMenuFolderTreeView_C(Cl);
  615. RegisterBitmapImage_C(Cl);
  616. RegisterBidiCtrls_C(Cl);
  617. RegisterNewNotebook_C(Cl);
  618. RegisterNewNotebookPage_C(Cl);
  619. RegisterUIStateForm_C(Cl);
  620. RegisterSetupForm_C(Cl);
  621. RegisterWizardForm_C(Cl);
  622. RegisterUninstallProgressForm_C(Cl);
  623. RegisterWizardPage_C(Cl);
  624. RegisterInputQueryWizardPage_C(Cl);
  625. RegisterInputOptionWizardPage_C(Cl);
  626. RegisterInputDirWizardPage_C(Cl);
  627. RegisterInputFileWizardPage_C(Cl);
  628. RegisterOutputMsgWizardPage_C(Cl);
  629. RegisterOutputMsgMemoWizardPage_C(Cl);
  630. RegisterOutputProgressWizardPage_C(Cl);
  631. RegisterOutputMarqueeProgressWizardPage_C(Cl);
  632. RegisterDownloadWizardPage_C(Cl);
  633. RegisterExtractionWizardPage_C(Cl);
  634. RegisterHandCursor_C(Cl);
  635. AddImportedClassVariable(Cl, 'WizardForm', 'TWizardForm');
  636. AddImportedClassVariable(Cl, 'UninstallProgressForm', 'TUninstallProgressForm');
  637. end;
  638. end.