anchor.diff:  var
     x: TfpgCoord;
     r: TfpgRect;
  -
  -  // paint selection rectangle
  -  procedure DrawSelection;
  -  var
  -    lcolor: TfpgColor;
  -    rs: TfpgRect;
  -  begin
  -    if Focused then
  -    begin
  -      lcolor := clSelection;
  -      Canvas.SetTextColor(clSelectionText);
  -    end
  -    else
  -    begin
  -      lcolor := clInactiveSel;
  -      Canvas.SetTextColor(clText1);
  -    end;
  -
  -    rs.SetRect(FVisSelStartPx, r.Top + FHeightMargin, FVisSelEndPx - FVisSelStartPx, FFont.Height);
  -    Canvas.SetColor(lcolor);
  -    Canvas.FillRectangle(rs);
  -    Canvas.SetTextColor(clWhite);
  -    Canvas.AddClipRect(rs);
  -    fpgStyle.DrawString(Canvas, -FDrawOffset - FSideMargin, r.Top + FHeightMargin, FVisibleText, Enabled);
  -    Canvas.ClearClipRect;
  -  end;
  -
  -begin
  +begin
  +  inherited HandlePaint;
  +
     if Alignment = taRightJustify then
     begin
  -    inherited HandlePaint;
       r := GetClientRect;
       Canvas.SetClipRect(r);
  -    Canvas.Clear(BackgroundColor);
  +
  +    if Enabled then
  +      Canvas.SetColor(FBackgroundColor)
  +    else
  +      Canvas.SetColor(clWindowBackground);
  +    Canvas.FillRectangle(r);
  +
       Canvas.SetFont(Font);
       Canvas.SetTextColor(TextColor);
       x := r.Width - Font.TextWidth(Text) - FSideMargin;
  -    Canvas.DrawString(x,r.Top + FHeightMargin,Text);
  +    fpgStyle.DrawString(Canvas, x, r.Top + FHeightMargin, Text, Enabled);
       if Focused then
       begin
         // drawing selection
  
positive.code:     Canvas.SetColor(FBackgroundColor)
    else
      Canvas.SetColor(clWindowBackground);
  
    Canvas.FillRectangle(r);
  
    Canvas.SetFont(FFont);
    Canvas.SetTextColor(FTextColor);
    fpgStyle.DrawString(Canvas, -FDrawOffset + FSideMargin, r.Top + FHeightMargin, FVisibleText, Enabled);
  
    if Focused then
    begin
      // drawing selection
      if FSelOffset <> 0 then
        DrawSelection;
  
      // drawing cursor
      fpgCaret.SetCaret(Canvas, FCursorPx, r.Top + FHeightMargin, fpgCaret.Width, FFont.Height);
    end
    else
    begin
      // drawing selection
      if (AutoSelect = False) and (FSelOffset <> 0) and (HideSelection = False) then
        DrawSelection;
      fpgCaret.UnSetCaret(Canvas);
    end;
  end;
  
  procedure TfpgBaseEdit.HandleResize(awidth, aheight: TfpgCoord);
  
negative.code: procedure TfpgBaseEdit.PasteFromClipboard;
  begin
    DoPaste;
  end;
  
  { TfpgBaseTextEdit }
  
  procedure TfpgBaseTextEdit.HandlePaint;
  var
    r: TfpgRect;
  begin
    inherited HandlePaint;
    r := Canvas.GetClipRect;    // contains adjusted size based on borders
  
    if (FVisibleText = '') and not Focused then
    begin
      Canvas.SetTextColor(clShadow1);
      fpgStyle.DrawString(Canvas, -FDrawOffset + GetMarginAdjustment, r.Top + FHeightMargin, FHint, Enabled);
    end
    else
    begin
      Canvas.SetTextColor(FTextColor);
      fpgStyle.DrawString(Canvas, -FDrawOffset + GetMarginAdjustment, r.Top + FHeightMargin, FVisibleText, Enabled);
    end;
  
    if Focused then
    begin
      // drawing selection
      if FSelOffset <> 0 then
        DrawSelection;
  
      // drawing cursor
      fpgCaret.SetCaret(Canvas, FCursorPx, r.Top + FHeightMargin, fpgCaret.Width, FFont.Height);
    end
    else
    begin
      // drawing selection
      if (AutoSelect = False) and (FSelOffset <> 0) and (HideSelection = False) then
        DrawSelection;
      fpgCaret.UnSetCaret(Canvas);
    end;
  
  end;
  
  { TfpgBaseNumericEdit }
  