TreeComboBox2.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #if !defined(AFX_TreeComboBox2_H__B9544E92_7215_4D8B_9DF2_67F232BA4014__INCLUDED_)
  2. #define AFX_TreeComboBox2_H__B9544E92_7215_4D8B_9DF2_67F232BA4014__INCLUDED_
  3. #include "ComboTreeCtrl2.h"
  4. #if _MSC_VER > 1000
  5. #pragma once
  6. #endif // _MSC_VER > 1000
  7. // TreeComboBox2.h : header file
  8. //
  9. #ifndef COLOR_RED
  10. #define COLOR_RED RGB(220,0,0)
  11. #endif //COLOR_RED
  12. #ifndef COLOR_ALERT
  13. #define COLOR_ALERT RGB(255,180,180)
  14. #endif //COLOR_ALERT
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CTreeComboBox2 window
  17. class CTreeComboBox2 : public CComboBox
  18. {
  19. CString m_pretext;
  20. // Construction
  21. public:
  22. CTreeComboBox2();
  23. void SetCtrlData(DWORD dwData);
  24. DWORD GetCtrlData();
  25. // Attributes
  26. public:
  27. BOOL m_bTree;
  28. CWnd *m_pMsgParent;
  29. int m_mode;
  30. // Operations
  31. public:
  32. void DisplayTree();
  33. void SetTitle(CString sTitle);
  34. BOOL IsAlertBkg(){return m_bAlertBkg;}
  35. BOOL IsAlertText(){return m_bAlertText;}
  36. CTreeCtrl& GetTreeCtrl(){return m_Tree;}
  37. int GetDroppedWidth(){return m_droppedWidth;};
  38. int GetDroppedHeight(){return m_droppedHeight;};
  39. void SetDroppedWidth(int nWidth){m_droppedWidth = nWidth;};
  40. void SetDroppedHeight(int nHeight){m_droppedHeight = nHeight;};
  41. void AlertBkg(BOOL bAlert = TRUE){m_bAlertBkg = bAlert;Invalidate();};
  42. void AlertText(BOOL bAlert = TRUE){m_bAlertText = bAlert;Invalidate();};
  43. // Overrides
  44. // ClassWizard generated virtual function overrides
  45. //{{AFX_VIRTUAL(CTreeComboBox2)
  46. public:
  47. virtual BOOL PreTranslateMessage(MSG* pMsg);
  48. protected:
  49. virtual void PreSubclassWindow();
  50. //}}AFX_VIRTUAL
  51. // Implementation
  52. public:
  53. void InitTree();
  54. void RefDroppedWidth();
  55. UINT GetTreeCount();
  56. void TreeCtrlDone();
  57. virtual ~CTreeComboBox2();
  58. // Generated message map functions
  59. protected:
  60. //{{AFX_MSG(CTreeComboBox2)
  61. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  62. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  63. afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
  64. afx_msg void OnSetFocus(CWnd* pOldWnd);
  65. //}}AFX_MSG
  66. afx_msg LRESULT OnCloseControl(WPARAM wParam, LPARAM lParam);
  67. DECLARE_MESSAGE_MAP()
  68. private:
  69. BOOL m_bAlertBkg;
  70. BOOL m_bAlertText;
  71. int m_droppedWidth;
  72. int m_droppedHeight;
  73. HBRUSH m_hBrushAlert;
  74. CComboTreeCtrl2 m_Tree;
  75. DWORD m_dwData;
  76. BOOL m_bExchange;
  77. };
  78. /////////////////////////////////////////////////////////////////////////////
  79. //{{AFX_INSERT_LOCATION}}
  80. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  81. #endif // !defined(AFX_TreeComboBox2_H__B9544E92_7215_4D8B_9DF2_67F232BA4014__INCLUDED_)