Autor Beitrag
Christian R.
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 20.11.05 02:54 
Ich suche eine Möglichkeit, an Stelle von Dateien mit 'TOpenDialog', Ordner mit einer Komponente wie z. B. 'TOpenFolderDialog' zu wählen. Hab in Delphi keine Komponente unter 'Dialoge' gefunden, 'TOpenDialog' bietet es auch nicht an. :lupe: Vielleicht hat es auch jemandem gefehlt und derjenige hat seine Komponente zum Download bereit gestellt?
elron
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34

WIN XP
D5 Standard
BeitragVerfasst: So 20.11.05 07:23 
bastel die dir selbst:

2 Forms, eine wird beim Klick geöffnet
ausblenden Delphi-Quelltext
1:
2:
3:
  MyForm := TForm2.Create(self);
  MyForm.ShowModal;
  MyForm.Free;

die 2.:
-DirectoryOutline
-Button
dann kannst über "DirectoryOutline1.Directory" den wert abfragen, musst den nur noch an form1 zurückliefern

das sähe dann so aus:
Projekt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.


Unit1:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Unit2;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  MyForm : TForm2;

implementation

{$R *.DFM}



procedure TForm1.Button1Click(Sender: TObject);
begin
MyForm := TForm2.Create(self);
MyForm.Show;
end;

end.


Unit2:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Grids, Outline, DirOutln;

type
  TForm2 = class(TForm)
    DirectoryOutline1: TDirectoryOutline;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form2: TForm2;

implementation

uses Unit1;

{$R *.DFM}

procedure TForm2.Button1Click(Sender: TObject);
begin
Form1.Edit1.text := DirectoryOutline1.Directory;
Self.Close;
end;

end.
Einloggen, um Attachments anzusehen!
_________________
JAJA, ich weiß, ich bin ein Anfänger...
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 20.11.05 08:16 
@elron: Deine Lösung hat allerdings den Nachteil, dass sie z.B. das Windows Netzwerk nicht anzeigt. Falls "Neurologic Scientist" nur Ordner haben will, die auf Laufwerken verfügar sind, ist deine Lösung allerdings durchaus in Ordnung.
Eine andere Lösung wäre beispielsweise dieser Beitrag von user profile iconMathiasSimmack.

AXMD
Christian R.
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 20.11.05 09:28 
Perfekt. Genau das, was ich gesucht habe. Das typische Bild eines FolderBrowser.

Vielen Dank für die schnelle Hilfe.
P.S.: Ich verstehe nicht, warum Borland keine Komponente eines FolderBrowser implementiert hat. Aber naja ...

//Edit:
Mich begeistert allein schon das Feature, bestimmte Inhalte in den Ordnern vorauszusetzen (Filter). Genau diese Funktion hätte ich sonst nach-implementieren müssen.


Zuletzt bearbeitet von Christian R. am So 20.11.05 10:17, insgesamt 1-mal bearbeitet
Lake
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 78


D6 prof., Delphi 10.2 Tokyo
BeitragVerfasst: So 20.11.05 09:55 
Ich verwende:

ausblenden Delphi-Quelltext
1:
2:
 if SelectDirectory('Verzeichnis wählen','',s) then
   edQuellVerzeichnis.text := s ;
Christian R.
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 20.11.05 10:25 
Ok. Ich nehme meinen P.S.-Kommentar zurück. Borland war doch so fix. Warum nicht gleich als Komponente?
Mal sehen, vielleicht leite ich doch von Borland ab. Es missfällt mir, Sachen extern einzubinden, wenn sie doch schon vorhanden sind. O.K. Der Thread war ja nun schon als 'erledigt' markiert. Danke trotzdem für den Nachtrag von Lake.
rn22
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70



BeitragVerfasst: Di 05.09.06 19:09 
Titel: Win2000-Version
Hallo

ich suche auch so einen Directory Dialog.

Allerdings einen im zeitgemäßen Windows-Stil
also:
Desktop als "overste Instanz"
korrekte Symbole der Laufwerke/Ordner

hat jemand mal so was gesehen?

Grüße
_frank_
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 343
Erhaltene Danke: 1

Win XP
Delphi 3 Prof / Turbo Delphi Explorer
BeitragVerfasst: Di 05.09.06 19:37 
siehe weiter oben in diesem thread...
www.delphi-forum.de/....php?p=312092#312092

_________________
EB FE (die wahrscheinlich kürzeste Endlosschleife der Welt :) )
BA 01 00 00 00 52 EB 09 BB 4D 11 86 7C FF D3 EB 0D E8 F2 FF FF FF 63 68 61 72 6D 61 70 00 C3