102 lines
2.6 KiB
C++
102 lines
2.6 KiB
C++
#pragma once
|
|
#include "tchbasedlg.h"
|
|
#include <vector>
|
|
#include "Resource.h"
|
|
|
|
typedef struct CLegendData
|
|
{
|
|
CString sKind; //类别
|
|
CString sItem; //名称
|
|
CString sDrawing;//块ID序号
|
|
|
|
//图例块名字可以一样,但是块ID序号肯定不一样,所以
|
|
//ID序号一样,则认为两个对象是一样的
|
|
bool operator == (const CLegendData& tem) const
|
|
{
|
|
bool bRe = false;
|
|
if (sDrawing == tem.sDrawing)
|
|
{
|
|
bRe = true;
|
|
}
|
|
return bRe;
|
|
}
|
|
|
|
}LEGENDDATA;
|
|
|
|
typedef std::vector<LEGENDDATA> S_VEC;
|
|
|
|
// 图例列表处理类(LayerFiltration.txt)
|
|
class CLegendFiltrationFileOperator
|
|
{
|
|
public:
|
|
CLegendFiltrationFileOperator(LPCTSTR szFileName);
|
|
~CLegendFiltrationFileOperator() {};
|
|
|
|
virtual BOOL ReadFile(CStringArray &aryLayers) const;
|
|
virtual BOOL WriteFile(const CStringArray &aryLayers) const;
|
|
|
|
static BOOL SplitString(CString sAllName, CStringArray &aryLayers);
|
|
|
|
protected:
|
|
CString m_sFileName;
|
|
};
|
|
|
|
class ClayoutLegendDlg :
|
|
public CModelessDialog
|
|
{
|
|
public:
|
|
ClayoutLegendDlg(CWnd* pParent = NULL);
|
|
virtual ~ClayoutLegendDlg();
|
|
|
|
enum { IDD = IDD_DLG_LAYOUTLEGEND };
|
|
|
|
void UpdateLegendSel();
|
|
void UpdateLegendLst();
|
|
LEGENDDATA operator [] (int i) const;
|
|
int GetSize();
|
|
int GetCloumnNum(){return _ttoi(m_strColumnNum);}
|
|
CLegendFiltrationFileOperator *m_pFileBase;
|
|
CStringArray m_aryTmpLegend;
|
|
CString m_csIniFileLegend;
|
|
void GetLegendLst();
|
|
|
|
public:
|
|
afx_msg void OnNMDblclkLisSelectlegend(NMHDR *pNMHDR, LRESULT *pResult);
|
|
afx_msg void OnBnClickedButAdd();
|
|
afx_msg void OnNMDblclkLisLegendlist(NMHDR *pNMHDR, LRESULT *pResult);
|
|
afx_msg void OnBnClickedButDelete();
|
|
afx_msg void OnLvnBegindragLisLegendlist(NMHDR *pNMHDR, LRESULT *pResult);
|
|
afx_msg void OnLvnHotTrackLisLegendlist(NMHDR *pNMHDR, LRESULT *pResult);
|
|
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
|
afx_msg void OnLvnItemchangedLisSelectlegend(NMHDR *pNMHDR, LRESULT *pResult);
|
|
afx_msg void OnPaint();
|
|
afx_msg void OnBnClickedButNewlegend();
|
|
afx_msg void OnCbnSelchangeCmbColumn();
|
|
afx_msg void OnCbnEditchangeCmbColumn();
|
|
CComboBox m_cloumnNumBox;
|
|
CString m_strColumnNum;
|
|
|
|
protected:
|
|
virtual BOOL OnInitDialog();
|
|
virtual void DoDataExchange(CDataExchange* pDX);
|
|
|
|
bool LoadDBFFile(LPCTSTR szName);//读取TK文件数据
|
|
void ShowPic(int index);
|
|
bool IsItemExist(S_VEC &vec,LEGENDDATA &tem);//选择项在图例列表是否存在
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
private:
|
|
S_VEC m_vecLegendSel;//图例选择数据队列
|
|
static S_VEC s_vecLegendLst;//图例列表数据队列
|
|
|
|
int m_iSelectLstCurSel;
|
|
int m_iDragBeginItem;//拖拽起始项
|
|
int m_iDragEndItem; //拖拽结束项
|
|
int m_iDragFlag; //-1,无;0,开始拖拽;1结束拖拽
|
|
|
|
CImageDC m_ShowPicDC;
|
|
|
|
public:
|
|
afx_msg void OnBnClickedButEmpty();
|
|
};
|