Files
envi-code/SourceCode/Code2026/PIDLineCmd/DlgParamDefine.h
T

162 lines
5.3 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
#if !defined(__DLGPARAMDEFINE_H__)
2026-09-28 15:28:50 +08:00
#define __DLGPARAMDEFINE_H__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "resource.h"
#include "InPlaceCtrls.h"
#include "PropertyListBox.h"
#include "KTParamClass.h"
class CDlgParamDefine : public CDialog
{
public:
2026-10-04 00:04:20 +08:00
// 构造函数
2026-09-28 15:28:50 +08:00
CDlgParamDefine(CWnd* pParent = NULL);
protected:
2026-10-04 00:04:20 +08:00
// 初始化类型树
2026-09-28 15:28:50 +08:00
void OnInitClassTree(ULONG lParent, HTREEITEM hParent);
2026-10-04 00:04:20 +08:00
// 清除属性列表中数据
2026-09-28 15:28:50 +08:00
void OnCleanAttrTab(CPropertyItemTab* pTab);
2026-10-04 00:04:20 +08:00
// 清除属性列表中数据
2026-09-28 15:28:50 +08:00
void OnCleanAttributeList();
2026-10-04 00:04:20 +08:00
// 清除约束列表中数据
2026-09-28 15:28:50 +08:00
void OnCleanRuleTab(CPropertyItemTab* pTab);
2026-10-04 00:04:20 +08:00
// 清除约束列表中数据
2026-09-28 15:28:50 +08:00
void OnCleanRuleList();
2026-10-04 00:04:20 +08:00
// 添加或更新类别所有数据
2026-09-28 15:28:50 +08:00
void OnUpdateClassItemData(HTREEITEM hItem);
2026-10-04 00:04:20 +08:00
// 更新类别数据
2026-09-28 15:28:50 +08:00
void OnUpdateClassAttrData(CPropertyItemTab* pTab, KTParamClass& cClassData);
2026-10-04 00:04:20 +08:00
// 更新属性数据
2026-09-28 15:28:50 +08:00
void OnUpdateAttributeData(CPropertyItemTab* pTab, KTParamAttribute& cAttrData);
2026-10-04 00:04:20 +08:00
// 更新约束数据
2026-09-28 15:28:50 +08:00
void OnUpdateRuleData(CPropertyItemTab* pTab, KTParamRule& pRule);
2026-10-04 00:04:20 +08:00
// 转换数据类型到Item的类型
2026-09-28 15:28:50 +08:00
CPropertyItem::ItemStyle AsItemStyle(LPCTSTR pszDataType, BOOL bMulti = FALSE, BOOL bOverride = FALSE);
2026-10-04 00:04:20 +08:00
// 转换数据为指定Item类型的数据
2026-09-28 15:28:50 +08:00
LPCTSTR AsItemString(CString& sData, LPCTSTR pszDataType);
2026-10-04 00:04:20 +08:00
// 根据变量描述表表达式获得表名
2026-09-28 15:28:50 +08:00
LPCTSTR AsDescTable(CString& sDescTable, LPCTSTR pszVarDesc, const CMapStringToString& mapVarToValue);
2026-10-04 00:04:20 +08:00
// 转换数据为指定的描述字符串
2026-09-28 15:28:50 +08:00
LPCTSTR AsItemDesc(CString& sDesc, LPCTSTR pszData, LPCTSTR pszVarDesc, const CMapStringToString& mapVarToValue);
2026-10-04 00:04:20 +08:00
// 转换描述为指定的数据字符串
2026-09-28 15:28:50 +08:00
LPCTSTR ByItemDesc(CString& sData, LPCTSTR pszDesc, LPCTSTR pszVarDesc, const CMapStringToString& mapVarToValue);
2026-10-04 00:04:20 +08:00
// 显示指定类型的属性和约束数据
2026-09-28 15:28:50 +08:00
void OnShowClassData(HTREEITEM hItem, BOOL bEdit);
2026-10-04 00:04:20 +08:00
// 显示指定类型的类属性
2026-09-28 15:28:50 +08:00
void OnShowClassAttrItems(HTREEITEM hItem, BOOL bEdit);
2026-10-04 00:04:20 +08:00
// 显示指定类的属性
2026-09-28 15:28:50 +08:00
void OnShowAttributeItems(ULONG lId, BOOL bEdit);
2026-10-04 00:04:20 +08:00
// 显示指定类属性的属性
2026-09-28 15:28:50 +08:00
void OnShowAttributeAttrItems(CPropertyItemTab* pTab, ULONG lId, BOOL bEdit);
2026-10-04 00:04:20 +08:00
// 显示分类约束数据条目
2026-09-28 15:28:50 +08:00
void OnShowRuleData(HTREEITEM hItem, BOOL bEdit);
2026-10-04 00:04:20 +08:00
// 显示指定类约束的属性
2026-09-28 15:28:50 +08:00
void OnShowRuleAttrItems(CPropertyItemTab* pTab, ULONG lId, BOOL bEdit);
2026-10-04 00:04:20 +08:00
// 显示约束参数表达式
2026-09-28 15:28:50 +08:00
void OnShowExpression(CPropertyItemTab* pTab, ULONG lId, BOOL bEdit);
void OnShowExpression(CPropertyItemTab* pTab, CMapStringToString& mapVarTypeToValue, BOOL bEdit);
2026-10-04 00:04:20 +08:00
// 重新调整控件
2026-09-28 15:28:50 +08:00
void OnRelayout();
2026-10-04 00:04:20 +08:00
// 取得分隔区间,参数为长度为3的数组
2026-09-28 15:28:50 +08:00
void GetSepRect(CRect* pRecSep);
protected:
2026-10-04 00:04:20 +08:00
// 当前数据是否被修改
2026-09-28 15:28:50 +08:00
BOOL m_bPartModified;
2026-10-04 00:04:20 +08:00
// 当前分类数据
2026-09-28 15:28:50 +08:00
KTParamClass m_cCurClass;
2026-10-04 00:04:20 +08:00
// 类型数操作工具条
2026-09-28 15:28:50 +08:00
CToolBar m_wndTBarClass;
2026-10-04 00:04:20 +08:00
// 属性列表操作工具条
2026-09-28 15:28:50 +08:00
CToolBar m_wndTBarAttr;
2026-10-04 00:04:20 +08:00
// 图标列表
2026-09-28 15:28:50 +08:00
CImageList m_imglstIcon;
2026-10-04 00:04:20 +08:00
// 最小窗口尺寸
2026-09-28 15:28:50 +08:00
CSize m_szMin;
2026-10-04 00:04:20 +08:00
// 鼠标左键按下标识
2026-09-28 15:28:50 +08:00
BOOL m_bMouseDown;
2026-10-04 00:04:20 +08:00
// 上一个鼠标位置点
2026-09-28 15:28:50 +08:00
CPoint m_ptLast;
2026-10-04 00:04:20 +08:00
// 当前点击的分隔条位置
2026-09-28 15:28:50 +08:00
int m_iCurSep;
2026-10-04 00:04:20 +08:00
// 是否按了ESCAPE键
2026-09-28 15:28:50 +08:00
BOOL m_bEscape;
2026-10-04 00:04:20 +08:00
// 拷贝的分类
2026-09-28 15:28:50 +08:00
HTREEITEM m_hCopyClass;
protected:
//{{AFX_DATA(CDlgParamDefine)
enum { IDD = IDD_PARAMDEFINE };
CTreeCtrl m_wndTreeClass;
CStatic m_wndStcPreview;
CPropertyListBox m_wndLstAttribute;
CPropertyListBox m_wndLstRule;
//}}AFX_DATA
//{{AFX_VIRTUAL(CDlgParamDefine)
public:
virtual BOOL Create(CWnd* pParentWnd);
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
protected:
//{{AFX_MSG(CDlgParamDefine)
virtual BOOL OnInitDialog();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnCaptureChanged(CWnd *pWnd);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnClassNew();
afx_msg void OnClassDelete();
afx_msg void OnClassRename();
afx_msg void OnBeginLabelEditTreeClass(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndLabelEditTreeClass(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnAttrNew();
afx_msg void OnAttrDelete();
afx_msg void OnAttrRename();
afx_msg void OnRuleNew();
afx_msg void OnRuleSelect();
afx_msg void OnRuleDelete();
afx_msg void OnSelchangingTreeClass(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDestroy();
afx_msg void OnAttrUp();
afx_msg void OnAttrDown();
afx_msg void OnRuleUp();
afx_msg void OnRuleDown();
afx_msg void OnClassSave();
virtual void OnCancel();
afx_msg void OnClassTest();
afx_msg void OnClassCopy();
afx_msg void OnAttrPaste();
afx_msg void OnRulePaste();
afx_msg void OnClassImport();
//}}AFX_MSG
afx_msg LRESULT OnPropListBoxNotify(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam);
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu);
afx_msg void OnExitMenuLoop(BOOL bIsTrackPopupMenu);
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
#endif // !defined(__DLGPARAMDEFINE_H__)