summaryrefslogtreecommitdiff
path: root/src/gui/newdirdialog.inc
blob: 406b64901a55fd557e626bb13633101659d80de2 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
{
    fpGUI  -  Free Pascal GUI Toolkit

    Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
    distribution, for details of the copyright.

    See the file COPYING.modifiedLGPL, included in this distribution,
    for details about redistributing fpGUI.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    Description:
      This unit contains the Create New Directory dialog.
}

{%mainunit fpg_dialogs.pas}

{$IFDEF read_interface}

  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}