Einzelnen Beitrag anzeigen

Almond

Registriert seit: 5. Jan 2006
33 Beiträge
 
Delphi 3 Professional
 
#1

Inno Setup: Edit1.OnChange und Custom_nextbuttonClick

  Alt 24. Jan 2006, 10:10
Ich komme da nicht weiter:

1) Ich möchte gerne den Next-Button deaktivieren (Delphi: enabled:= false), bis der user eine Eingabe macht

sowas wie mit Edit1.onChange ()
bzw.
procedure TForm1.Edit1Change(Sender: TObject);
begin
end;

[code=delphi]; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
AppName=Almond_mail
AppVerName=Almond_mail 1.12
AppPublisher=Almond
DefaultDirName={pf}\Almond_mail
DefaultGroupName=Almond_mail
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compilerefault.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "E:\Tools\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
Name: "{userdesktop}\My Program"; Filename: "{app}\MyProg.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\MyProg.exe"; Description: "{cm:LaunchProgram,My Program}"; Flags: nowait postinstall skipifsilent


[CustomMessages]
CustomFormCaption=CustomForm Caption
CustomFormDescription=CustomForm description

Code:
  var
    NewStaticText1: TNewStaticText;
    Edit1: TEdit;

  procedure CustomForm_Activate(Page: TWizardPage);
  begin
  end;
  //       ///////////////////////////////////////////////////////
    procedure Edit1_change(Page: TWizardPage);
    begin
          If Edit1.text <> '' then
                  CustomForm_NextButton_click.enabled := false;        //          <<< HIER
    end;
  //       ///////////////////////////////////////////////////////

  function CustomForm_ShouldSkipPage(Page: TWizardPage): Boolean;
  begin
    Result := False;
  end;

  function CustomForm_BackButtonClick(Page: TWizardPage): Boolean;
  begin
    Result := True;
  end;

  function CustomForm_NextButtonClick(Page: TWizardPage): Boolean;
  begin
    Result := True;
  end;

  procedure CustomForm_CancelButtonClick(Page: TWizardPage; var Cancel, Confirm: Boolean);
  begin
  end;

  function CustomForm_CreatePage(PreviousPageId: Integer): Integer;
  var
    Page: TWizardPage;
  begin
    Page := CreateCustomPage(
      PreviousPageId,
      ExpandConstant('{cm:CustomFormCaption}'),
      ExpandConstant('{cm:CustomFormDescription}')
    );

    { NewStaticText1 }
    NewStaticText1 := TNewStaticText.Create(Page);
    with NewStaticText1 do
    begin
      Parent := Page.Surface;
      Left := ScaleX(40);
      Top := ScaleY(32);
      Width := ScaleX(173);
      Height := ScaleY(14);
      Caption := 'Geben Sie einen Accountnamen ein:';
      TabOrder := 0;
    end;

    { Edit1 }
    Edit1 := TEdit.Create(Page);
    with Edit1 do
    begin
      Parent := Page.Surface;
      Left := ScaleX(80);
      Top := ScaleY(88);
      Width := ScaleX(209);
      Height := ScaleY(21);
      TabOrder := 1;
      Text := '';
    end;


    with Page do
    begin
      OnActivate := @CustomForm_Activate;
      OnShouldSkipPage := @CustomForm_ShouldSkipPage;
      OnBackButtonClick := @CustomForm_BackButtonClick;
      OnNextButtonClick := @CustomForm_NextButtonClick;
        //       ///////////////////////////////////////////////////////
              CustomForm_NextButtonClick.enabled := false;                    //          <<< HIER
        //       ///////////////////////////////////////////////////////
      OnCancelButtonClick := @CustomForm_CancelButtonClick;
    end;

    Result := Page.ID;
  end;

  procedure InitializeWizard();
  begin
    CustomForm_CreatePage(wpWelcome);
  end;
_ immer gute Laune
  Mit Zitat antworten Zitat