anchor.diff:  
   
   { TKMCheckBox }
  -constructor TKMCheckBox.Create(aParent: TKMPanel; aLeft, aTop, aWidth, aHeight: Integer; const aCaption: UnicodeString; aFont: TKMFont);
  +constructor TKMCheckBox.Create(aParent: TKMPanel; aLeft, aTop, aWidth, aHeight: Integer; const aCaption: UnicodeString;
  +                               aFont: TKMFont; aHasSemiState: Boolean = False);
   begin
     inherited Create(aParent, aLeft, aTop, aWidth, aHeight);
     fFont     := aFont;
     fCaption  := aCaption;
  +  fHasSemiState := aHasSemiState;
     LineWidth := 1;
     LineColor := clChkboxOutline;
   end;
   
   
  +procedure TKMCheckBox.SetChecked(aChecked: Boolean);
  +begin
  +  if aChecked then
  +    fState := cbsChecked
  +  else
  +    fState := cbsUnchecked;
  +end;
  +
  +
  +function TKMCheckBox.GetCheckedBool: Boolean;
  +begin
  +  Result := fState = cbsChecked;
  +end;
  +
  +
  +function TKMCheckBox.IsSemiChecked: Boolean;
  +begin
  +  Result := fState = cbsSemiChecked;
  +end;
  +
  +
   procedure TKMCheckBox.Check;
   begin
  -  fChecked := True;
  +  fState := cbsChecked;
  +end;
  +
  +
  +procedure TKMCheckBox.SemiCheck;
  +begin
  +  fState := cbsSemiChecked;
   end;
   
   
   procedure TKMCheckBox.Uncheck;
   begin
  -  fChecked := False;
  -end;
  -
  -
  -procedure TKMCheckBox.SwitchCheck;
  -begin
  -  fChecked := not fChecked;
  +  fState := cbsUnchecked;
  +end;
  +
  +
  +procedure TKMCheckBox.SwitchCheck(aForward: Boolean = True);
  +begin
  +  if fHasSemiState then
  +    fState := TKMCheckBoxState((Byte(fState) + 3 + 2*Byte(aForward) - 1) mod 3)
  +  else
  +  begin
  +    if Checked then
  +      Uncheck
  +    else
  +      Check;
  +  end;
   end;
   
   
   procedure TKMCheckBox.MouseUp(X,Y: Integer; Shift: TShiftState; Button: TMouseButton);
   begin
     if (csDown in State) and (Button = mbLeft) then
  -    fChecked := not fChecked;
  +    case fState of
  +      cbsSemiChecked,
  +      cbsUnchecked:   Check; //Let's assume we prefer check for now
  +      cbsChecked:     Uncheck;
  +    end;
     inherited; //There are OnMouseUp and OnClick events there
   end;
   
  
positive.code:     Caption: UnicodeString;
      Font: TKMFont;
      FontColor: TColor4;
      constructor Create(aParent: TKMPanel; aWidth, aHeight: Integer; const aCaption: UnicodeString = ''; aImageType: TKMPopUpBGImageType = pubgitYellowish);
      procedure PaintPanel(aPaintLayer: Integer); override;
    end;
  
  
negative.code:   end;
  
  
    TKMCheckBoxState = (cbsChecked, cbsSemiChecked, cbsUnchecked);
  
    { Checkbox }
    TKMCheckBox = class(TKMControl)
    private
      fCaption: UnicodeString;
      fState: TKMCheckBoxState;
      fHasSemiState: Boolean;
      fFont: TKMFont;
  
      function GetCheckedBool: Boolean;
    public
      DrawOutline: Boolean;
      LineColor: TColor4; //color of outline
      LineWidth: Byte;
      constructor Create(aParent: TKMPanel; aLeft, aTop, aWidth, aHeight: Integer; const aCaption: UnicodeString;
                         aFont: TKMFont; aHasSemiState: Boolean = False); overload;
      property Caption: UnicodeString read fCaption write fCaption;
      procedure SetChecked(aChecked: Boolean);
      property Checked: Boolean read GetCheckedBool write SetChecked;
      property CheckState: TKMCheckBoxState read fState write fState;
      function IsSemiChecked: Boolean;
      procedure Check;
      procedure Uncheck;
      procedure SemiCheck;
      procedure SwitchCheck(aForward: Boolean = True);
      procedure MouseUp(X,Y: Integer; Shift: TShiftState; Button: TMouseButton); override;
      procedure Paint; override;
    end;
  