anchor.diff:    end;
   
   
  -  {EditField}
  -  TKMEdit = class(TKMControl)
  +  TKMSelectableEdit = class(TKMControl)
     private
       fFont: TKMFont;
       fText: UnicodeString;
  +    fLeftIndex: Integer; //The position of the character shown left-most when text does not fit
  +
  +    fCursorPos: Integer;
  +    fSelectable: Boolean;
       fSelectionStart: Integer;
       fSelectionEnd: Integer;
       fSelectionInitialCursorPos: Integer;
  -    fAllowedChars: TAllowedChars;
  -    fCursorPos: Integer;
  -    fLeftIndex: Integer; //The position of the character shown left-most when text does not fit
  -    fSelectable: Boolean;
  +
       procedure SetCursorPos(aPos: Integer);
  -    procedure SetText(aText: UnicodeString);
  -    function IsCharValid(aChar: WideChar): Boolean;
  -    procedure ValidateText;
  -    function KeyEventHandled(Key: Word; Shift: TShiftState): Boolean;
  -
       function GetCursorPosAt(X: Integer): Integer;
       procedure ResetSelection;
       function HasSelection: Boolean;
  
positive.code:     RText := StringOfChar('*', Length(fText))
    else
      RText := fText;
  
    RText := Copy(RText, fLeftIndex+1, Length(RText)); //Remove characters to the left of fLeftIndex
  
    if HasSelection then
    begin
      BeforeSelectionText := Copy(fText, fLeftIndex+1, max(fSelectionStart, fLeftIndex) - fLeftIndex);
      SelectionText := Copy(fText, max(fSelectionStart, fLeftIndex)+1, fSelectionEnd - max(fSelectionStart, fLeftIndex));
  
      BeforeSelectionW := gRes.Fonts[fFont].GetTextSize(BeforeSelectionText).X;
      SelectionW := gRes.Fonts[fFont].GetTextSize(SelectionText).X;
  
      TKMRenderUI.WriteShape(AbsLeft+4+BeforeSelectionW, AbsTop+3, min(SelectionW, Width-8), Height-6, clTextSelection);
    end;
  
    TKMRenderUI.WriteText(AbsLeft+4, AbsTop+3, Width-8, RText, fFont, taLeft, Col, not ShowColors, True); //Characters that do not fit are trimmed
  
  
negative.code:   begin
      DeleteSelectedText;
    end
    else if Length(fText) >= GetMaxLength then Exit;
  
    Insert(Key, fText, CursorPos + 1);
    CursorPos := CursorPos + 1; //Before ValidateText so it moves the cursor back if the new char was invalid
  