forked from ddehilster/visualtext3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKnowledgeView.h
144 lines (128 loc) · 4.83 KB
/
KnowledgeView.h
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*******************************************************************************
Copyright (c) 1999-2010 by Text Analysis International, Inc.
All rights reserved.
*******************************************************************************/
#if !defined(AFX_KNOWLEDGEVIEW_H__1C09E190_C22C_11D3_A559_00105A99059F__INCLUDED_)
#define AFX_KNOWLEDGEVIEW_H__1C09E190_C22C_11D3_A559_00105A99059F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// KnowledgeView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CKnowledgeView view
class CKnowledgeView : public CXTPTreeView
{
protected:
CKnowledgeView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CKnowledgeView)
CImageList* m_pDragImage;
BOOL m_bLDragging;
HTREEITEM m_hitemDrag,m_hitemDrop;
HCURSOR m_dropCursor,m_noDropCursor;
UINT m_nTimerIDDrag;
UINT m_timerticks;
DWORD m_dwDragStart;
// Attributes
public:
void MoveSelUp();
void MoveSelDown();
bool CanMoveUp();
bool CanMoveDown();
void SetState(CString stateStr, STATE_TYPE state);
void SetData(CString conceptPathStr, bool oneRootNode);
void Restore();
bool SelectFromConcept(CONCEPT *concept, bool updateAttributeEditorFlag=true);
HTREEITEM TreeItemFromConcept(CONCEPT *concept);
void ReIcon(CONCEPT *concept);
void SaveState();
BOOL InKBSafeEditMode(void);
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CKnowledgeView)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CKnowledgeView();
virtual bool IsDropSource(HTREEITEM hItem);
virtual HTREEITEM GetDropTarget(HTREEITEM hItem);
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CKnowledgeView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnKnowledgeAttributes();
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnKnowledgeDelete();
afx_msg void OnKnowledgeDeletechildren();
afx_msg void OnKnowledgeAddconcepts();
afx_msg void OnKnowledgeFind();
afx_msg void OnKnowledgePhrases();
afx_msg void OnKnowledgeAddphrase();
afx_msg void OnKnowledgeMakeroot();
afx_msg void OnDestroy();
afx_msg void OnKnowledgeGenerateall();
afx_msg void OnKnowledgeSave();
afx_msg void OnSaveKb();
afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnKbDown();
afx_msg void OnKbUp();
afx_msg void OnUpdateKbUp(CCmdUI* pCmdUI);
afx_msg void OnUpdateKbDown(CCmdUI* pCmdUI);
afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnKnowledgeUp();
afx_msg void OnKnowledgeKbmodularLoad();
afx_msg void OnKnowledgeKbmodularSave();
//}}AFX_MSG
afx_msg long OnSelectNextItem(WPARAM wParam, LPARAM lParam);
afx_msg long OnSelectPrevItem(WPARAM wParam, LPARAM lParam);
afx_msg long OnSelectDownItem(WPARAM wParam, LPARAM lParam);
afx_msg long OnSelectUpItem(WPARAM wParam, LPARAM lParam);
afx_msg long OnOpenPath(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
private:
CImageList m_ImageList;
HTREEITEM m_itemSelected;
CONCEPT *m_conceptRoot;
CONCEPT *m_conceptSelected;
CString m_strConcept;
CString m_strFind;
CString m_strSelected;
int m_intItemCount;
HICON m_icon;
bool m_boolOneRootNode;
bool m_boolFillOneLevel;
bool m_boolUpdateAttributeEditor;
void InitVars();
void FillListExpand(HTREEITEM treeItem);
void FillList(bool deleteFirst=false);
bool FillList(CONCEPT *parentConcept, HTREEITEM parentItem, int level, int &count);
void DeleteSelected();
void AddConcept(CString conceptStr, HTREEITEM itemSelected);
void ForceSaveKB();
CString StateStr();
HTREEITEM TreeItemFromConcept(CONCEPT *concepts[], HTREEITEM item, int level);
void IconsFromConcept(CONCEPT *concept, int &icon, int &iconSel);
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_KNOWLEDGEVIEW_H__1C09E190_C22C_11D3_A559_00105A99059F__INCLUDED_)