Quote:
Originally Posted by Andre Jesus
|
here is example
[Files]
Source: buttons.png;
DestDir: {tmp};
Flags: dontcopy
[Code]
var
hback, hnext, hcancel :Longint
ButtonFont: TFont;
procedure SetStateNewButtons;
begin
with WizardForm.BackButton
do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.NextButton
do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
with WizardForm.CancelButton
do begin
BtnSetText(hCancelBtn,PAnsiChar(Caption));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
end;
procedure WizardFormBtnClick(hBtn:HWND);
var
Btn:TButton;
begin
case hBtn
of
hCancelBtn: Btn:=WizardForm.CancelButton;
hNextBtn: Btn:=WizardForm.NextButton;
hBackBtn: Btn:=WizardForm.BackButton;
hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
end;
Btn.OnClick(Btn);
SetStateNewButtons;
BtnRefresh(hBtn);
end;
Procedure ButtonsTexture;
begin
ButtonFont:=TFont.Create;
ButtonFont.Name:='Arial';
ButtonFont.Size:=13;
ButtonFont.Color:=$FFFFFF;
with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle,Left-52,Top-65,Width+25,Height+16,ExpandConstant('{tmp}\button .png'),18,False);
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallba ck(@WizardFormBtnClick,1));
BtnSetFont(hBackBtn,ButtonFont.Handle);
BtnSetFontColor(hBackBtn,$DAE369,$DAE369,$DAE369,$ B6B6B6);
BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;
with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,Left-28,Top-65,Width+25,Height+16,ExpandConstant('{tmp}\button .png'),18,False);
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallba ck(@WizardFormBtnClick,1));
BtnSetFont(hNextBtn,WFButtonFont.Handle);
BtnSetFontColor(hNextBtn,$DAE369,$DAE369,$DAE369,$ B6B6B6);
BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;
with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,Left-223,Top-65,Width+25,Height+16,ExpandConstant('{tmp}\button .png'),18,False);
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCall back(@WizardFormBtnClick,1));
BtnSetFont(hCancelBtn,ButtonFont.Handle);
BtnSetFontColor(hCancelBtn,$DAE369,$DAE369,$DAE369 ,$B6B6B6);
BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649)) ;
Width:=0;
Height:=0;
end;
with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,Left+15 0,Top+55,Width-40,Height+10,ExpandConstant('{tmp}\browse.png'),6, False);
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnC allback(@WizardFormBtnClick,1));
BtnSetFont(hDirBrowseBtn,ButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn,$DAE369,$DAE369,$DAE 369,$B6B6B6);
BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(3264 9));
Width:=0;
Height:=0;
end;
with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,Left+ 150,Top+55,Width-40,Height+10,ExpandConstant('{tmp}\browse.png'),6, False);
BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,W rapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBt nCallback(@WizardFormBtnClick,1));
BtnSetFont(hGroupBrowseBtn,ButtonFont.Handle);
BtnSetFontColor(hGroupBrowseBtn,$DAE369,$DAE369,$D AE369,$B6B6B6);
BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32 649));
Width:=0;
Height:=0;
end;
end;