Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Ветеран


Сообщения: 517
Благодарности: 314

Профиль | Отправить PM | Цитировать


neorom
читать дальше »
Код: Выделить весь код
[Code]
var
  ISCustomPage1: TWizardPage;
  BitmapImage1: TBitmapImage;
  NewGroupBox1: TNewGroupBox;
  NewRadioButton1: TNewRadioButton;
  NewRadioButton2: TNewRadioButton;
  NewGroupBox2: TNewGroupBox;
  NewCheckBox1: TNewCheckBox;
  NewCheckBox2: TNewCheckBox;
  NewCheckBox3: TNewCheckBox;
  NewCheckBox4: TNewCheckBox;
  ErrorCode: Integer;
  
function InitializeSetup(): Boolean;
begin
  if not FileExists(ExpandConstant('{tmp}\01.bmp')) then ExtractTemporaryFile('01.bmp');
  if not FileExists(ExpandConstant('{tmp}\02.bmp')) then ExtractTemporaryFile('02.bmp');
  Result := True;
end;

function installer: Boolean;
begin
  Result := NewRadioButton1.Checked;
end;

function portable: Boolean;
begin
  Result := NewRadioButton2.Checked;
end;

function Icons1: Boolean;
begin
  Result:= NewCheckBox1.Checked;
end;

function Icons2: Boolean;
begin
  Result:= NewCheckBox2.Checked;
end;

function Icons3: Boolean;
begin
  Result:= NewCheckBox3.Checked;
end;

function Icons4: Boolean;
begin
  Result:= NewCheckBox4.Checked;
end;

procedure BevelLabelClick(Sender: TObject);
begin
  ShellExec('open','http://toloka.hurtom.com','', '', SW_SHOW, ewNoWait, ErrorCode)
end;

procedure NewRadioButtonClick(Sender: TObject);
begin
  case TNewRadioButton(Sender) of
    NewRadioButton1:
    begin
      NewCheckBox1.Checked:= NewRadioButton1.Checked;
      NewCheckBox2.Checked:= NewRadioButton1.Checked;
      NewCheckBox3.Checked:= NewRadioButton1.Checked;
      NewCheckBox4.Checked:= NewRadioButton1.Checked;
      NewCheckBox1.Enabled:= NewRadioButton1.Checked;
      NewCheckBox2.Enabled:= NewRadioButton1.Checked;
      NewCheckBox3.Enabled:= NewRadioButton1.Checked;
      NewCheckBox4.Enabled:= NewRadioButton1.Checked;
      BitmapImage1.Bitmap.LoadFromFile(ExpandConstant('{tmp}\01.bmp'));
    end;
    NewRadioButton2:
    begin
      NewCheckBox1.Enabled:= NewRadioButton1.Checked;
      NewCheckBox2.Enabled:= NewRadioButton1.Checked;
      NewCheckBox3.Enabled:= NewRadioButton1.Checked;
      NewCheckBox4.Enabled:= NewRadioButton1.Checked;
      NewCheckBox1.Checked:= NewRadioButton1.Checked;
      NewCheckBox2.Checked:= NewRadioButton1.Checked;
      NewCheckBox3.Checked:= NewRadioButton1.Checked;
      NewCheckBox4.Checked:= NewRadioButton1.Checked;
      BitmapImage1.Bitmap.LoadFromFile(ExpandConstant('{tmp}\02.bmp'));
    end;
  end;
end;

procedure NewCheckBox1Click(Sender: TObject); forward;
procedure NewCheckBox2Click(Sender: TObject); forward;
procedure NewCheckBox3Click(Sender: TObject); forward;
procedure NewCheckBox4Click(Sender: TObject); forward;
procedure PageNameLabelClick(Sender: TObject); forward;

procedure RedesignWizardForm;
begin
  ISCustomPage1 := CreateCustomPage(wpSelectComponents, 'Вибір типа компонентів встановлення', '  ...');
  with ISCustomPage1.Surface do
  begin
    Name := 'ISCustomPage1';
  end;

  BitmapImage1 := TBitmapImage.Create(WizardForm);
  with BitmapImage1 do
  begin
    Name := 'BitmapImage1';
    Parent := ISCustomPage1.Surface;
    Left := ScaleX(232);
    Top := ScaleY(32);
    Width := ScaleX(180);
    Height := ScaleY(180);
  end;

  NewGroupBox1 := TNewGroupBox.Create(WizardForm);
  with NewGroupBox1 do
  begin
    Name := 'NewGroupBox1';
    Parent := ISCustomPage1.Surface;
    Left := ScaleX(8);
    Top := ScaleY(8);
    Width := ScaleX(209);
    Height := ScaleY(65);
    Caption := 'Мова інтерфейсу за умовчанням';
  end;

  NewRadioButton1 := TNewRadioButton.Create(WizardForm);
  with NewRadioButton1 do
  begin
    Name := 'NewRadioButton1';
    Parent := NewGroupBox1;
    Left := ScaleX(8);
    Top := ScaleY(16);
    Width := ScaleX(196);
    Height := ScaleY(17);
    Checked := True;
    Caption := 'Встановлення звичайної версії';
    OnClick := @NewRadioButtonClick;
  end;

  NewRadioButton2 := TNewRadioButton.Create(WizardForm);
  with NewRadioButton2 do
  begin
    Name := 'NewRadioButton2';
    Parent := NewGroupBox1;
    Left := ScaleX(8);
    Top := ScaleY(40);
    Width := ScaleX(196);
    Height := ScaleY(17);
    Caption := 'Розпакування портативної версії';
    OnClick := @NewRadioButtonClick;
  end;

  NewGroupBox2 := TNewGroupBox.Create(WizardForm);
  with NewGroupBox2 do
  begin
    Name := 'NewGroupBox2';
    Parent := ISCustomPage1.Surface;
    Left := ScaleX(8);
    Top := ScaleY(112);
    Width := ScaleX(209);
    Height := ScaleY(113);
    Caption := 'Додатково';
  end;

  NewCheckBox1 := TNewCheckBox.Create(WizardForm);
  with NewCheckBox1 do
  begin
    Name := 'NewCheckBox1';
    Parent := NewGroupBox2;
    Left := ScaleX(8);
    Top := ScaleY(16);
    Width := ScaleX(196);
    Height := ScaleY(17);
    Checked := True
    Caption := 'Закріпити в панелі задач';
    OnClick := @NewCheckBox1Click;
  end;

  NewCheckBox2 := TNewCheckBox.Create(WizardForm);
  with NewCheckBox2 do
  begin
    Name := 'NewCheckBox2';
    Parent := NewGroupBox2;
    Left := ScaleX(8);
    Top := ScaleY(40);
    Width := ScaleX(196);
    Height := ScaleY(17);
    Checked := True
    Caption := 'Закріпити в меню ПУСК';
    OnClick := @NewCheckBox2Click;
  end;

  NewCheckBox3 := TNewCheckBox.Create(WizardForm);
  with NewCheckBox3 do
  begin
    Name := 'NewCheckBox3';
    Parent := NewGroupBox2;
    Left := ScaleX(8);
    Top := ScaleY(64);
    Width := ScaleX(196);
    Height := ScaleY(17);
    Checked := True
    Caption := 'Ярлик(и) на робочому столі';
    OnClick := @NewCheckBox3Click;
  end;

  NewCheckBox4 := TNewCheckBox.Create(WizardForm);
  with NewCheckBox4 do
  begin
    Name := 'NewCheckBox4';
    Parent := NewGroupBox2;
    Left := ScaleX(8);
    Top := ScaleY(88);
    Width := ScaleX(196);
    Height := ScaleY(17);
    Checked := True
    Caption := 'Ярлики в меню ПУСК';
    OnClick := @NewCheckBox4Click;
  end;

  with WizardForm.WizardSmallBitmapImage do
  begin
    Left := ScaleX(0);
    Width := ScaleX(150);
  end;

  with WizardForm.PageDescriptionLabel do
  begin
    Left := ScaleX(200);
    Top := ScaleY(27);
    Width := ScaleX(293);
  end;

  with WizardForm.PageNameLabel do
  begin
    OnClick := @PageNameLabelClick;
    Left := ScaleX(200);
    Width := ScaleX(269);
  end;
end;

procedure PageNameLabelClick(Sender: TObject);
begin

end;


procedure NewCheckBox1Click(Sender: TObject);
begin

end;

procedure NewCheckBox2Click(Sender: TObject);
begin

end;

procedure NewCheckBox3Click(Sender: TObject);
begin

end;

procedure NewCheckBox4Click(Sender: TObject);
begin

end;

procedure InitializeWizard();
begin
  RedesignWizardForm;
  with WizardForm do
  begin
    with BeveledLabel do
    begin
      OnClick:=@BevelLabelClick;
      Font.Color:=clBlue;
      Enabled:=True;
      Cursor:=crHand;
      Font.Style:= [fsBold]
    end;
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  case CurPageID of
    ISCustomPage1.ID: if NewRadioButton1.Checked then BitmapImage1.Bitmap.LoadFromFile(ExpandConstant('{tmp}\01.bmp'));
  end;
end;

Последний раз редактировалось saurn, 07-05-2013 в 20:45.

Это сообщение посчитали полезным следующие участники:

Отправлено: 20:38, 07-05-2013 | #379