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.

95 lines
2.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996
  5. //
  6. // File: Header.hxx
  7. //
  8. // Contents: Used to maintain / display listview header
  9. //
  10. // History: 27-Nov-1996 KyleP Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #pragma once
  14. #include <dynarray.hxx>
  15. //+-------------------------------------------------------------------------
  16. //
  17. // Class: CHeaderItem
  18. //
  19. // Purpose: Single header item
  20. //
  21. // History: 27-Nov-1996 KyleP Created
  22. //
  23. //--------------------------------------------------------------------------
  24. class CHeaderItem
  25. {
  26. public:
  27. CHeaderItem( unsigned id, WCHAR const * pwcsName, int Format, int Width, BOOL fInUse = TRUE );
  28. void SetWidth( int Width ) { _Width = Width; }
  29. //
  30. // Access methods
  31. //
  32. unsigned Id() const { return _id; }
  33. WCHAR const * Name() const { return _wcsName; }
  34. int Format() const { return _Format; }
  35. int Width() const { return _Width; }
  36. BOOL IsInUse() const { return _fInUse; }
  37. private:
  38. enum
  39. {
  40. ccMaxName = 100
  41. };
  42. unsigned _id;
  43. int _Format;
  44. int _Width;
  45. BOOL _fInUse;
  46. WCHAR _wcsName[100];
  47. };
  48. //+-------------------------------------------------------------------------
  49. //
  50. // Class: CListViewHeader
  51. //
  52. // Purpose: Display listview header
  53. //
  54. // History: 27-Nov-1996 KyleP Created
  55. //
  56. //--------------------------------------------------------------------------
  57. class CListViewHeader : INHERIT_UNWIND
  58. {
  59. INLINE_UNWIND( CListViewHeader )
  60. public:
  61. CListViewHeader();
  62. BOOL IsInitialized() { return (0 != _aColumn.Count()); }
  63. void Add( unsigned id, WCHAR const * pwcsName, int Format, int Width );
  64. void Display( IHeaderCtrl * pHeader );
  65. void Update( IHeaderCtrl * pHeader );
  66. private:
  67. CCountedDynArray<CHeaderItem> _aColumn;
  68. };