aboutsummaryrefslogtreecommitdiff
path: root/CPP/7zip/UI/FileManager/OverwriteDialog.h
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/UI/FileManager/OverwriteDialog.h')
-rw-r--r--CPP/7zip/UI/FileManager/OverwriteDialog.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/CPP/7zip/UI/FileManager/OverwriteDialog.h b/CPP/7zip/UI/FileManager/OverwriteDialog.h
new file mode 100644
index 0000000..24e56ca
--- /dev/null
+++ b/CPP/7zip/UI/FileManager/OverwriteDialog.h
@@ -0,0 +1,79 @@
1// OverwriteDialog.h
2
3#ifndef __OVERWRITE_DIALOG_H
4#define __OVERWRITE_DIALOG_H
5
6#include "../../../Windows/Control/Dialog.h"
7
8#include "DialogSize.h"
9#include "OverwriteDialogRes.h"
10
11namespace NOverwriteDialog
12{
13 struct CFileInfo
14 {
15 bool SizeIsDefined;
16 bool TimeIsDefined;
17 UInt64 Size;
18 FILETIME Time;
19 UString Name;
20
21 void SetTime(const FILETIME *t)
22 {
23 if (!t)
24 TimeIsDefined = false;
25 else
26 {
27 TimeIsDefined = true;
28 Time = *t;
29 }
30 }
31
32 void SetSize(UInt64 size)
33 {
34 SizeIsDefined = true;
35 Size = size;
36 }
37
38 void SetSize(const UInt64 *size)
39 {
40 if (!size)
41 SizeIsDefined = false;
42 else
43 SetSize(*size);
44 }
45 };
46}
47
48class COverwriteDialog: public NWindows::NControl::CModalDialog
49{
50 bool _isBig;
51
52 void SetFileInfoControl(int textID, int iconID, const NOverwriteDialog::CFileInfo &fileInfo);
53 virtual bool OnInit();
54 bool OnButtonClicked(int buttonID, HWND buttonHWND);
55 void ReduceString(UString &s);
56
57public:
58 bool ShowExtraButtons;
59 bool DefaultButton_is_NO;
60
61
62 COverwriteDialog(): ShowExtraButtons(true), DefaultButton_is_NO(false) {}
63
64 INT_PTR Create(HWND parent = 0)
65 {
66 BIG_DIALOG_SIZE(280, 200);
67 #ifdef UNDER_CE
68 _isBig = isBig;
69 #else
70 _isBig = true;
71 #endif
72 return CModalDialog::Create(SIZED_DIALOG(IDD_OVERWRITE), parent);
73 }
74
75 NOverwriteDialog::CFileInfo OldFileInfo;
76 NOverwriteDialog::CFileInfo NewFileInfo;
77};
78
79#endif