anchor.diff:    if grid.CurrentEntry.EntryType <> etDir then
       edFileName.Text := grid.CurrentEntry.Name;
   
  -  if FOpenMode then
  -    btnOK.Enabled := grid.CurrentEntry.EntryType = etFile
  -  else
  -    btnOK.Enabled := edFileName.Text <> '';
  +  UpdateButtonState;
   
     lbFileInfo.Text := s;
   end;
  
positive.code:     Anchors := [anLeft, anRight, anBottom];
      Text := '';
      FontDesc := '#Edit1';
    end;
    
    { Filter section }
  
negative.code: procedure TfpgFileDialog.UpDirClick(Sender: TObject);
  begin
    SetCurrentDirectory('..');
  end;
  
  procedure TfpgFileDialog.edFilenameChanged(Sender: TObject);
  begin
    UpdateButtonState;
  end;
  
  procedure TfpgFileDialog.UpdateButtonState;
  begin
    if FOpenMode then
      btnOK.Enabled := grid.CurrentEntry.EntryType = etFile
    else
      btnOK.Enabled := edFileName.Text <> '';
  end;
  
  procedure TfpgFileDialog.SetCurrentDirectory(const ADir: string);
  