TLama

Untitled

Dec 29th, 2013
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.56 KB | None | 0 0
  1. [Code]
  2. type
  3.   TPositionStorage = array of Integer;
  4.  
  5. var
  6.   LinkLabel: TLabel;
  7.   CompPageModified: Boolean;
  8.   CompPagePositions: TPositionStorage;
  9.  
  10. procedure LinkClick(Sender: TObject);
  11. var
  12.   ErrorCode: Integer;
  13. begin
  14.   ShellExec('', 'https://www.facebook.com/groups/jyrka98sMods/', '', '', SW_SHOW, ewNoWait,
  15.     ErrorCode);
  16. end;
  17.  
  18. procedure SaveComponentsPage(out Storage: TPositionStorage);
  19. begin
  20.   SetArrayLength(Storage, 10);
  21.  
  22.   Storage[0] := WizardForm.Height;
  23.   Storage[1] := WizardForm.NextButton.Top;
  24.   Storage[2] := WizardForm.BackButton.Top;
  25.   Storage[3] := WizardForm.CancelButton.Top;
  26.   Storage[4] := WizardForm.ComponentsList.Height;
  27.   Storage[5] := WizardForm.OuterNotebook.Height;
  28.   Storage[6] := WizardForm.InnerNotebook.Height;
  29.   Storage[7] := WizardForm.Bevel.Top;
  30.   Storage[8] := WizardForm.BeveledLabel.Top;
  31.   Storage[9] := WizardForm.ComponentsDiskSpaceLabel.Top;
  32. end;
  33.  
  34. procedure LoadComponentsPage(const Storage: TPositionStorage;
  35.   HeightOffset: Integer);
  36. begin
  37.   if GetArrayLength(Storage) <> 10 then
  38.     RaiseException('Invalid storage array length.');
  39.  
  40.   WizardForm.Height := Storage[0] + HeightOffset;
  41.   WizardForm.NextButton.Top := Storage[1] + HeightOffset;
  42.   WizardForm.BackButton.Top := Storage[2] + HeightOffset;
  43.   WizardForm.CancelButton.Top := Storage[3] + HeightOffset;
  44.   WizardForm.ComponentsList.Height := Storage[4] + HeightOffset;
  45.   WizardForm.OuterNotebook.Height := Storage[5] + HeightOffset;
  46.   WizardForm.InnerNotebook.Height := Storage[6] + HeightOffset;
  47.   WizardForm.Bevel.Top := Storage[7] + HeightOffset;
  48.   WizardForm.BeveledLabel.Top := Storage[8] + HeightOffset;
  49.   WizardForm.ComponentsDiskSpaceLabel.Top := Storage[9] + HeightOffset;
  50. end;
  51.  
  52. procedure InitializeWizard;
  53. begin
  54.   CompPageModified := False;
  55.  
  56.   LinkLabel := TLabel.Create(WizardForm);
  57.   LinkLabel.Parent := WizardForm;
  58.   LinkLabel.Left := 8;
  59.   LinkLabel.Top := WizardForm.ClientHeight -
  60.     LinkLabel.ClientHeight - 8;
  61.   LinkLabel.Cursor := crHand;
  62.   LinkLabel.Font.Color := clBlue;
  63.   LinkLabel.Font.Style := [fsUnderline];
  64.   LinkLabel.Caption := 'Visit jyrka98s mods facebook page';
  65.   LinkLabel.OnClick := @LinkClick;
  66. end;
  67.  
  68. procedure CurPageChanged(CurPageID: Integer);
  69. begin
  70.   LinkLabel.Visible := CurPageID <> wpLicense;
  71.  
  72.   if CurpageID = wpSelectComponents then
  73.   begin
  74.     SaveComponentsPage(CompPagePositions);
  75.     LoadComponentsPage(CompPagePositions, 200);
  76.     CompPageModified := True;
  77.   end
  78.   else
  79.   if CompPageModified then
  80.   begin
  81.     LoadComponentsPage(CompPagePositions, 0);
  82.     CompPageModified := False;
  83.   end;
  84. end;
Advertisement
Add Comment
Please, Sign In to add comment