Randem Systems Support Board

InnoScript => InnoScript - General Questions, Report Bugs, Problems etc... => Topic started by: uday on April 16, 2006, 03:56:29 AM

Title: Displaying a form in inno script
Post by: uday on April 16, 2006, 03:56:29 AM
--------------------------------------------------------------------------------
I am using inno 4.1  
My program creates a form using the call:  
TForm.Create(WizardForm)  
 
I am displayoing 4 lables and 3 buttons in the form.  
 
I am using Form.showmodal() to display the form. To destoy the form i am using form.release.  
 
 
After the form is displayed using form.showmodal(), the user will have to click on one of the buttons, based on which the respective actions are performed.  
 

Can any body please tell me the actual use of Form.showmodel and form.release

 
I am facing a problem that sometimes the form is displayed after 30 minutes. The code is stopping at the statement form.showmodel. It is not displaying the form. Only after 30 minutes the form is being dsplayed. This behaviour is not consistent. one in 10 times i am getting this behaviour.Can anybody please suggest what might be the problem.  

Is there any other way of displaying the form.  

Please find the code attached for the form:  
 
//Dialog Box Used for Database Detection when Database is existing.  
function DatabaseDetectionDlgBox(BackClicked: Boolean): Boolean;  
var  
CurSubPage: Integer;  
Next: Boolean;  
Button: TButton;  
Button1: TButton;  
Button2: TButton;  
//Modified by uday on 28th March for PMP 4.1  
//Form: TForm;  
//End  
Button: TButton;  
lblUserName : TLabel;  
//Modified by uday on 23th January for PMP 4.0.2  
//lblUserName1 : TLabel;  
lblUserName1 : TEdit;  
//End  
lblUserName2 : TLabel;  
//Modified by uday on 23th January for PMP 4.0.2  
//lblUserName3 : TLabel;  
lblUserName3 : TEdit;  
//End  
lblUserName4 : TLabel;  
 
begin  
Form := TForm.Create(WizardForm);  
Form.Width := 386;  
Form.Height := 156;  
Form.Caption := PROD_NAME;  
Form.Position := poScreenCenter;  
 
lblUserName := TLabel.Create(Form);  
lblUserName.Caption := ' ' ;  
lblUserName.AutoSize := True;  
lblUserName.Parent := Form;  
 
//Modified by uday on 23th January for PMP 4.0.2  
//lblUserName1 := TLabel.Create(Form);  
//lblUserName1.Caption := ' '   LoadString(PREV_VER_DB) ;  
//lblUserName1.Top := lblUserName.Top   lblUserName.Height   2;  
//lblUserName1.AutoSize := True;  
//lblUserName1.Parent := Form;  
 
lblUserName1 := TEdit.Create(Form);  
lblUserName1.Top := lblUserName.Top   lblUserName.Height   2;  
lblUserName1.Text := ' '   LoadString(PREV_VER_DB);  
lblUserName1.Width := Form.Width;  
lblUserName1.Parent := Form;  
lblUserName1.READONLY := true ;  
lblUserName1.Color := lblUserName.Color;  
lblUserName1.BORDERSTYLE := bsNone  
 
//End  
 
 
lblUserName2 := TLabel.Create(Form);  
lblUserName2.Top := lblUserName1.Top   lblUserName1.Height   2;  
lblUserName2.Caption := ' ' ;  
lblUserName2.AutoSize := True;  
lblUserName2.Parent := Form;  
 
//Modified by uday on 23th January for PMP 4.0.2  
//lblUserName3 := TLabel.Create(Form);  
//lblUserName3.Caption := ' '   LoadString(CLICK_OPTION) ;  
//lblUserName3.Top := lblUserName2.Top   lblUserName2.Height   2;  
//lblUserName3.AutoSize := True;  
//lblUserName3.Parent := Form;  
 
lblUserName3 := TEdit.Create(Form);  
lblUserName3.Top := lblUserName2.Top   lblUserName2.Height   2;  
lblUserName3.Text := ' '   LoadString(CLICK_OPTION);  
lblUserName3.Width := Form.Width;  
lblUserName3.Parent := Form;  
lblUserName3.READONLY := true ;  
lblUserName3.Color := lblUserName2.Color;  
lblUserName3.BORDERSTYLE := bsNone  
//End  
 
 
lblUserName4 := TLabel.Create(Form);  
lblUserName4.Top := lblUserName3.Top   lblUserName3.Height   2;  
lblUserName4.Caption := ' ' ;  
lblUserName4.AutoSize := True;  
lblUserName4.Parent := Form;  
 
Button := TButton.Create(Form);  
Button.Parent := Form;  
Button.Top := lblUserName4.Top   lblUserName4.Height   2;  
Button.Left := lblUserName4.Left   lblUserName4.width   12;  
Button.Caption := LoadString(RETAIN_DB);  
Button.ModalResult := mrOk;  
Button.OnClick := @RetainOnClick;  
 
Button1 := TButton.Create(Form);  
Button1.Parent := Form;  
Button1.Top := lblUserName4.Top   lblUserName4.Height   2;  
Button1.Left := Button.Left   Button.width   18;  
Button1.Caption := LoadString(DELETE_DB);  
Button1.ModalResult := mrOk;  
Button1.OnClick := @DeleteOnClick;  
 
Button2 := TButton.Create(Form);  
Button2.Parent := Form;  
Button2.Top := lblUserName4.Top   lblUserName4.Height   2;  
Button2.Left := Button1.Left   Button1.width   18;  
Button2.Caption := LoadString(CLOSE_DB);  
Button2.ModalResult := mrOk;  
Button2.OnClick := @CloseOnClick;  
 
Form.ActiveControl := Button;  
Form.BORDERICONS := [biMinimize];  
Form.AUTOSCROLL := False;  
 
//Modified by uday on 28th March for PMP 4.1  
Form.ShowModal();  
//Form.Release();  
//End  
 
end;
Title: Displaying a form in inno script
Post by: Randem on April 16, 2006, 10:05:52 AM
uday,
 
This is a very specific Inno Setup question and will probably get a better answer in one of the  Inno Setup Newsgroups (http://www.jrsoftware.org/newsgroups.php)