2017-12-29 17 views
0

내가 (InnoCallback DLL 라이브러리)이 코드를 사용하는 것을 시도하고 바로으로부터 제어 롤 애니메이션 : How to animate a control roll out in Inno Setup (마틴 Prikryl의 대답)에서Inno Setup으로 확정 페이지

[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; 

의를 표시합니다 동일한 효과이지만 오른쪽에서 왼쪽으로 그리고 설정의 결정적인 페이지에서. 이 작업을 수행하는 방법?

답변

0

CurPageChangedCurPageID을 사용하여 애니메이션을 표시 할 페이지를 선택하십시오.

[Files] 
Source: InnoCallback.dll; Flags: dontcopy 

[Code] 

type 
    TTimerProc = procedure(H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord); 

function SetTimer(hWnd: longword; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): 
    LongWord; external '[email protected] stdcall'; 
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; 
    external '[email protected] stdcall'; 

function WrapTimerProc(Callback: TTimerProc; ParamCount: Integer): LongWord; 
    external '[email protected]:innocallback.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); 
var 
    HoverTimerCallback: LongWord; 
begin 
    if CurPageID = wpReady then 
    begin 
    HoverTimerCallback := WrapTimerProc(@AnimationTimerProc, 4); 
    AnimationTimer := SetTimer(0, 0, 5, HoverTimerCallback); 
    WizardForm.MainPanel.Left := WizardForm.MainPanel.Width; 
    end; 
end; 

코드는 InnoTools InnoCallback DLL library을 사용합니다.