Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
3.6 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. IeList.h
  5. Abstract:
  6. CIeList is a subclassed (owner-draw) list control that groups items into
  7. a 3D panel that have the same information in the indicated
  8. sortColumn.
  9. The panels are created from tiles. Each tile corresponds to one subitem
  10. in the list, and has the appropriate 3D edges so that the tiles together
  11. make up a panel.
  12. NOTE: The control must be initialized with the number of columns and the
  13. sort column. The parent dialog must implement OnMeasureItem and call
  14. GetItemHeight to set the row height for the control.
  15. Author:
  16. Art Bragg [artb] 01-DEC-1997
  17. Revision History:
  18. --*/
  19. #ifndef IELIST_H
  20. #define IELIST_H
  21. #pragma once
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CIeList window
  24. class CIeList : public CListCtrl
  25. {
  26. // Construction
  27. public:
  28. CIeList();
  29. // Attributes
  30. public:
  31. // Operations
  32. public:
  33. // Overrides
  34. // ClassWizard generated virtual function overrides
  35. //{{AFX_VIRTUAL(CIeList)
  36. protected:
  37. virtual void PreSubclassWindow();
  38. //}}AFX_VIRTUAL
  39. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  40. // Implementation
  41. public:
  42. virtual ~CIeList();
  43. int GetItemHeight( LONG fontHeight );
  44. BOOL SortItems( PFNLVCOMPARE pfnCompare, DWORD dwData );
  45. // Generated message map functions
  46. protected:
  47. //{{AFX_MSG(CIeList)
  48. afx_msg void OnClick(NMHDR* pNMHDR, LRESULT* pResult);
  49. afx_msg void OnSetFocus(CWnd* pOldWnd);
  50. afx_msg void OnKillFocus(CWnd* pNewWnd);
  51. //}}AFX_MSG
  52. afx_msg void OnSysColorChange();
  53. DECLARE_MESSAGE_MAP()
  54. private:
  55. // functions
  56. void Draw3dRectx ( CDC *pDc, CRect &rect, int horzPos, int vertPos, BOOL bSelected );
  57. void SetColors();
  58. void CIeList::MakeShortString(CDC* pDC, LPCTSTR lpszLong, int nColumnLen, int nOffset, LPTSTR *ppszShort);
  59. void RepaintSelectedItems();
  60. // Dimensions for creating panels (in pixels)
  61. int m_VertRaisedSpace; // Vertical size of raised space between panels
  62. int m_BorderThickness; // Thickness of border in pixels
  63. int m_VerticalTextOffsetTop; // Distance between top of text and border
  64. int m_Textheight; // Height of text
  65. int m_VerticalTextOffsetBottom; // Distance between bottom of text and border
  66. int m_HorzRaisedSpace; // Horiz raised space between panels
  67. int m_HorzTextOffset; // Distance between left edge of text and border
  68. int m_TotalHeight; // Total height of line (for convenience)
  69. int m_ColCount; // Number of columns
  70. int m_SortCol; // Which column to use when sorting into panels
  71. int *m_pVertPos; // Array of vertical positions within a panel
  72. // Colors
  73. COLORREF m_clrText;
  74. COLORREF m_clrTextBk;
  75. COLORREF m_clrBkgnd;
  76. COLORREF m_clrHighlightText;
  77. COLORREF m_clrHighlight;
  78. COLORREF m_clr3DDkShadow;
  79. COLORREF m_clr3DShadow;
  80. COLORREF m_clr3DLight;
  81. COLORREF m_clr3DHiLight;
  82. // Pens for 3D rectangles
  83. CPen m_DarkShadowPen;
  84. CPen m_ShadowPen;
  85. CPen m_LightPen;
  86. CPen m_HiLightPen;
  87. public:
  88. void CIeList::Initialize( int colCount, int sortCol = 0 );
  89. };
  90. /////////////////////////////////////////////////////////////////////////////
  91. //{{AFX_INSERT_LOCATION}}
  92. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  93. //}}AFX
  94. #endif // !defined(IELIST_H)