TLama

Untitled

Apr 1st, 2013
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.06 KB | None | 0 0
  1. [Setup]
  2. AppName=My Program
  3. AppVersion=1.5
  4. DefaultDirName={pf}\My Program
  5. OutputDir=userdocs:Inno Setup Examples Output
  6.  
  7. [Components]
  8. Name: "file1"; Description: "File 1"
  9. Name: "file2"; Description: "File 2"
  10. Name: "file3"; Description: "File 3"
  11.  
  12. [Code]
  13. procedure ComponentsClickCheck(Sender: TObject);
  14. var
  15.   Item1: Integer;
  16.   Item2: Integer;
  17.   Item3: Integer;
  18.   ListBox: TNewCheckListBox;
  19. begin
  20.   ListBox := TNewCheckListBox(Sender);
  21.   Item1 := ListBox.Items.IndexOf('File 1');
  22.   Item2 := ListBox.Items.IndexOf('File 2');
  23.   Item3 := ListBox.Items.IndexOf('File 3');
  24.  
  25.   if (Item1 <> -1) and (Item2 <> -1) and (Item3 <> -1) then
  26.   begin
  27.     if (ListBox.ItemIndex >= 0) and (ListBox.ItemIndex <= 1) then
  28.       ListBox.Checked[Item3] := ListBox.Checked[Item1] or ListBox.Checked[Item2]
  29.     else
  30.     begin
  31.       ListBox.Checked[Item1] := ListBox.Checked[Item3];
  32.       ListBox.Checked[Item2] := ListBox.Checked[Item3];
  33.     end;  
  34.   end;
  35. end;
  36.  
  37. procedure InitializeWizard;
  38. begin
  39.   WizardForm.ComponentsList.OnClickCheck := @ComponentsClickCheck;
  40. end;
Advertisement
Add Comment
Please, Sign In to add comment