Ver Mensaje Individual
  #1  
Antiguo 02-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Reputación: 12
teecweb Va por buen camino
Talking Recorrer checkboxlist en pascal para un realizar en INNOSETUP

Hola,
Estoy realizando un instalador en innosetup personalizado..mi problema es que tengo que generar una lista de checkbox y despues al hacer click en un boton seleccionar todos los checbox

*para generar la lista lo eh hecho con TNewCheckListBox
*Asi cree mi lista de checks:
Código Delphi [-]
 Page: TWizardPage;
  Button,Buttona, FormButton: TNewButton;
  Panel: TPanel;
  CheckBox: TCheckBox;
  CheckListBox : TNewCheckListBox;
   FListaCheckbox:TStrings;

procedure CreateTheWizardPages;
  var 

  Edit: TNewEdit;
  PasswordEdit: TPasswordEdit;
  listado: TStrings;
  i: Integer;
  scale : Integer;
  scale1:Integer;
  j:Integer;
  n: integer;
 
begin
  { TButton and others }
  listado := TStringList.Create;
  FListaCheckbox := TStringList.Create;
  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;

for i := 0 to listado.Count - 1 do
           begin
            j :=5; 
            scale :=scale+ (j+15);
            CheckListBox := TNewCheckListBox.Create(Page);
            CheckListBox.Top := Buttona.Top + Buttona.Height + ScaleY(scale);
            CheckListBox.Width := 410;
            CheckListBox.Height :=40;
             CheckListBox.Flat := True;
            CheckListBox.Parent := Page.Surface;
            CheckListBox.OnClick:=@uninstaller;
            CheckListBox.AddCheckBox(listado[i], '', 0, False, True, True, True, nil);
           end;
este tiene un evento uninstaller y cada vez que selecciono un check me tiene que retornar el nombre del checkbox y hacer una serie de pasos:
Asi lo hize:

Código Delphi [-]
procedure uninstaller(Sender: TObject);
 var path: String;
begin
  if CheckListBox.Checked
   BEGIN
     //si el checboxlist esta seleccionado,me retorna el nombre del checkbox
     path :=CheckListBox.Items.Strings[0]; //esto lo que encontre en internet ..veo ke manda un indice
                                           // pero como hago para que llegue ese indice al hacer clic en mi check
     MsgBox(path,mbInformation, MB_OK);
   end;
end;
***ahora debo de tener un boton de seleccionar todos cuando hago clic selecciono todos los checks

Código Delphi [-]
procedure ButtonOnClick(Sender: TObject);
 var path: String;

begin
 // al hacer clic me debe chekear todo los checkbox de la lista de check y 
 // tambien recuperar el nombre del check para hacer otros procedimientos
end;

Bueno es todo lo que necesito ..gracias por su pronta respuesta

Última edición por ecfisa fecha: 02-03-2013 a las 07:19:20. Razón: Etiquetas [DELPHI] [/DELPHI]
Responder Con Cita