View Single Post
  #10  
Old 19-02-2014, 03:46
Logrim Logrim is offline
Registered User
 
Join Date: Jun 2009
Location: Spain
Posts: 153
Thanks: 116
Thanked 72 Times in 44 Posts
Logrim is on a distinguished road
One rapid question.. I see in the forum (i dont remember what conversion has that) a custom procedure that add custom exit msgbox with image (that is the importat part) , the procedure in cuestion was myexit.. anyone can help me to do a similar procedure? dont imagine how to do it.. thanks,, and sorry for so many questions.. its my first script with inno, and want to make a bit different.. i like to complicate my life, lol

P.D. i think, the conversion is made by fabio.. dont remember.

Edit: I found the answer for myself.. Thanks to Razor, y_thelastknight and Altef i'm learning a lot. In two days i post a preview, i hope you like it, thanks all three.

Edit2.. Found a new problem that i dont know how to resolve,, sorry.. the custom exit button work like a charm in normal exit, but in change disk exit, the button appears twice. One normal exit msgbox and one the custom exit. I know whats is the problem, but i dont know how to change things for it works.. I need help,,, again.. sorry..

The problem is here, (ExitFlag:= ExitSetupMsgBox; //this is normal exit message) this is the final part of change disk form:
Quote:
case TNewDiskForm.ModalResult of mrCancel:
begin
TNewDiskForm.free;
ExitFlag:= ExitSetupMsgBox;
Case ExitFlag of True:WizardForm.Close;
False:SelectDisk (DiskNumber,Filename,Path);
True:TNewDiskForm.free;
end;
end;
end;
until ((TNewDiskForm.ModalResult=mrOk)or(TNewDiskForm.Mo dalResult=mrCancel));
end;
this the custo exit button:

Quote:
///////////////////////////////////////////////////////////CUSTOM EXIT
procedure MyExitMessage();
var
Font: TFont;
begin
MyExit := CreateCustomForm();
with MyExit do
begin
Position := poScreenCenter;
ClientWidth := WizardForm.Width;
ClientHeight := WizardForm.Height div 2;
Caption := ExpandConstant(SetupMessage(msgExitSetupTitle));
Color := clBlack;

with TNewStaticText.Create(MyExit) do
begin
Left := ScaleX(110);
Top := ScaleY(20);
Width := MyExit.Width - ScaleX(115);
Height := MyExit.Height div 2;
AutoSize := False;
WordWrap := True;
Caption := ExpandConstant(SetupMessage(msgExitSetupMessage));
Parent := MyExit;
Font.Color := clWhite;
end;
end;

Font := TFont.Create;
Font.Size := WizardForm.CancelButton.Font.Size;

NoBtn := BtnCreate(MyExit.Handle, MyExit.Width - 165,
MyExit.Height - 50 - ScaleY(25), 160, 50,
ExpandConstant('{tmp}\button2.png'), 18, True);
BtnSetEvent(NoBtn, BtnClickEventID, WrapBtnCallback(@ButtonOnClick, 1));
BtnSetText(NoBtn, 'Нет');
BtnSetFontColor(NoBtn, clWhite, clWhite, clWhite, clWhite);
BtnSetFont(NoBtn, Font.Handle);

YesBtn := BtnCreate(MyExit.Handle, MyExit.Width - 323,
MyExit.Height - 50 - ScaleY(25), 160, 50,
ExpandConstant('{tmp}\button2.png'), 18, True);
BtnSetEvent(YesBtn, BtnClickEventID, WrapBtnCallback(@ButtonOnClick, 1));
BtnSetText(YesBtn, 'Да');
BtnSetFontColor(YesBtn, clWhite, clWhite, clWhite, clWhite);
BtnSetFont(YesBtn, Font.Handle);

Font.Free;
end;
////////////////////////////////////////////////////////////////////////////////////////////////
and this the ancel button procedure:
Quote:
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0002);
Confirm:=False;
if CurPageID=wpInstalling then begin;
if Cancel then begin
ISDoneError:=True;
ISDoneCancel:=1;
FileStatusLabel.Font.Color:=clRed;
FileStatusLabel.Caption:=ExpandConstant('{cm:Rolli ngFileStatusLabel}');
DelTree(ExpandConstant('{app}'), True, True, True);
WizardForm.CancelButton.Enabled:=False;

MyExitMessage();

if MyExit.ShowModal() = mrNo then
Cancel := False;
end;
end;
end;

Last edited by Logrim; 19-02-2014 at 05:37.
Reply With Quote
The Following User Says Thank You to Logrim For This Useful Post:
oltjon (19-02-2014)