unit CheckLists;

interface

uses
  Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, LeftFrame,
  Controls, Forms, TopFrame, IWCompLabel, IWTMSCheckList, IWVCLBaseControl,
  IWBaseControl, IWBaseHTMLControl, IWControl, IWCompEdit, IWCompCheckbox,
  IWExtCtrls, IWCompButton, IWCompListbox;

type
  TformCheckLists = class(TIWAppForm)
    FrameTopFrame1: TFrameTopFrame;
    FrameLeftFrame1: TFrameLeftFrame;
    IWLabel1: TIWLabel;
    IWLabel2: TIWLabel;
    TIWCheckListBox1: TTIWCheckListBox;
    TIWCheckList2: TTIWCheckList;
    IWCheckBox1: TIWCheckBox;
    IWCheckBox2: TIWCheckBox;
    IWLabel3: TIWLabel;
    IWRadioGroup1: TIWRadioGroup;
    IWRadioGroup2: TIWRadioGroup;
    IWLabel4: TIWLabel;
    IWListbox1: TIWListbox;
    IWButton1: TIWButton;
    IWListbox2: TIWListbox;
    IWButton2: TIWButton;
    procedure IWCheckBox1Click(Sender: TObject);
    procedure IWCheckBox2Click(Sender: TObject);
    procedure IWAppFormCreate(Sender: TObject);
    procedure IWRadioGroup1Click(Sender: TObject);
    procedure IWRadioGroup2Click(Sender: TObject);
    procedure IWButton1Click(Sender: TObject);
    procedure IWButton2Click(Sender: TObject);
  public
  end;

implementation

{$R *.dfm}


procedure TformCheckLists.IWCheckBox1Click(Sender: TObject);
begin
  if (IWCheckBox1.Checked) then
    TIWCheckListBox1.CheckAllBox := true
  else
    TIWCheckListBox1.CheckAllBox := false;

end;

procedure TformCheckLists.IWCheckBox2Click(Sender: TObject);
begin
  if (IWCheckBox2.Checked) then
    TIWCheckList2.CheckAllBox := true
  else
    TIWCheckList2.CheckAllBox := false;

end;

procedure TformCheckLists.IWAppFormCreate(Sender: TObject);
begin
  TIWCheckListBox1.Selected[1] := true;
  TIWCheckListBox1.Selected[3] := true;

  TIWCheckList2.Selected[0] := true;
  TIWCheckList2.Selected[2] := true;
end;

procedure TformCheckLists.IWRadioGroup1Click(Sender: TObject);
begin
  if (IWRadioGroup1.ItemIndex = 0) then
    TIWCheckListBox1.CheckAllHelp := htNone;
  if (IWRadioGroup1.ItemIndex = 1) then
    TIWCheckListBox1.CheckAllHelp := htLabel;
  if (IWRadioGroup1.ItemIndex = 2) then
    TIWCheckListBox1.CheckAllHelp := htHint;
end;

procedure TformCheckLists.IWRadioGroup2Click(Sender: TObject);
begin
  if (IWRadioGroup2.ItemIndex = 0) then
    TIWCheckList2.CheckAllHelp := htNone;
  if (IWRadioGroup2.ItemIndex = 1) then
    TIWCheckList2.CheckAllHelp := htLabel;
  if (IWRadioGroup2.ItemIndex = 2) then
    TIWCheckList2.CheckAllHelp := htHint;

end;



procedure TformCheckLists.IWButton1Click(Sender: TObject);
var
i: integer;
begin
  IWListbox1.Clear;
  for i:=0 to TIWCheckListBox1.Items.Count do
  begin
    if TIWCheckListBox1.Selected[i] then
      IWListbox1.Items.Add(TIWCheckListBox1.Items.Strings[i]);
  end;


end;

procedure TformCheckLists.IWButton2Click(Sender: TObject);
var
i: integer;
begin
  IWListbox2.Clear;
  for i:=0 to TIWCheckList2.Items.Count do
  begin
    if TIWCheckList2.Selected[i] then
      IWListbox2.Items.Add(TIWCheckList2.Items.Strings[i]);
  end;
end;

end.
