-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDlgInput.cpp
More file actions
51 lines (42 loc) · 1.15 KB
/
DlgInput.cpp
File metadata and controls
51 lines (42 loc) · 1.15 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
48
49
50
51
#include "stdafx.h"
#include "Init.h"
#include "DlgInput.h"
#include "DlgMain.h"
IMPLEMENT_DYNAMIC(CDlgInput,CDialog)
CDlgInput::CDlgInput(TSTRING *n_pName,const TCHAR *szCaption,const TCHAR *szDefault)
:CDialog(CDlgInput::IDD,NULL),
pName(n_pName),
sCaption(szCaption),
sDefault(szDefault)
{
}
void CDlgInput::DoDataExchange(CDataExchange *pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX,IDC_INPUTEDIT,sValue);
}
BEGIN_MESSAGE_MAP(CDlgInput,CDialog)
ON_EN_CHANGE(IDC_INPUTEDIT,DoUpdateData)
END_MESSAGE_MAP()
void CDlgInput::DoUpdateData()
{
UpdateData(TRUE);
}
BOOL CDlgInput::OnInitDialog()
{
CDialog::OnInitDialog();
CString sTemp;
GetWindowText(sTemp); sTemp=pDlgMain->LocalizeString(sTemp,true); SetWindowText(sTemp);
GetDlgItemText(IDCANCEL,sTemp); sTemp=pDlgMain->LocalizeString(sTemp,true); SetDlgItemText(IDCANCEL,sTemp);
SetWindowText(sCaption.c_str());
sValue=sDefault.c_str();
GetDlgItem(IDC_INPUTEDIT)->SetFocus();
if(pDlgMain->Option.fAlwaysOnTop)
SetWindowPos(&wndTopMost,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
return FALSE;
}
void CDlgInput::OnOK()
{
*pName=sValue;
CDialog::OnOK();
}