summaryrefslogtreecommitdiff
path: root/src/gui/newdirdialog.inc
blob: 4c8be8e5fa5ca0c198c553fcc7f321750fb7f148 (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

{%mainunit fpg_dialogs.pas}

{$IFDEF read_interface}


  { TfpgNewDirDialog }

  TfpgNewDirDialog = class(TfpgBaseDialog)
  private
    lblTitle: TfpgLabel;
    edDirectory: TfpgEdit;
    function    GetDirectory: TfpgString;
  public
    constructor Create(AOwner: TComponent); override;
    property    Directory: TfpgString read GetDirectory;
  end;


{$ENDIF read_interface}



{$IFDEF read_implementation}


{ TfpgNewDirDialog }

function TfpgNewDirDialog.GetDirectory: TfpgString;
begin
  Result := edDirectory.Text;
end;

constructor TfpgNewDirDialog.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  // reset dimensions
  Width     := 286;
  Height    := 97;
  MinWidth  := 286;
  MinHeight := 97;
  
  lblTitle := CreateLabel(self, 8, 8, rsEnterNewDirectory);
  edDirectory := CreateEdit(self, 8, 28, 270, 0);
  edDirectory.Anchors := [anLeft, anTop, anRight];

  // reposition buttons
  btnCancel.Left  := Width-FDefaultButtonWidth-FSpacing;
  btnCancel.Top   := Height - FSpacing - btnCancel.Height;
  btnOK.Left      := btnCancel.Left-FDefaultButtonWidth-FSpacing;
  btnOK.Top       := btnCancel.Top;
  
  // now reset tab order
  edDirectory.TabOrder  := 1;
  btnOK.TabOrder        := 2;
  btnCancel.TabOrder    := 3;
end;


{$ENDIF read_implementation}