Ver Mensaje Individual
  #8  
Antiguo 04-03-2013
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola teecweb.

Mi respuesta fué por el título de tu primer mensaje "Agregar ID a checkboxlist en delphi", pero tratándose de Inno setup cambia un poco la cosa.

Nunca había realizado un script para Inno setup, pero basándome en parte en tu código y revisando un poco aquí: Pascal Scripting: Support Classes Reference, hice unas pruebas y en este ejemplo se muestran el texto y los índices de los items seleccionados en el TNewChekListBox como respuesta del evento OnClick de Buttona:
Código Delphi [-]
[Setup]
AppName='Test'
AppVerName='Test'
DefaultDirName={pf}\test

[code]
var 
  Page: TWizardPage;
  Buttona: TNewButton;
  CheckListBox1: TNewCheckListBox;

procedure ButtonOnClick(Sender: TObject);
var
  i: Integer;
begin
  for i:= 0 to CheckListBox1.Items.Count -1 do
    if CheckListBox1.Checked[i] then  // ¿ El item está seleccionado ? 
      MsgBox('Caption: ' + CheckListBox1.Items[i]+ #10#13 +   // Caption del item
             'Indice : ' + IntToStr(i), mbInformation, MB_OK); // Indice del item
end;

procedure CreateTheWizardPages;
var 
  inicio: Integer;
  scale : Integer;
begin
  Page := CreateCustomPage(wpSelectDir, 'Custom wizard page controls', 'TButton and others');

  Buttona := TNewButton.Create(Page);
  Buttona.Width   := ScaleX(75);
  Buttona.Height  := ScaleY(23);
  Buttona.Caption := 'TNewButton';
  Buttona.Parent  := Page.Surface;
  Buttona.Visible := true;
  Buttona.OnClick := @ButtonOnClick;
 
  CheckListBox1 := TNewCheckListBox.Create(Page);  
  CheckListBox1.Width   := 410;
  CheckListBox1.Height  := 180; 
  CheckListBox1.Parent  := Page.Surface;
  CheckListBox1.ItemIndex:= 0; 
  CheckListBox1.Top := Buttona.Top + Buttona.Height + ScaleY(scale); 

  for inicio:= 1 to 5 do
     CheckListBox1.AddCheckBox('Item' + IntToStr(inicio), IntToStr(inicio), 0, False, True, True, True, nil);
end;

procedure InitializeWizard();
begin
  CreateTheWizardPages
end;
Espero te oriente para lograr lo que estás buscando.

Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita