anchor.diff:    ;
   
   
  -{ TfpgFileNameEdit }
  -
  -constructor TfpgFileNameEdit.Create(AOwner: TComponent);
  +{ TfpgBaseEditButton }
  +
  +procedure TfpgBaseEditButton.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;
  +
  +function TfpgBaseEditButton.GetExtraHint: TfpgString;
  +begin
  +  Result := FEdit.ExtraHint;
  +end;
  +
  +procedure TfpgBaseEditButton.SetExtraHint(const AValue: TfpgString);
  +begin
  +  FEdit.ExtraHint := AValue;
  +end;
  +
  +function TfpgBaseEditButton.GetOnShowHint: THintEvent;
  +begin
  +  // rewire the FEdit event to the parent (composite) component
  +  Result := FEdit.OnShowHint;
  +end;
  +
  +procedure TfpgBaseEditButton.SetOnShowHint(const AValue: THintEvent);
  +begin
  +  // rewire the FEdit event to the parent (composite) component
  +  FEdit.OnShowHint := AValue;
  +end;
  +
  +procedure TfpgBaseEditButton.SetHint(const AValue: TfpgString);
  +begin
  +  FEdit.Hint := AValue;
  +end;
  +
  +function TfpgBaseEditButton.GetHint: TfpgString;
  +begin
  +  Result := FEdit.Hint;
  +end;
  +
  +procedure TfpgBaseEditButton.InternalButtonClick(Sender: TObject);
  +begin
  +  // do nothing
  +  if Assigned(OnButtonClick) then
  +    OnButtonClick(self);
  +end;
  +
  +procedure TfpgBaseEditButton.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;
  +
  +constructor TfpgBaseEditButton.Create(AOwner: TComponent);
   begin
     inherited Create(AOwner);
     FWidth          := 140;
     FHeight         := 24;
  -  FFilter         := '';
     FReadOnly       := False;
   
     FEdit := TfpgEdit.Create(self);
  
positive.code:   FFilter := AValue;
  end;
  
  function TfpgFileNameEdit.GetExtraHint: TfpgString;
  begin
    Result := FEdit.ExtraHint;
  end;
  
  procedure TfpgFileNameEdit.SetExtraHint(const AValue: TfpgString);
  begin
    FEdit.ExtraHint := AValue;
  end;
  
  procedure TfpgFileNameEdit.btnClick(Sender: TObject);
  var
    dlg: TfpgFileDialog;
  begin
  
negative.code:   ;
  
  type
    TfpgBaseEditButton = class(TfpgAbstractPanel)
    private
      FOnButtonClick: TNotifyEvent;
      FReadOnly: Boolean;
      procedure SetReadOnly(const AValue: Boolean);
      function GetExtraHint: TfpgString;
      procedure SetExtraHint(const AValue: TfpgString);
    protected
      FEdit: TfpgEdit;
      FButton: TfpgButton;
      function  GetOnShowHint: THintEvent; override;
      procedure SetOnShowHint(const AValue: THintEvent); override;
      procedure SetHint(const AValue: TfpgString); override;
      function  GetHint: TfpgString; override;
      procedure InternalButtonClick(Sender: TObject); virtual;
      procedure HandleResize(AWidth, AHeight: TfpgCoord); override;
      property  ExtraHint: TfpgString read GetExtraHint write SetExtraHint;
      property  ReadOnly: Boolean read FReadOnly write SetReadOnly default False;
      property  OnButtonClick: TNotifyEvent read FOnButtonClick write FOnButtonClick;
    public
      constructor Create(AOwner: TComponent); override;
    end;
  
  
    TfpgFileNameEdit = class(TfpgBaseEditButton)
    private
      FFilter: TfpgString;
      FInitialDir: TfpgString;
      procedure SetFilter(const AValue: TfpgString);
      procedure SetFileName(const AValue: TfpgString);
      function GetFileName: TfpgString;
    protected
      procedure HandlePaint; override;
      procedure InternalButtonClick(Sender: TObject); override;
    public
      constructor Create(AOwner: TComponent); override;
    published
      property ExtraHint;
      property FileName: TfpgString read GetFileName write SetFileName;
      property InitialDir: TfpgString read FInitialDir write FInitialDir;
      property Filter: TfpgString read FFilter write SetFilter;
      property ReadOnly;
      property TabOrder;
      property OnButtonClick;
      property OnShowHint;
    end;
  
  
    TfpgDirectoryEdit = class(TfpgBaseEditButton)
    private
      FRootDirectory: TfpgString;
      function GetDirectory: TfpgString;
      procedure SetDirectory(const AValue: TfpgString);
    protected
      procedure HandlePaint; override;
      procedure InternalButtonClick(Sender: TObject); override;
    public
      constructor Create(AOwner: TComponent); override;
    published
      property Directory: TfpgString read GetDirectory write SetDirectory;
      property ExtraHint;
      property RootDirectory: TfpgString read FRootDirectory write FRootDirectory;
      property ReadOnly;
      property TabOrder;
      property OnButtonClick;
      property OnShowHint;
    end;
  
  
    TfpgFontEdit = class(TfpgBaseEditButton)
    protected
      function GetFontDesc: TfpgString; virtual;
      procedure SetFontDesc(const AValue: TfpgString); virtual;
      procedure HandlePaint; override;
      procedure InternalButtonClick(Sender: TObject); override;
    public
      constructor Create(AOwner: TComponent); override;
    published
      property FontDesc: TfpgString read GetFontDesc write SetFontDesc;
      property ReadOnly;
      property TabOrder;
      property OnButtonClick;
      property OnShowHint;
    end;
  
  
  