PageRenderTime 33ms CodeModel.GetById 29ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

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