anchor.diff:    end;
   end;
   
  -procedure TfpgFontEdit.HandleResize(AWidth, AHeight: TfpgCoord);
  -begin
  -  inherited HandleResize(AWidth, AHeight);
  -  if csDesigning in ComponentState then
  -  begin
  -    FEdit.Visible := False;
  -    FButton.Visible := False;
  -  end
  -  else
  -  begin
  -    FEdit.SetPosition(0, 0, AWidth - AHeight, AHeight);
  -    FButton.SetPosition(AWidth - AHeight, 0, AHeight, AHeight);
  -  end;
  +procedure TfpgFontEdit.InternalButtonClick(Sender: TObject);
  +var
  +  f: TfpgString;
  +begin
  +  f := FontDesc;
  +  if SelectFontDialog(f) then
  +    FontDesc := f;
  +  inherited InternalButtonClick(Sender);
   end;
   
   constructor TfpgFontEdit.Create(AOwner: TComponent);
   begin
     inherited Create(AOwner);
  -  Text            := '';
  -  FWidth          := 140;
  -  FHeight         := 24;
  -  FReadOnly       := False;
  -
  -  FEdit := TfpgEdit.Create(self);
  -  with FEdit do
  -  begin
  -    Name := 'FEdit';
  -    Text := '#Edit1';
  -    FontDesc := '#Edit1';
  -    TabOrder := 0;
  -  end;
  -
  -  FButton := TfpgButton.Create(self);
  -  with FButton do
  -  begin
  -    Name := 'FButton';
  -    Text := '';
  -    FontDesc := '#Label1';
  -    ImageMargin := -1;
  -    ImageName := 'stdimg.font';
  -    ImageSpacing := 0;
  -    TabOrder := 1;
  -    OnClick := @btnClick;
  -  end;
  +  FButton.ImageName := 'stdimg.font';
   end;
   
   
  
positive.code:   finally
      dlg.Free;
    end;
    if Assigned(OnButtonClick) then
      OnButtonClick(self);
  end;
  
  procedure TfpgFileNameEdit.SetFileName(const AValue: TfpgString);
  begin
    FEdit.Text := AValue;
  end;
  
  function TfpgFileNameEdit.GetFileName: TfpgString;
  begin
    Result := FEdit.Text;
  end;
  
  procedure TfpgFileNameEdit.SetReadOnly(const AValue: Boolean);
  begin
    if FReadOnly = AValue then
      Exit;
    FReadOnly := AValue;
    FEdit.ReadOnly := FReadOnly;
    FButton.Enabled := not FReadOnly;   // Buttons don't have ReadOnly property.
  end;
  
  procedure TfpgFileNameEdit.HandlePaint;
  var
    img: TfpgImage;
  begin
    inherited HandlePaint;
    // only so that it looks pretty in the UI Designer
    if csDesigning in ComponentState then
    begin
      FEdit.Visible := False;
      FButton.Visible := False;
      Canvas.Clear(clBoxColor);
      fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height);
      fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]);
      Canvas.SetFont(fpgApplication.DefaultFont);
      if Filename <> '' then
      begin
        Canvas.TextColor := clText3;
        Canvas.DrawText(4, 0, Width - Height, Height, Filename, [txtLeft, txtVCenter]);
      end
      else
      begin
        Canvas.TextColor := clShadow1;
        Canvas.DrawText(0, 0, Width - Height, Height, ClassName, [txtHCenter, txtVCenter]);
      end;
      img := fpgImages.GetImage('stdimg.folderfile'); // don't free the img instance - we only got a reference
      if img <> nil then
        Canvas.DrawImage(Width-Height+((Height-img.Width) div 2), (Height-img.Height) div 2, img);
    end;
  end;
  
  procedure TfpgFileNameEdit.HandleResize(AWidth, AHeight: TfpgCoord);
  begin
    inherited HandleResize(AWidth, AHeight);
    if csDesigning in ComponentState then
    begin
      FEdit.Visible := False;
      FButton.Visible := False;
    end
    else
    begin
      FEdit.SetPosition(0, 0, AWidth - AHeight, AHeight);
      FButton.SetPosition(AWidth - AHeight, 0, AHeight, AHeight);
    end;
  end;
  
  
  { TfpgDirectoryEdit}
  
  constructor TfpgDirectoryEdit.Create(AOwner: TComponent);
  begin
    inherited Create(AOwner);
    FWidth          := 140;
    FHeight         := 24;
    FReadOnly       := False;
  
    FEdit := TfpgEdit.Create(self);
    with FEdit do
    begin
      Name := 'FEdit';
      Text := '';
      FontDesc := '#Edit1';
      TabOrder := 0;
    end;
  
    FButton := TfpgButton.Create(self);
    with FButton do
    begin
      Name := 'FButton';
      Text := '';
      FontDesc := '#Label1';
      ImageMargin := -1;
      ImageName := 'stdimg.folder';
      ImageSpacing := 0;
      TabOrder := 1;
      OnClick := @btnClick;
    end;
  end;
  
  function TfpgDirectoryEdit.GetDirectory: TfpgString;
  begin
    Result := FEdit.Text;
  end;
  
  procedure TfpgDirectoryEdit.btnClick(Sender: TObject);
  var
    dlg: TfpgSelectDirDialog;
  begin
    dlg := TfpgSelectDirDialog.Create(nil);
    try
      if FRootDirectory <> '' then
        dlg.RootDirectory := FRootDirectory;
      dlg.SelectedDir := Directory;
      if dlg.ShowModal = mrOK then
      begin
        FEdit.Text:= dlg.SelectedDir;
      end;
    finally
      dlg.Free;
    end;
    if Assigned(OnButtonClick) then
  	  OnButtonClick(self);
  end;
  
  function TfpgDirectoryEdit.GetExtraHint: TfpgString;
  begin
    Result := FEdit.ExtraHint;
  end;
  
  procedure TfpgDirectoryEdit.SetDirectory(const AValue: TfpgString);
  begin
    FEdit.Text := AValue;
  end;
  
  procedure TfpgDirectoryEdit.SetExtraHint(const AValue: TfpgString);
  begin
    FEdit.ExtraHint := AValue;
  end;
  
  procedure TfpgDirectoryEdit.SetReadOnly(const AValue: Boolean);
  begin
    if FReadOnly = AValue then
      Exit;
    FReadOnly := AValue;
    FEdit.ReadOnly := FReadOnly;
    FButton.Enabled := not FReadOnly;   // Buttons don't have ReadOnly property.
  end;
  
  procedure TfpgDirectoryEdit.HandlePaint;
  
negative.code:     Text := '';
      FontDesc := '#Label1';
      ImageMargin := -1;
      ImageName := 'stdimg.elipses';
      ImageSpacing := 0;
      TabOrder := 1;
      OnClick := @InternalButtonClick;
    end;
  end;
  
  
  
  { TfpgFileNameEdit }
  
  constructor TfpgFileNameEdit.Create(AOwner: TComponent);
  begin
    inherited Create(AOwner);
    FFilter         := '';
    FButton.ImageName := 'stdimg.folderfile';
  end;
  
  procedure TfpgFileNameEdit.SetFilter(const AValue: TfpgString);
  