blob: 9272b3b44b6c4a7544ee50937e6a509bd66c2c5c (
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
76
77
78
79
80
|
// CopyDialog.cpp
#include "StdAfx.h"
#include "CopyDialog.h"
#include "Common/StringConvert.h"
#include "Windows/Control/Static.h"
#include "Windows/Shell.h"
#include "Windows/FileName.h"
#ifdef LANG
#include "../../LangUtils.h"
#endif
using namespace NWindows;
#ifdef LANG
static CIDLangPair kIDLangPairs[] =
{
{ IDOK, 0x02000702 },
{ IDCANCEL, 0x02000710 }
};
#endif
bool CCopyDialog::OnInit()
{
#ifdef LANG
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
#endif
_path.Attach(GetItem(IDC_COPY_COMBO));
SetText(Title);
NControl::CStatic staticContol;
staticContol.Attach(GetItem(IDC_COPY_STATIC));
staticContol.SetText(Static);
for(int i = 0; i < Strings.Size(); i++)
_path.AddString(Strings[i]);
_path.SetText(Value);
return CModalDialog::OnInit();
}
bool CCopyDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
{
switch(buttonID)
{
case IDC_COPY_SET_PATH:
OnButtonSetPath();
return true;
}
return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
}
void CCopyDialog::OnButtonSetPath()
{
UString currentPath;
_path.GetText(currentPath);
/*
#ifdef LANG
UString title = LangLoadString(IDS_EXTRACT_SET_FOLDER, 0x02000881);
#else
UString title = MyLoadString(IDS_EXTRACT_SET_FOLDER);
#endif
*/
UString title = L"Specify a location for output folder";
UString resultPath;
if (!NShell::BrowseForFolder(HWND(*this), title, currentPath, resultPath))
return;
NFile::NName::NormalizeDirPathPrefix(resultPath);
_path.SetCurSel(-1);
_path.SetText(resultPath);
}
void CCopyDialog::OnOK()
{
_path.GetText(Value);
CModalDialog::OnOK();
}
|