anchor.diff:  {
       fpGUI  -  Free Pascal GUI Toolkit
   
  -    Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
  +    Copyright (C) 2006 - 2012 See the file AUTHORS.txt, included in this
       distribution, for details of the copyright.
   
       See the file COPYING.modifiedLGPL, included in this distribution,
  
positive.code: 
    // calculate position
    diff    := Max - Min; // diff..
    aPos    := Position - Min;	// absolute position
    percent := round(((100 / diff) * aPos));
    txt     := IntToStr(percent) + '%';
    pos     := round(percent * (Width-2) / 100);
  
negative.code:   // paint percentage if required
    if FShowCaption then
    begin
      x := (Width - FFont.TextWidth(txt)) div 2;
      y := (Height - FFont.Height) div 2;
      Canvas.SetTextColor(TextColor);
      Canvas.Font := FFont;
      Canvas.DrawString(x, y, txt);
    end;
  end;
  
  