-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathInputDlg.cpp
More file actions
47 lines (44 loc) · 1.62 KB
/
InputDlg.cpp
File metadata and controls
47 lines (44 loc) · 1.62 KB
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
//---------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "InputDlg.h"
#include "Misc.h"
//---------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFInputDlg_11011981 *FInputDlg_11011981;
//---------------------------------------------------------------------
__fastcall TFInputDlg_11011981::TFInputDlg_11011981(TComponent* AOwner)
: TForm(AOwner)
{
}
//---------------------------------------------------------------------
void __fastcall TFInputDlg_11011981::FormShow(TObject *Sender)
{
if (edtName->CanFocus()) ActiveControl = edtName;
}
//---------------------------------------------------------------------------
void __fastcall TFInputDlg_11011981::edtNameEnter(TObject *Sender)
{
edtName->SelectAll();
}
//---------------------------------------------------------------------------
void __fastcall TFInputDlg_11011981::FormCreate(TObject *Sender)
{
ScaleForm(this);
}
//---------------------------------------------------------------------------
String __fastcall InputDialogExec(String caption, String labelText, String text)
{
String _result = "";
FInputDlg_11011981->Caption = caption;
FInputDlg_11011981->edtName->EditLabel->Caption = labelText;
FInputDlg_11011981->edtName->Text = text;
while (_result == "")
{
if (FInputDlg_11011981->ShowModal() == mrCancel) break;
_result = FInputDlg_11011981->edtName->Text.Trim();
}
return _result;
}
//---------------------------------------------------------------------------