2012년 4월 6일 금요일

입력된 값과 입력한 key 값을 비교

입력된 값과 입력한 key 값을 비교해서 틀릴 경우 next 버튼 비활성화

[Setup]
AppName=My Program
AppVerName=My Program version 1.5
DefaultDirName={pf}\My Program
DisableProgramGroupPage = yes
UninstallDisplayIcon={app}\MyProg.exe
OutputDir=userdocs:Inno Setup Examples Output

[Files]
Source: "MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion

[CustomMessages]
CustomForm_Caption=설정정보
CustomForm_Description=설정정보를 입력하세요.
CustomForm_Label1_Caption0=username:
CustomForm_Label2_Caption0=password:
CustomForm_Label3_Caption0=key:

[Code]
Var
Page: TWizardPage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
  
procedure  EdtOnChange (Sender: TObject);

Var
MyEdit : TEdit;
  
   
begin
MyEdit := TEdit(Sender);
if MyEdit.Text = '78df5df222b526a341b2eeac0f64fb57' then
  WizardForm.NextButton.Enabled := true
Else
  WizardForm.NextButton.Enabled := false;
end;


procedure InitializeWizard;
Var
  CheckBox: TCheckBox;
begin
  Page := CreateCustomPage( wpWelcome, ExpandConstant('{cm:CustomForm_Caption}'), ExpandConstant('{cm:CustomForm_Description}') );


{ Label1 } Label1 := TLabel.Create(Page); with Label1 do begin Parent := Page.Surface; Caption := ExpandConstant('{cm:CustomForm_Label1_Caption0}'); Left := ScaleX(16); Top := ScaleY(24); Width := ScaleX(70); Height := ScaleY(13); end;

{ Label2 } Label2 := TLabel.Create(Page); with Label2 do begin Parent := Page.Surface; Caption := ExpandConstant('{cm:CustomForm_Label2_Caption0}'); Left := ScaleX(17); Top := ScaleY(56); Width := ScaleX(70); Height := ScaleY(13); end;

{ Label3 } Label3 := TLabel.Create(Page); with Label3 do begin Parent := Page.Surface; Caption := ExpandConstant('{cm:CustomForm_Label3_Caption0}'); Left := ScaleX(17); Top := ScaleY(88); Width := ScaleX(70); Height := ScaleY(13); end;

{ Edit1 } Edit1 := TEdit.Create(Page); with Edit1 do begin Parent := Page.Surface; Left := ScaleX(115); Top := ScaleY(24); Width := ScaleX(273); Height := ScaleY(21); TabOrder := 0; end;

{ Edit2 } Edit2 := TEdit.Create(Page); with Edit2 do begin Parent := Page.Surface; Left := ScaleX(115); Top := ScaleY(56); Width := ScaleX(273); Height := ScaleY(21); TabOrder := 1; end;

{ Edit3 } Edit3 := TEdit.Create(Page); with Edit3 do begin Parent := Page.Surface; Left := ScaleX(115); Top := ScaleY(88); Width := ScaleX(273); Height := ScaleY(21); TabOrder := 2; end;

Edit3.OnChange := @EdtOnChange;

end;

procedure CurPageChanged(CurPageID: Integer);
begin
If CurPageID = Page.ID Then
  WizardForm.NextButton.Enabled := false;
end;

댓글 없음:

댓글 쓰기