Inno Setup - 在确定的页面中从右侧动画控制滚动
Inno Setup - Animate a control roll out from right in a determinate page
我正在尝试使用此代码(使用 InnoCallback DLL 库):
[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;
来自 How to animate a control roll out in Inno Setup(Martin Prikryl 的回答),以显示相同的效果,但从右到左并在确定的设置页面中。如何做到这一点?
在CurPageChanged
中使用CurPageID
到select在什么页面显示动画。
[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
function, you need Inno Setup 6. If you are stuck with Inno Setup 5, you can use WrapCallback
function from InnoTools InnoCallback 库。
我正在尝试使用此代码(使用 InnoCallback DLL 库):
[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;
来自 How to animate a control roll out in Inno Setup(Martin Prikryl 的回答),以显示相同的效果,但从右到左并在确定的设置页面中。如何做到这一点?
在CurPageChanged
中使用CurPageID
到select在什么页面显示动画。
[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
function, you need Inno Setup 6. If you are stuck with Inno Setup 5, you can use WrapCallback
function from InnoTools InnoCallback 库。