/thirdparty/InnoSetup/Skin/isxskin.iss

https://github.com/the-Arioch/jcl · Unknown · 638 lines · 615 code · 23 blank · 0 comment · 0 complexity · b3b13c40236c00baa8b25e554463ceb8 MD5 · raw file

  1. [Files]
  2. Source: {#MyWizardButtonImageFile}; DestDir: {tmp}; Flags: dontcopy
  3. Source: {#MyWizardBottomImageFile}; DestDir: {tmp}; Flags: dontcopy
  4. [Code]
  5. const
  6. MAINPANELCOLOR = $663300;
  7. PAGECOLOR = $ab663d;
  8. BUTTONPANELCOLOR = $603A2B;
  9. BUTTONWIDTH = 100;
  10. BUTTONHEIGHT = 27;
  11. bidBack = 0;
  12. bidNext = 1;
  13. bidCancel = 2;
  14. bidDirBrowse = 3;
  15. bidGroupBrowse = 4;
  16. var
  17. ButtonPanels: array [0..4] of TPanel;
  18. ButtonImages: array [0..4] of TBitmapImage;
  19. ButtonLabels: array [0..4] of TLabel;
  20. procedure UpdateButton(AButton: TButton; AButtonIndex: integer);
  21. begin
  22. ButtonLabels[AButtonIndex].Caption := AButton.Caption;
  23. ButtonPanels[AButtonIndex].Visible := AButton.Visible;
  24. ButtonLabels[AButtonIndex].Enabled := AButton.Enabled;
  25. end;
  26. procedure ButtonLabelClick(Sender: TObject);
  27. var
  28. button: TButton;
  29. begin
  30. ButtonImages[TLabel(Sender).Tag].Left := 0;
  31. if not ButtonLabels[TLabel(Sender).Tag].Enabled then
  32. Exit;
  33. case TLabel(Sender).Tag of
  34. bidBack: button := WizardForm.BackButton;
  35. bidNext: button := WizardForm.NextButton;
  36. bidCancel: button := WizardForm.CancelButton;
  37. bidDirBrowse: button := WizardForm.DirBrowseButton;
  38. bidGroupBrowse: button := WizardForm.GroupBrowseButton;
  39. else
  40. Exit;
  41. end;
  42. button.OnClick(button);
  43. end;
  44. procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  45. begin
  46. if (Button=mbLeft) and (ButtonLabels[TLabel(Sender).Tag].Enabled) then
  47. ButtonImages[TLabel(Sender).Tag].Left := -BUTTONWIDTH;
  48. end;
  49. procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  50. begin
  51. ButtonImages[TLabel(Sender).Tag].Left := 0;
  52. end;
  53. procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
  54. var
  55. image: TBitmapImage;
  56. panel: TPanel;
  57. labl: TLabel;
  58. FileName: String;
  59. begin
  60. panel := TPanel.Create(WizardForm);
  61. with panel do begin
  62. Parent := AButton.Parent;
  63. Color := BUTTONPANELCOLOR;
  64. Tag := AButtonIndex;
  65. Left := AButton.Left;
  66. Top := AButton.Top;
  67. Width := AButton.Width;
  68. Height := AButton.Height;
  69. end;
  70. ButtonPanels[AButtonIndex] := panel;
  71. image := TBitmapImage.Create(WizardForm);
  72. FileName := ExtractFileName('{#MyWizardButtonImageFile}');
  73. with image do begin
  74. Height := BUTTONHEIGHT;
  75. Width := BUTTONWIDTH*2;
  76. Bitmap.LoadFromFile(ExpandConstant('{tmp}\')+FileName);
  77. Parent := panel;
  78. Enabled := false;
  79. end;
  80. ButtonImages[AButtonIndex] := image;
  81. with TLabel.Create(WizardForm) do begin
  82. Tag := AButtonIndex;
  83. Parent := panel;
  84. Width := panel.Width;
  85. Height := panel.Height;
  86. transparent := true;
  87. OnClick := @ButtonLabelClick;
  88. OnDblClick := @ButtonLabelClick;
  89. OnMouseDown := @ButtonLabelMouseDown;
  90. OnMouseUp := @ButtonLabelMouseUp;
  91. end;
  92. labl := TLabel.Create(WizardForm);
  93. with labl do begin
  94. Tag := AButtonIndex;
  95. Alignment := taCenter;
  96. Transparent := true;
  97. AutoSize := false;
  98. Top := (BUTTONHEIGHT div 4);
  99. Left := 0;
  100. Width := panel.ClientWidth;
  101. Parent := panel;
  102. if AButtonIndex = bidNext then
  103. Font.Style := [fsBold];
  104. Font.Color := clWhite;
  105. Caption := AButton.Caption;
  106. OnClick := @ButtonLabelClick;
  107. OnDblClick := @ButtonLabelClick;
  108. OnMouseDown := @ButtonLabelMouseDown;
  109. OnMouseUp := @ButtonLabelMouseUp;
  110. end;
  111. ButtonLabels[AButtonIndex] := labl;
  112. end;
  113. procedure LicenceAcceptedRadioOnClick(Sender: TObject);
  114. begin
  115. ButtonLabels[bidNext].Enabled := true;
  116. end;
  117. procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
  118. begin
  119. ButtonLabels[bidNext].Enabled := false;
  120. end;
  121. procedure InitializeSkin;
  122. var
  123. image: TBitmapImage;
  124. TypesComboItemIndex: integer;
  125. FileName: String;
  126. begin
  127. with WizardForm do
  128. with OuterNotebook do
  129. with InnerPage do
  130. with InnerNotebook do
  131. with SelectComponentsPage do
  132. TypesComboItemIndex := TypesCombo.ItemIndex;
  133. WizardForm.Bevel.Hide;
  134. WizardForm.Bevel1.Hide;
  135. WizardForm.SelectDirBitmapImage.Hide;
  136. WizardForm.SelectGroupBitmapImage.Hide;
  137. image := TBitmapImage.Create(WizardForm);
  138. image.Top := 451;
  139. image.Width := 690;
  140. image.Height := 45;
  141. FileName := ExtractFileName('{#MyWizardBottomImageFile}');
  142. ExtractTemporaryFile(FileName);
  143. image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\')+FileName);
  144. image.Parent := WizardForm;
  145. image.SendToBack;
  146. with WizardForm do begin
  147. Position := poScreenCenter;
  148. ClientWidth := 690
  149. ClientHeight := 496
  150. Font.Color := $ffffff
  151. Font.Name := 'MS Sans Serif'
  152. Font.Style := []
  153. with CancelButton do begin
  154. Left := 555
  155. Top := 460
  156. Width := BUTTONWIDTH;
  157. Height := BUTTONHEIGHT;
  158. end;
  159. with NextButton do begin
  160. Left := 371
  161. Top := 460
  162. Width := BUTTONWIDTH;
  163. Height := BUTTONHEIGHT;
  164. end;
  165. with BackButton do begin
  166. Left := 266
  167. Top := 460
  168. Width := BUTTONWIDTH;
  169. Height := BUTTONHEIGHT;
  170. end;
  171. with OuterNotebook do begin
  172. Left := 190
  173. Top := 59
  174. Width := 500
  175. Height := 392
  176. with WelcomePage do begin
  177. Color := PAGECOLOR;
  178. with WizardBitmapImage do begin
  179. Parent := WizardForm
  180. Left := 0
  181. Top := 60
  182. Width := 190
  183. Height := 391
  184. end;
  185. with WelcomeLabel2 do begin
  186. Left := 35
  187. Top := 171
  188. Width := 465
  189. Height := 200
  190. end;
  191. with WelcomeLabel1 do begin
  192. Left := 35
  193. Top := 131
  194. Width := 465
  195. Height := 28
  196. Font.Size := 8
  197. Font.Color := $ffffff
  198. end;
  199. end;
  200. with InnerPage do begin
  201. with InnerNotebook do begin
  202. Left := 20
  203. Top := 20
  204. Width := 465
  205. Height := 354
  206. Color := PAGECOLOR;
  207. with LicensePage do begin
  208. with LicenseNotAcceptedRadio do begin
  209. Left := 0
  210. Top := 338
  211. Width := 17
  212. Height := 17
  213. OnClick := @LicenceNotAcceptedRadioOnClick;
  214. end;
  215. with LicenseAcceptedRadio do begin
  216. Left := 0
  217. Top := 318
  218. Width := 17
  219. Height := 17
  220. OnClick := @LicenceAcceptedRadioOnClick;
  221. end;
  222. with LicenseMemo do begin
  223. Left := 0
  224. Top := 38
  225. Width := 465
  226. Height := 266
  227. end;
  228. with LicenseLabel1 do begin
  229. Left := 0
  230. Top := 0
  231. Width := 465
  232. Height := 28
  233. end;
  234. end;
  235. with PasswordPage do begin
  236. with PasswordEdit do begin
  237. Left := 0
  238. Top := 50
  239. Width := 465
  240. Height := 21
  241. Color := $ffffff
  242. Font.Color := $000000
  243. end;
  244. with PasswordEditLabel do begin
  245. Left := 0
  246. Top := 34
  247. Width := 465
  248. Height := 14
  249. end;
  250. with PasswordLabel do begin
  251. Left := 0
  252. Top := 0
  253. Width := 465
  254. Height := 28
  255. end;
  256. end;
  257. with InfoBeforePage do begin
  258. with InfoBeforeMemo do begin
  259. Left := 0
  260. Top := 24
  261. Width := 465
  262. Height := 327
  263. end;
  264. with InfoBeforeClickLabel do begin
  265. Left := 0
  266. Top := 0
  267. Width := 465
  268. Height := 14
  269. end;
  270. end;
  271. with UserInfoPage do begin
  272. with UserInfoSerialEdit do begin
  273. Left := 0
  274. Top := 120
  275. Width := 465
  276. Height := 21
  277. Color := $ffffff
  278. Font.Color := $000000
  279. end;
  280. with UserInfoSerialLabel do begin
  281. Left := 0
  282. Top := 104
  283. Width := 465
  284. Height := 14
  285. end;
  286. with UserInfoOrgEdit do begin
  287. Left := 0
  288. Top := 68
  289. Width := 465
  290. Height := 21
  291. Color := $ffffff
  292. Font.Color := $000000
  293. end;
  294. with UserInfoOrgLabel do begin
  295. Left := 0
  296. Top := 52
  297. Width := 465
  298. Height := 14
  299. end;
  300. with UserInfoNameEdit do begin
  301. Left := 0
  302. Top := 16
  303. Width := 465
  304. Height := 21
  305. Color := $ffffff
  306. Font.Color := $000000
  307. end;
  308. with UserInfoNameLabel do begin
  309. Left := 0
  310. Top := 0
  311. Width := 465
  312. Height := 14
  313. end;
  314. end;
  315. with SelectDirPage do begin
  316. with DiskSpaceLabel do begin
  317. Left := 0
  318. Top := 340
  319. Width := 465
  320. Height := 14
  321. end;
  322. with DirBrowseButton do begin
  323. Left := 368
  324. Top := 288
  325. Width := BUTTONWIDTH;
  326. Height := BUTTONHEIGHT;
  327. end;
  328. with DirEdit do begin
  329. Left := 0
  330. Top := 290
  331. Width := 350
  332. Height := 21
  333. Color := $ffffff
  334. Font.Color := $000000
  335. end;
  336. with SelectDirBrowseLabel do begin
  337. Left := 0
  338. Top := 24
  339. Width := 465
  340. Height := 28
  341. end;
  342. with SelectDirLabel do begin
  343. Left := 0
  344. Top := 0
  345. Width := 465
  346. Height := 14
  347. end;
  348. end;
  349. with SelectComponentsPage do begin
  350. with ComponentsDiskSpaceLabel do begin
  351. Left := 0
  352. Top := 340
  353. Width := 417
  354. Height := 14
  355. end;
  356. with ComponentsList do begin
  357. Left := 0
  358. Top := 62
  359. Width := 465
  360. Height := 261
  361. Color := $ffffff
  362. Font.Color := $000000
  363. end;
  364. with TypesCombo do begin
  365. Left := 0
  366. Top := 38
  367. Width := 465
  368. Height := 21
  369. Color := $ffffff
  370. Font.Color := $000000
  371. ItemIndex := TypesComboItemIndex;
  372. end;
  373. with SelectComponentsLabel do begin
  374. Left := 0
  375. Top := 0
  376. Width := 465
  377. Height := 28
  378. end;
  379. end;
  380. with SelectProgramGroupPage do begin
  381. with NoIconsCheck do begin
  382. Left := 0
  383. Top := 337
  384. Width := 17
  385. Height := 17
  386. Visible := True
  387. end;
  388. with GroupBrowseButton do begin
  389. Left := 368
  390. Top := 288
  391. Width := BUTTONWIDTH;
  392. Height := BUTTONHEIGHT;
  393. end;
  394. with GroupEdit do begin
  395. Left := 0
  396. Top := 290
  397. Width := 350
  398. Height := 21
  399. Color := $ffffff
  400. Font.Color := $000000
  401. end;
  402. with SelectStartMenuFolderBrowseLabel do begin
  403. Left := 0
  404. Top := 24
  405. Width := 465
  406. Height := 28
  407. end;
  408. with SelectStartMenuFolderLabel do begin
  409. Left := 0
  410. Top := 0
  411. Width := 465
  412. Height := 14
  413. end;
  414. end;
  415. with SelectTasksPage do begin
  416. with TasksList do begin
  417. Left := 0
  418. Top := 34
  419. Width := 465
  420. Height := 317
  421. Color := PAGECOLOR;
  422. end;
  423. with SelectTasksLabel do begin
  424. Left := 0
  425. Top := 0
  426. Width := 465
  427. Height := 28
  428. end;
  429. end;
  430. with ReadyPage do begin
  431. with ReadyMemo do begin
  432. Left := 0
  433. Top := 34
  434. Width := 465
  435. Height := 317
  436. Color := PAGECOLOR;
  437. //Color := $ffffff
  438. //Font.Color := $000000
  439. end;
  440. with ReadyLabel do begin
  441. Left := 0
  442. Top := 0
  443. Width := 465
  444. Height := 28
  445. end;
  446. end;
  447. with InstallingPage do begin
  448. with FilenameLabel do begin
  449. Left := 0+10
  450. Top := 16+10
  451. Width := 465
  452. Height := 16
  453. end;
  454. with StatusLabel do begin
  455. Left := 0+10
  456. Top := 0+10
  457. Width := 465
  458. Height := 16
  459. end;
  460. with ProgressGauge do begin
  461. Left := 0+10
  462. Top := 42+10
  463. Width := 465
  464. Height := 21
  465. end;
  466. with WebDownloadFilenameLabel do begin
  467. Left := 0+10
  468. Top := 16+10+80
  469. Width := 465
  470. Height := 16
  471. end;
  472. with WebDownloadStatusLabel do begin
  473. Left := 0+10
  474. Top := 0+10+80
  475. Width := 465
  476. Height := 16
  477. end;
  478. with WebDownloadProgressGauge do begin
  479. Left := 0+10
  480. Top := 42+10+80
  481. Width := 465
  482. Height := 21
  483. end;
  484. end;
  485. with InfoAfterPage do begin
  486. with InfoAfterMemo do begin
  487. Left := 0
  488. Top := 24
  489. Width := 465
  490. Height := 327
  491. end;
  492. with InfoAfterClickLabel do begin
  493. Left := 0
  494. Top := 0
  495. Width := 465
  496. Height := 14
  497. end;
  498. end;
  499. end;
  500. with MainPanel do begin
  501. Parent := WizardForm;
  502. color := MAINPANELCOLOR;
  503. Left := 0
  504. Top := 0
  505. Width := 690
  506. Height := 60
  507. with WizardSmallBitmapImage do begin
  508. Left := 0
  509. Top := 58
  510. Width := 690
  511. Height := 2
  512. end;
  513. with PageDescriptionLabel do begin
  514. Left := 25
  515. Top := 25
  516. Width := 500
  517. Height := 14
  518. Color := MAINPANELCOLOR;
  519. Font.Color := $ffffff
  520. end;
  521. with PageNameLabel do begin
  522. Left := 15
  523. Top := 7
  524. Width := 500
  525. Height := 14
  526. Color := MAINPANELCOLOR;
  527. Font.Color := $ffffff
  528. end;
  529. end;
  530. end;
  531. with FinishedPage do begin
  532. Color := PAGECOLOR;
  533. WizardBitmapImage2.hide;
  534. with NoRadio do begin
  535. Left := 35
  536. Top := 168
  537. Width := 465
  538. Height := 17
  539. end;
  540. with YesRadio do begin
  541. Left := 35
  542. Top := 140
  543. Width := 465
  544. Height := 17
  545. end;
  546. with RunList do begin
  547. Left := 35
  548. Top := 140
  549. Width := 465
  550. Height := 149
  551. end;
  552. with FinishedLabel do begin
  553. Left := 35
  554. Top := 60
  555. Width := 465
  556. Height := 53
  557. end;
  558. with FinishedHeadingLabel do begin
  559. Left := 35
  560. Top := 20
  561. Width := 465
  562. Height := 24
  563. Font.Size := 8
  564. Font.Color := $ffffff
  565. end;
  566. end;
  567. end;
  568. end;
  569. with TLabel.Create(WizardForm) do begin
  570. Left := 17
  571. Top := 320
  572. Width := 445
  573. Height := 17
  574. Color := clWhite;
  575. Transparent := true;
  576. Caption := WizardForm.LicenseAcceptedRadio.Caption
  577. Parent := WizardForm.LicensePage
  578. end;
  579. with TLabel.Create(WizardForm) do begin
  580. Left := 17
  581. Top := 320
  582. Width := 445
  583. Height := 17
  584. Color := clWhite;
  585. Transparent := true;
  586. Caption := WizardForm.LicenseAcceptedRadio.Caption
  587. Parent := WizardForm.LicensePage
  588. end;
  589. with TLabel.Create(WizardForm) do begin
  590. Left := 17
  591. Top := 340
  592. Width := 445
  593. Height := 17
  594. Color := clWhite;
  595. Transparent := true;
  596. Caption := WizardForm.LicenseNotAcceptedRadio.Caption
  597. Parent := WizardForm.LicensePage
  598. end;
  599. with TLabel.Create(WizardForm) do begin
  600. Left := 17
  601. Top := 340
  602. Width := 445
  603. Height := 17
  604. Color := clWhite;
  605. Transparent := true;
  606. Caption := WizardForm.NoIconsCheck.Caption
  607. Parent := WizardForm.SelectProgramGroupPage
  608. end;
  609. ExtractTemporaryFile(ExtractFileName('{#MyWizardButtonImageFile}'));
  610. LoadButtonImage(WizardForm.BackButton,bidBack);
  611. LoadButtonImage(WizardForm.NextButton,bidNext);
  612. LoadButtonImage(WizardForm.CancelButton,bidCancel);
  613. LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse);
  614. LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse);
  615. end;