anchor.diff: -﻿unit KM_Controls;
  +unit KM_Controls;
   {$I KaM_Remake.inc}
   interface
   uses
  
positive.code: 
    CursorPos := Min(CursorPos, Length(fText)); //In case we had leading zeros in fText string
  
    if Assigned(OnChange) then
      OnChange(Self);
  end;
  
  
  
negative.code:   inherited KeyDown(Key, Shift);
  
    case Key of
      VK_UP:      begin
                    SetValueNCheckRange(Int64(Value) + 1 + 9*Byte(ssShift in Shift));
                    Changed;
                  end;
      VK_DOWN:    begin
                    SetValueNCheckRange(Int64(Value) - 1 - 9*Byte(ssShift in Shift));
                    Changed;
                  end;
      VK_DELETE:  ValidateText; //Update value, cause we just deleted text and KeyPress was not invoked
    end;
  end;
  