TreeComboBox3.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #if !defined(AFX_TREECOMBOBOX3_H__B9544E92_7215_4D8B_9DF2_67F232BA4014__INCLUDED_)
  2. #define AFX_TREECOMBOBOX3_H__B9544E92_7215_4D8B_9DF2_67F232BA4014__INCLUDED_
  3. #include "ComboTreeCtrl3.h"
  4. #if _MSC_VER > 1000
  5. #pragma once
  6. #endif // _MSC_VER > 1000
  7. // TreeComboBox.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. // CTreeComboBox3 window
  17. class CTreeComboBox3 : public CComboBox
  18. {
  19. CString m_pretext;
  20. // Construction
  21. public:
  22. CTreeComboBox3();
  23. CArray<CStringArray, CStringArray>*m_pList1array;
  24. // Attributes
  25. public:
  26. BOOL m_bTree;
  27. // Operations
  28. public:
  29. void DisplayTree();
  30. void SetTitle(CString sTitle);
  31. BOOL IsAlertBkg(){return m_bAlertBkg;}
  32. BOOL IsAlertText(){return m_bAlertText;}
  33. CTreeCtrl& GetTreeCtrl(){return m_Tree;}
  34. int GetDroppedWidth(){return m_droppedWidth;};
  35. int GetDroppedHeight(){return m_droppedHeight;};
  36. void SetDroppedWidth(int nWidth){m_droppedWidth = nWidth;};
  37. void SetDroppedHeight(int nHeight){m_droppedHeight = nHeight;};
  38. void AlertBkg(BOOL bAlert = TRUE){m_bAlertBkg = bAlert;Invalidate();};
  39. void AlertText(BOOL bAlert = TRUE){m_bAlertText = bAlert;Invalidate();};
  40. // Overrides
  41. // ClassWizard generated virtual function overrides
  42. //{{AFX_VIRTUAL(CTreeComboBox3)
  43. public:
  44. virtual BOOL PreTranslateMessage(MSG* pMsg);
  45. protected:
  46. virtual void PreSubclassWindow();
  47. //}}AFX_VIRTUAL
  48. // Implementation
  49. public:
  50. void InitTree();
  51. void RefDroppedWidth();
  52. UINT GetTreeCount();
  53. void TreeCtrlDone();
  54. virtual ~CTreeComboBox3();
  55. // Generated message map functions
  56. protected:
  57. //{{AFX_MSG(CTreeComboBox3)
  58. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  59. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  60. afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
  61. //}}AFX_MSG
  62. afx_msg LRESULT OnCloseControl(WPARAM wParam, LPARAM lParam);
  63. DECLARE_MESSAGE_MAP()
  64. private:
  65. BOOL m_bAlertBkg;
  66. BOOL m_bAlertText;
  67. int m_droppedWidth;
  68. int m_droppedHeight;
  69. HBRUSH m_hBrushAlert;
  70. CComboTreeCtrl3 m_Tree;
  71. };
  72. /////////////////////////////////////////////////////////////////////////////
  73. //{{AFX_INSERT_LOCATION}}
  74. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  75. #endif // !defined(AFX_TREECOMBOBOX3_H__B9544E92_7215_4D8B_9DF2_67F232BA4014__INCLUDED_)