Inno Setup-在确定的页面中从右开始对控件进行动画处理 [英] Inno Setup - Animate a control roll out from right in a determinate page

查看:49
本文介绍了Inno Setup-在确定的页面中从右开始对控件进行动画处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用此代码(与InnoCallback DLL库一起使用):

I am trying to use this code (with InnoCallback DLL library):

[Code]

var
  MainPanelAnimated: Boolean;
  AnimationTimer: LongWord;

procedure AnimationTimerProc(
  H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord);
var
  L: Integer;
begin
  L := WizardForm.MainPanel.Left + ScaleX(5);
  if L > 0 then
  begin
    L := 0;
    KillTimer(0, AnimationTimer);
  end;
  WizardForm.MainPanel.Left := L;
end;

procedure CurPageChanged(CurPageID: Integer);
var
  HoverTimerCallback: LongWord;
begin
  if WizardForm.OuterNotebook.ActivePage = WizardForm.InnerPage then
  begin
    if not MainPanelAnimated then
    begin
      HoverTimerCallback := WrapTimerProc(@AnimationTimerProc, 4);
      AnimationTimer := SetTimer(0, 0, 5, HoverTimerCallback);
      WizardForm.MainPanel.Left := -WizardForm.MainPanel.Width;
      MainPanelAnimated := True;
    end;
  end;
end;

来自如何在Inno Setup (Martin Prikryl的答案)中为控件设置动画,以显示相同的效果,但从右到左并在确定的设置页面中显示.该怎么做?

from How to animate a control roll out in Inno Setup (answer of Martin Prikryl), to show the same effect but from right to left and in a determinate page of setup. How to do this?

推荐答案

CurPageChanged中使用CurPageID选择要在哪个页面上显示动画.

Use CurPageID in CurPageChanged to select on what page to show the animation.

[Code]

function SetTimer(hWnd: longword; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord):
  LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord;
  external 'KillTimer@User32.dll stdcall';

var
  AnimationTimer: LongWord;

procedure AnimationTimerProc(
  H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord);
var
  L: Integer;
begin
  L := WizardForm.MainPanel.Left - ScaleX(5);
  if L < 0 then
  begin
    L := 0;
    KillTimer(0, AnimationTimer);
  end;
  WizardForm.MainPanel.Left := L;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpReady then
  begin
    AnimationTimer := SetTimer(0, 0, 5, CreateCallback(@AnimationTimerProc));
    WizardForm.MainPanel.Left := WizardForm.MainPanel.Width;
  end;
end;

对于 CreateCallback函数,您需要Inno设置6.如果您对Inno Setup 5感到困惑,则可以使用 InnoTools中的WrapCallback功能InnoCallback 库.

For CreateCallback function, you need Inno Setup 6. If you are stuck with Inno Setup 5, you can use WrapCallback function from InnoTools InnoCallback library.

这篇关于Inno Setup-在确定的页面中从右开始对控件进行动画处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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