Source code of Windows XP (NT5)
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.

77 lines
1.9 KiB

  1. #ifndef __VLIST_H__
  2. #define __VLIST_H__
  3. typedef struct tagVLC_ITEM
  4. {
  5. NMHDR hdr;
  6. int iItem;
  7. WCHAR*lpwsz;
  8. int cchMax;
  9. int iLevel;
  10. DWORD dwFlags; // bit 0; 1 = disabled, 0 = normal
  11. } VLC_ITEM, * PVLC_ITEM;
  12. #define IDC_KWD_VLIST 222
  13. #define VLN_GETITEM (-100)
  14. #define VLN_SELECT (-101)
  15. #define VLN_TAB (-102)
  16. class CVirtualListCtrl
  17. {
  18. public:
  19. CVirtualListCtrl(LCID lcid);
  20. ~CVirtualListCtrl();
  21. BOOL SetItemCount(int);
  22. BOOL SetSelection(int iSel, BOOL bNotify = TRUE);
  23. BOOL SetTopIndex(int);
  24. BOOL EnsureVisible(int);
  25. BOOL GetItemRect(int, RECT* prc);
  26. int GetSelection();
  27. int GetTopIndex();
  28. static LRESULT StaticWindowProc(HWND, UINT, WPARAM, LPARAM);
  29. HWND CreateVlistbox(HWND hWndParent, RECT* prc);
  30. LRESULT GetItemText(int iItem, int* piLevel, DWORD* pdwFlags, WCHAR* lpwsz, int cchMax);
  31. LRESULT ItemSelected(int);
  32. LRESULT ItemDoubleClicked(int);
  33. LRESULT DrawItem(HDC hDC, int, RECT* prc, BOOL, BOOL);
  34. void PaintParamsSetup(COLORREF clrBackground, COLORREF clrForeground, LPCSTR pszBackBitmap);
  35. void Refresh()
  36. {
  37. if ( m_hWnd )
  38. InvalidateRect(m_hWnd, NULL, TRUE);
  39. }
  40. LANGID GetLanguageId() { return m_langid; }
  41. LCID GetLanguage() { return m_lcid; }
  42. private:
  43. void RedrawCurrentItem();
  44. LRESULT Notify(int, NMHDR * = 0);
  45. int m_cItems;
  46. int m_iTopItem;
  47. int m_iSelItem;
  48. int m_cyItem;
  49. int m_cItemsPerPage;
  50. BOOL m_fFocus;
  51. HFONT m_hFont;
  52. HWND m_hWnd;
  53. HWND m_hWndParent;
  54. LANGID m_langid;
  55. LCID m_lcid; // the locale ID of the text in the listbox
  56. //
  57. // Ralphs goo.
  58. //
  59. HPALETTE m_hpalBackGround;
  60. HBRUSH m_hbrBackGround;
  61. HBITMAP m_hbmpBackGround;
  62. int m_cxBackBmp;
  63. int m_cyBackBmp;
  64. COLORREF m_clrForeground;
  65. COLORREF m_clrBackground;
  66. BOOL m_fBiDi;
  67. DWORD m_RTL_Style;
  68. };
  69. #endif