53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <afxwin.h>
|
|
#include <afxcmn.h>
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
// 让用户在同一个对话框里累加要压缩的"文件 + 文件夹"组合:
|
|
// [添加文件...] 调出多选文件对话框
|
|
// [添加文件夹...] 调出多选文件夹对话框 (IFileOpenDialog + FOS_PICKFOLDERS)
|
|
// [移除选中] 从列表里删除
|
|
// DoModal() 返回 IDOK 时,m_Paths 即为结果 (ANSI/MBCS 路径,与 ZSTA 管道一致)。
|
|
class CZstaPickerDlg : public CDialog
|
|
{
|
|
public:
|
|
explicit CZstaPickerDlg(CWnd* parent = nullptr);
|
|
|
|
virtual INT_PTR DoModal();
|
|
|
|
std::vector<std::string> m_Paths;
|
|
|
|
protected:
|
|
virtual BOOL OnInitDialog();
|
|
|
|
afx_msg void OnAddFiles();
|
|
afx_msg void OnAddFolders();
|
|
afx_msg void OnRemove();
|
|
afx_msg void OnSize(UINT nType, int cx, int cy);
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
private:
|
|
enum CtrlId {
|
|
IDC_ZSTA_LIST = 1001,
|
|
IDC_ZSTA_ADDFILES = 1002,
|
|
IDC_ZSTA_ADDFOLDERS = 1003,
|
|
IDC_ZSTA_REMOVE = 1004,
|
|
};
|
|
|
|
CListCtrl m_List;
|
|
CButton m_BtnAddFiles;
|
|
CButton m_BtnAddFolders;
|
|
CButton m_BtnRemove;
|
|
CButton m_BtnOK;
|
|
CButton m_BtnCancel;
|
|
|
|
std::vector<BYTE> m_Template; // in-memory DLGTEMPLATE bytes
|
|
|
|
void AddPath(const std::string& path);
|
|
void RefreshList();
|
|
void LayoutControls(int cx, int cy);
|
|
};
|