inno setup bmp图像出现在单个页面上 [英] inno setup bmp image appear on a single page

查看:95
本文介绍了inno setup bmp图像出现在单个页面上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望bmp图像出现在"selectadditionaltasks"页面上,但它会出现在所有页面上.我在做什么错了?

I want a bmp image to appear on a single page "selectadditionaltasks" but it appears on all pages. What am I doing wrong?

procedure LogoOnClick(Sender: TObject);
var ResCode: Integer;
begin
end;
procedure LogoWizard();

var
  BtnPanel: TPanel;
  BtnImage: TBitmapImage;
begin
  ExtractTemporaryFile('Logo.bmp')

  BtnPanel:=TPanel.Create(WizardForm)
  with BtnPanel do begin
    Left:=40
    Top:=250
    Width:=455
    Height:=42
    Cursor:=crHand
    OnClick:=@logoOnClick
    Parent:=WizardForm
  end
  BtnImage:=TBitmapImage.Create(WizardForm)
  with BtnImage do begin
    AutoSize:=True;
    Enabled:=False;
    Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp')
    Parent:=BtnPanel
  end
end;
procedure InitializeWizard();
begin
  LogoWizard();
end;

图片示例

推荐答案

通过将BtnPanelParent设置为您要告诉的WizardForm,您希望该面板是该面板的直接子代.整个向导形式.您必须将BtnPanel.Parent属性更改为要在其上显示该面板的页面表面.

By setting a Parent of your BtnPanel to the WizardForm you're telling, that you want that panel to be an immediate child of the whole wizard form. You'd have to change the BtnPanel.Parent property to the page surface, on which you want that panel to appear.

由于您希望图像显示在选择其他任务" 向导页面上,因此我建议最好的做法是仅使用不带基础面板的图像并调整TasksList复选框的大小,默认情况下,它还会覆盖页面底部要放置图像的区域.然后执行以下脚本.您也可以遵循此脚本的 commented version :

Since you want your image to appear on the Select Additional Tasks wizard page, the best I can suggest is to use just the image without an underlying panel and resize the TasksList check list box, which by default covers also the bottom area of the page, where you want to place your image. And that does the following script. You may follow the commented version of this script as well:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Files]
Source: "Logo.bmp"; Flags: dontcopy

[Tasks]
Name: associate; Description: "&Associate files"; Flags: unchecked
Name: desktopicon; Description: "Create a &desktop icon"; Flags: unchecked

[Code]
procedure LogoOnClick(Sender: TObject);
begin
  MsgBox('Hello!', mbInformation, MB_OK);
end;

procedure InitializeWizard;
var
  BtnImage: TBitmapImage;
begin
  ExtractTemporaryFile('Logo.bmp');

  BtnImage := TBitmapImage.Create(WizardForm);
  with BtnImage do 
  begin
    Parent := WizardForm.SelectTasksPage;
    Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp');
    AutoSize := True;
    Left := 0;
    Top := WizardForm.SelectTasksPage.Top + WizardForm.SelectTasksPage.Height - 
      Height - 8;
    Cursor := crHand;
    OnClick := @LogoOnClick;            
  end;
  WizardForm.TasksList.Height :=
    WizardForm.TasksList.Height - BtnImage.Height - 8;
end;

这篇关于inno setup bmp图像出现在单个页面上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆