treeviewdlg.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. // treeviewDlg.h : header file
  14. //
  15. #if !defined(AFX_TREEVIEWDLG_H__57F384AE_7099_4A2B_A255_4C34441351B2__INCLUDED_)
  16. #define AFX_TREEVIEWDLG_H__57F384AE_7099_4A2B_A255_4C34441351B2__INCLUDED_
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif // _MSC_VER > 1000
  20. #include "jprop.hpp"
  21. #include "afxtempl.h"
  22. #include "inspectctrl.hpp"
  23. #include "util.hpp"
  24. #include "connect.hpp"
  25. #define TREE_ENTRY_MAX_LABEL_SIZE 256
  26. extern UINT WM_FINDREPLACE;
  27. bool saveTree(LPCTSTR filename, IPropertyTree & pTree); // save to dat file
  28. IPropertyTree * loadTree(LPCTSTR filename, bool xml = false); // load from dat file
  29. class CExpanderThread;
  30. class CTreeviewDlg : public CDialog
  31. {
  32. protected:
  33. HACCEL hAccel;
  34. HICON m_hIcon;
  35. LPSTR cmdfname;
  36. // Generated message map functions
  37. //{{AFX_MSG(CTreeviewDlg)
  38. virtual BOOL OnInitDialog();
  39. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  40. afx_msg void OnPaint();
  41. afx_msg HCURSOR OnQueryDragIcon();
  42. afx_msg void OnSize(UINT nType, int cx, int cy);
  43. afx_msg BOOL OnNextPrevField(UINT cmdID);
  44. afx_msg void OnClose();
  45. afx_msg void OnExit();
  46. afx_msg void OnMenuLoad();
  47. afx_msg void OnMenuSave();
  48. afx_msg void OnMenuExit();
  49. afx_msg void OnMenuExpandall();
  50. afx_msg void OnMenuContractall();
  51. afx_msg void OnMenuFind();
  52. afx_msg void OnMenuDelete();
  53. afx_msg void OnMenuDeleteConfirm();
  54. afx_msg void OnMenuAbout();
  55. afx_msg void OnMenuShowAttribs();
  56. afx_msg void OnMenuShowQualified();
  57. afx_msg LRESULT OnFindReplace(WPARAM wParam, LPARAM lParam);
  58. afx_msg void OnMenuConnectRemote();
  59. afx_msg void OnMenuReconnect();
  60. afx_msg void OnCommit();
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. private:
  64. SocketEndpointArray connectedEpa;
  65. IConnection * connection;
  66. CFindReplaceDialog * findReplaceDialog;
  67. CString findStr;
  68. CToolTipCtrl * tooltipCtrl;
  69. long CloseRightOffset, CloseBottomOffset;
  70. long TreeRightMargin, TreeBottomMargin;
  71. CExpanderThread * expander;
  72. CPropertyInspector inspector;
  73. inline CWnd * GetDlgItemRect(int nId, RECT & rect);
  74. bool _loadTree(LPCSTR fname);
  75. bool _saveTree(LPCSTR fname);
  76. void setWindowTitle();
  77. void updateMenuState();
  78. void endExpand();
  79. public:
  80. CTreeviewDlg(LPCTSTR inFile, CWnd* pParent = NULL);
  81. ~CTreeviewDlg();
  82. //{{AFX_DATA(CTreeviewDlg)
  83. enum { IDD = IDD_TREEVIEW_DIALOG };
  84. // NOTE: the ClassWizard will add data members here
  85. //}}AFX_DATA
  86. // ClassWizard generated virtual function overrides
  87. //{{AFX_VIRTUAL(CTreeviewDlg)
  88. public:
  89. virtual BOOL PreTranslateMessage(MSG* pMsg);
  90. protected:
  91. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  92. //}}AFX_VIRTUAL
  93. void resetDialog();
  94. friend class CExpanderThread;
  95. };
  96. /////////////////////////////////////////////////////////////////////////////
  97. // CConnectDlg dialog
  98. class CConnectDlg : public CDialog
  99. {
  100. // Construction
  101. public:
  102. CConnectDlg(CWnd* pParent = NULL); // standard constructor
  103. virtual ~CConnectDlg();
  104. int GetCovenSize();
  105. LPCSTR GetServerEndpoint(int idx);
  106. // Dialog Data
  107. //{{AFX_DATA(CConnectDlg)
  108. enum { IDD = IDD_REMOTE_SERVER };
  109. // NOTE: the ClassWizard will add data members here
  110. //}}AFX_DATA
  111. // Overrides
  112. // ClassWizard generated virtual function overrides
  113. //{{AFX_VIRTUAL(CConnectDlg)
  114. protected:
  115. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  116. //}}AFX_VIRTUAL
  117. // Implementation
  118. protected:
  119. // Generated message map functions
  120. //{{AFX_MSG(CConnectDlg)
  121. virtual void OnOK();
  122. virtual void OnCancel();
  123. virtual BOOL OnInitDialog();
  124. afx_msg void OnRemoveServerButton();
  125. afx_msg void OnAddServerButton();
  126. //}}AFX_MSG
  127. DECLARE_MESSAGE_MAP()
  128. private:
  129. CArray<CString *, CString * &> ServerEndpoints;
  130. int CovenSize;
  131. int GetDlgItemInt(UINT DlgItem);
  132. void killEndpoints();
  133. };
  134. /////////////////////////////////////////////////////////////////////////////
  135. // CEndpointDlg dialog
  136. class CEndpointDlg : public CDialog
  137. {
  138. // Construction
  139. public:
  140. LPCSTR GetEndpointStr();
  141. CEndpointDlg(CWnd* pParent = NULL); // standard constructor
  142. // Dialog Data
  143. //{{AFX_DATA(CEndpointDlg)
  144. enum { IDD = IDD_ENDPOINT_DIALOG };
  145. // NOTE: the ClassWizard will add data members here
  146. //}}AFX_DATA
  147. // Overrides
  148. // ClassWizard generated virtual function overrides
  149. //{{AFX_VIRTUAL(CEndpointDlg)
  150. protected:
  151. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  152. //}}AFX_VIRTUAL
  153. // Implementation
  154. protected:
  155. // Generated message map functions
  156. //{{AFX_MSG(CEndpointDlg)
  157. virtual void OnOK();
  158. virtual void OnCancel();
  159. virtual BOOL OnInitDialog();
  160. //}}AFX_MSG
  161. DECLARE_MESSAGE_MAP()
  162. private:
  163. CString Endpoint;
  164. };
  165. //{{AFX_INSERT_LOCATION}}
  166. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  167. #endif // !defined(AFX_TREEVIEWDLG_H__57F384AE_7099_4A2B_A255_4C34441351B2__INCLUDED_)