anchor.diff:  var
     I: Integer;
     AllowedChars: TSetOfAnsiChar;
  -  OnlyMinus: Boolean;
  -begin
  +  OnlyMinus, IsEmpty: Boolean;
  +begin
  +  IsEmpty := (fText = #8); // When deleting text with Backspace last character is still in string - backspace character (#8)
  +
     AllowedChars := ['0'..'9'];
     //Validate contents
     for I := Length(fText) downto 1 do
  
positive.code: 
    OnlyMinus := (fText = '-');
  
    if (fText = '') or OnlyMinus then
      Value := 0
    else
      SetValueNCheckRange(StrToInt64(fText));
  
    if OnlyMinus then fText := '-'; //Set text back to '-' while still editing.
  
    CursorPos := Min(CursorPos, Length(fText)); //In case we had leading zeros in fText string
  
  
negative.code: end;
  
  
  procedure TKMNumericEdit.CheckValueOnUnfocus;
  begin
    if (fText = '-') or (fText = '') then //after unfocus, if only '-' is in string, set value to 0
      Value := 0;
  end;
  
  
  procedure TKMNumericEdit.FocusChanged(aFocused: Boolean);
  begin
    inherited;
    if not aFocused then
      CheckValueOnUnfocus;
  end;
  
  
  procedure TKMNumericEdit.ControlMouseDown(Sender: TObject; Shift: TShiftState);
  begin
    inherited;
    if (Sender <> Self) then
      CheckValueOnUnfocus;
  end;
  
  
  