0

I must declare instance name in custom page with two radio buttons. I have code with this page but I don't know why I can't blocked TEdit field when first radio button in check. I don't no how do it dynamically. And I have problem with instance in this TEdit field because DefultDirName don't read this text field.

var 
  DirPage: TWizardPage;
  DirButton: TNewButton;
  DirInstRadio: TNewRadioButton;
  DirNoInstRadio: TRadioButton;
  DirNoInstEdit: TNewEdit;
  DirStrEdit: string;
   
procedure CreateTheWizardPages;
begin

  DirPage := CreateCustomPage(wpSelectDir, 'Wybór instancji', 'Wybierz nazwę instalowanej instancji systemu ExpertWMS');
  DirButton := TNewButton.Create(DirPage);
  DirButton.Width := ScaleX(75);
  DirButton.Height := ScaleY(23);

  DirInstRadio := TNewRadioButton.Create(DirPage);
  DirInstRadio.Top := DirButton.Top + DirButton.Height + ScaleY(8);
  DirInstRadio.Width := DirPage.SurfaceWidth div 2;
  DirInstRadio.Height := ScaleY(17);
  DirInstRadio.Caption := 'Nienazwana (domyślna)';
  DirInstRadio.Checked := True;
  DirInstRadio.Parent := DirPage.Surface;

  DirNoInstRadio := TRadioButton.Create(DirPage);
  DirNoInstRadio.Top := DirInstRadio.Top + DirInstRadio.Height + ScaleY(8);
  DirNoInstRadio.Width := DirPage.SurfaceWidth div 2;
  DirNoInstRadio.Height := ScaleY(17);
  DirNoInstRadio.Caption := 'Nazwana';
  DirNoInstRadio.Checked := False;  
  DirNoInstRadio.Parent := DirPage.Surface;

  

  DirNoInstEdit := TNewEdit.Create(DirPage);
  DirNoInstEdit.Top := DirNoInstRadio.Top +DirNoInstRadio.Height + ScaleY(8);
  DirNoInstEdit.Width := DirPage.SurfaceWidth div 2 - ScaleX(8);
  DirNoInstEdit.Enabled := True;
  DirNoInstEdit.Parent := DirPage.Surface; 
  DirStrEdit := DirNoInstEdit.Text; 


end;

Function GetName I use to transmission to DefultDirName:

 function GetName(Param: string): string;
  begin
      ExpandConstant(DirStrEdit);
  end;          
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
Kamil
  • 1
  • 1
  • @MartinPrikryl I will say more precisely. TEdit field is necessary to write only example 'Test'. And i want this text put to DefultDirName (c:\Example\Test) and [Icons] (ExpampleTest.exe) and other files .bat. In batch files it works but problems are DefultDirName and [Icons] – Kamil Dec 15 '20 at 11:27
  • Your question title asks for *"dynamically block TEdit"* – That's what the linked question shows. Now you ask for something completely different. + How can you change `DefaultDirName` on a page that is only after the "select directory" page (`CreateCustomPage(wpSelectDir, ...)`). That makes no sense. That's too late. – Martin Prikryl Dec 15 '20 at 11:38

0 Answers0