yo habia posteado algo parecido, con el componente OpenDialog q no esta disponible en FMX para android...
Ya habia pedido ayuda acerca de esto y no habia mucho que hacer y decidi hacerme algo parecido a OpenDialog de app de otros...
ya se sabe que en FMX cuando es para Android, los componentes de la paleta Dialog, se desabilitan, lo cual me parece una gran estupides y cabrona de Embarcadero al no poner esta opcion, pero bueno al no haber algun amiguete que me de luz yo se la ofresco, puede que tenga fallitos pero se que podeis mejorarla e incluso alguien la puede hacer componente (no me salen los componentes, jajaja, es tarea pendiente)... sin tanta baba adjunto esta todo, y aqui tambien:
Código Delphi
[-]
unit OpenDialog;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
FMX.Layouts, FMX.ListBox,
System.StrUtils,System.IOUtils;
type
TForm1 = class(TForm)
Label1: TLabel; ListBox1: TListBox; Layout1: TLayout; Button1: TButton; Button2: TButton; procedure verArchivos(tuDir: String; listado: TStrings);
function loadDir(listaDir: TStringList):String;
procedure ListBox1ItemClick(const Sender: TCustomListBox;
const Item: TListBoxItem);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
Direccion: TStringList;
F: TextFile;
implementation
{$R *.fmx}
procedure TForm1.verArchivos(tuDir: String; listado: TStrings);
var
FileSearch: TSearchRec;
LList: TStringDynArray;
I: Integer;
LSearchOption: TSearchOption;
begin
chDir(tuDir);
if FindFirst('*.db', faReadOnly + faHidden, FileSearch)=0 then
repeat
listado.Add(FileSearch.Name);
until
FindNext(FileSearch)<>0;
FindClose(FileSearch);
LList:=TDirectory.GetDirectories(tuDir);
for I:=0 to Length(LList)-1 do
listado.Add(RightStr(LList[i],Length(LList[i])-Length(tuDir))+'/');
end;
function TForm1.loadDir(listaDir: TStringList): String;
var
I: Integer;
begin
for I:=0 to listaDir.Count-1 do
begin
Result:=Result+listaDir[i];
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Label1.Text<>#47 then
begin
Direccion.Delete(Direccion.Count-1);
Label1.Text:=loadDir(Direccion);
ListBox1.Clear;
verArchivos(loadDir(Direccion),ListBox1.Items);
ListBox1.ItemIndex:=-1;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Direccion:=TStringList.Create;
Direccion.Add(#47);
verArchivos(loadDir(Direccion),ListBox1.Items);
Label1.Text:=#47;
end;
procedure TForm1.ListBox1ItemClick(const Sender: TCustomListBox;
const Item: TListBoxItem);
var
g:string;
begin
if (ListBox1.Selected.Text<>'') then
begin
g:=ListBox1.Selected.Text;
Direccion.Add(g);
ListBox1.Clear;
Label1.Text:=loadDir(Direccion);
if (RightStr(g,1)='/') then
begin
verArchivos(loadDir(Direccion),ListBox1.Items);
ListBox1.ItemIndex:=-1;
end;
end;
end;
end.
Me gustaria que la mejoraran para que tenga uso general en una Unit o sea adicional la unit y ya esta a trabajar o mejor hacer un componente que nos quite el peso de diseñar como va a quedar la Caja de Dialogo, espero que asi sea, gracias a todos los lectores.