isxskin.iss

来自「最新版 JCL+JVCL控件!非常不错的控件资源。包含了所能用到的大部分功能!」· ISS 代码 · 共 642 行 · 第 1/2 页

ISS
642
字号
[Files]
Source: {#MyWizardButtonImageFile}; DestDir: {tmp}; Flags: dontcopy
Source: {#MyWizardBottomImageFile}; DestDir: {tmp}; Flags: dontcopy

[Code]
const
  MAINPANELCOLOR = $663300;
  PAGECOLOR = $ab663d;
  BUTTONPANELCOLOR = $603A2B;
  BUTTONWIDTH = 100;
  BUTTONHEIGHT = 27;

  bidBack = 0;
  bidNext = 1;
  bidCancel = 2;
  bidDirBrowse = 3;
  bidGroupBrowse = 4;

var
  ButtonPanels: array [0..4] of TPanel;
  ButtonImages: array [0..4] of TBitmapImage;
  ButtonLabels: array [0..4] of TLabel;

procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
  ButtonLabels[AButtonIndex].Caption:=AButton.Caption;
  ButtonPanels[AButtonIndex].Visible:=AButton.Visible;
  ButtonLabels[AButtonIndex].Enabled:=AButton.Enabled;
end;

procedure ButtonLabelClick(Sender: TObject);
var
  button: TButton;
begin
  ButtonImages[TLabel(Sender).Tag].Left:=0;
  if not ButtonLabels[TLabel(Sender).Tag].Enabled then Exit;
  case TLabel(Sender).Tag of
    bidBack: button:=WizardForm.BackButton;
    bidNext: button:=WizardForm.NextButton;
    bidCancel: button:=WizardForm.CancelButton;
    bidDirBrowse: button:=WizardForm.DirBrowseButton;
    bidGroupBrowse: button:=WizardForm.GroupBrowseButton;
  else
    Exit;
  end;
  button.OnClick(button);
end;

procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if (Button=mbLeft) and (ButtonLabels[TLabel(Sender).Tag].Enabled) then
    ButtonImages[TLabel(Sender).Tag].Left:=-BUTTONWIDTH;
end;

procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ButtonImages[TLabel(Sender).Tag].Left:=0;
end;

procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
var
  image: TBitmapImage;
  panel: TPanel;
  labl: TLabel;
  FileName: String;

begin
  panel:=TPanel.Create(WizardForm);
  with panel do begin
    Parent:=AButton.Parent;
    Color:=BUTTONPANELCOLOR;
    Tag:=AButtonIndex;
    Left:=AButton.Left;
    Top:=AButton.Top;
    Width:=AButton.Width;
    Height:=AButton.Height;
  end;
  ButtonPanels[AButtonIndex]:=panel;

  image:=TBitmapImage.Create(WizardForm);
  FileName:=ExtractFileName('{#MyWizardButtonImageFile}');
  with image do begin
    Height:=BUTTONHEIGHT;
    Width:=BUTTONWIDTH*2;
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\')+FileName);
    Parent:=panel;
    Enabled:=false;
  end;
  ButtonImages[AButtonIndex]:=image;

  with TLabel.Create(WizardForm) do begin
    Tag:=AButtonIndex;
    Parent:=panel;
    Width:=panel.Width;
    Height:=panel.Height;
    transparent:=true;
    OnClick:=@ButtonLabelClick;
    OnDblClick:=@ButtonLabelClick;
    OnMouseDown:=@ButtonLabelMouseDown;
    OnMouseUp:=@ButtonLabelMouseUp;
  end;

  labl:=TLabel.Create(WizardForm);
  with labl do begin
    Tag:=AButtonIndex;
    Alignment:=taCenter;
    Transparent:=true;
    AutoSize:=false;
    Top:=(BUTTONHEIGHT div 4);
    Left:=0;
    Width:=panel.ClientWidth;
    Parent:=panel;
    if AButtonIndex = bidNext then
      Font.Style := [fsBold];
    Font.Color:=clWhite;
    Caption:=AButton.Caption;
    OnClick:=@ButtonLabelClick;
    OnDblClick:=@ButtonLabelClick;
    OnMouseDown:=@ButtonLabelMouseDown;
    OnMouseUp:=@ButtonLabelMouseUp;
  end;
  ButtonLabels[AButtonIndex]:=labl;
end;

procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
  ButtonLabels[bidNext].Enabled:=true;
end;

procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
  ButtonLabels[bidNext].Enabled:=false;
end;


procedure InitializeSkin;
var
  image : TBitmapImage;
  TypesComboItemIndex: integer;
  FileName: String;

begin
  with WizardForm do
    with OuterNotebook do
      with InnerPage do
        with InnerNotebook do
          with SelectComponentsPage do
            TypesComboItemIndex:=TypesCombo.ItemIndex;


  WizardForm.Bevel.Hide;
  WizardForm.Bevel1.Hide;
  WizardForm.SelectDirBitmapImage.Hide;
  WizardForm.SelectGroupBitmapImage.Hide;

  image:=TBitmapImage.Create(WizardForm);
  image.Top:=451;
  image.Width:=690;
  image.Height:=45;

  FileName:=ExtractFileName('{#MyWizardBottomImageFile}');
  ExtractTemporaryFile(FileName);
  image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\')+FileName);
  image.Parent:=WizardForm;
  image.SendToBack;


with WizardForm do begin
  Position:=poScreenCenter;
  ClientWidth:=690
  ClientHeight:=496
  Font.Color:=$ffffff
  Font.Name:='MS Sans Serif'
  Font.Style:=[]
  with CancelButton do begin
    Left:=555
    Top:=460
    Width:=BUTTONWIDTH;
    Height:=BUTTONHEIGHT;
  end
  with NextButton do begin
    Left:=371
    Top:=460
    Width:=BUTTONWIDTH;
    Height:=BUTTONHEIGHT;
  end
  with BackButton do begin
    Left:=266
    Top:=460
    Width:=BUTTONWIDTH;
    Height:=BUTTONHEIGHT;
  end

  with OuterNotebook do begin
    Left:=190
    Top:=59
    Width:=500
    Height:=392
    with WelcomePage do begin
      Color:=PAGECOLOR;
      with WizardBitmapImage do begin
        Parent:=WizardForm
        Left:=0
        Top:=60
        Width:=190
        Height:=391
      end
      with WelcomeLabel2 do begin
        Left:=35
        Top:=171
        Width:=465
        Height:=200
      end
      with WelcomeLabel1 do begin
        Left:=35
        Top:=131
        Width:=465
        Height:=28
        Font.Size:=8
        Font.Color:=$ffffff
      end
    end
    with InnerPage do begin
      with InnerNotebook do begin
        Left:=20
        Top:=20
        Width:=465
        Height:=354
        Color:=PAGECOLOR;
        with LicensePage do begin
          with LicenseNotAcceptedRadio do begin
            Left:=0
            Top:=338
            Width:=17
            Height:=17
            OnClick:=@LicenceNotAcceptedRadioOnClick;
          end
          with LicenseAcceptedRadio do begin
            Left:=0
            Top:=318
            Width:=17
            Height:=17
            OnClick:=@LicenceAcceptedRadioOnClick;
          end
          with LicenseMemo do begin
            Left:=0
            Top:=38
            Width:=465
            Height:=266
          end
          with LicenseLabel1 do begin
            Left:=0
            Top:=0
            Width:=465
            Height:=28
          end
        end
        with PasswordPage do begin
          with PasswordEdit do begin
            Left:=0
            Top:=50
            Width:=465
            Height:=21
            Color:=$ffffff
            Font.Color:=$000000
          end
          with PasswordEditLabel do begin
            Left:=0
            Top:=34
            Width:=465
            Height:=14
          end
          with PasswordLabel do begin
            Left:=0
            Top:=0
            Width:=465
            Height:=28
          end
        end
        with InfoBeforePage do begin
          with InfoBeforeMemo do begin
            Left:=0
            Top:=24
            Width:=465
            Height:=327
          end
          with InfoBeforeClickLabel do begin
            Left:=0
            Top:=0
            Width:=465
            Height:=14
          end
        end
        with UserInfoPage do begin
          with UserInfoSerialEdit do begin
            Left:=0
            Top:=120
            Width:=465
            Height:=21
            Color:=$ffffff
            Font.Color:=$000000
          end
          with UserInfoSerialLabel do begin
            Left:=0
            Top:=104
            Width:=465
            Height:=14
          end
          with UserInfoOrgEdit do begin
            Left:=0
            Top:=68
            Width:=465
            Height:=21
            Color:=$ffffff
            Font.Color:=$000000
          end
          with UserInfoOrgLabel do begin
            Left:=0
            Top:=52
            Width:=465
            Height:=14

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?