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.

179 lines
4.3 KiB

  1. //
  2. // cuicand2.h
  3. // candidate UI object library - define UI objects for CHS candidate UI
  4. //
  5. // CUIFObject
  6. // +- CUIFButton button object
  7. // | +- CUIFRowButton CHS candidate UI row button object (used in CUIFRowList)
  8. // +- CUIFRowList CHS candidate UI row control
  9. //
  10. #ifndef CUICAND2_H
  11. #define CUICAND2_H
  12. #include "private.h"
  13. #include "cuilib.h"
  14. #include "cuicand.h"
  15. #ifndef NUM_CANDSTR_MAX
  16. #define NUM_CANDSTR_MAX 9
  17. #endif
  18. #define HCAND_ITEM_MARGIN 6
  19. //
  20. // CUIFSmartMenuButton
  21. //
  22. class CUIFSmartMenuButton : public CUIFButton2
  23. {
  24. public:
  25. CUIFSmartMenuButton( CUIFObject *pParent, DWORD dwID, const RECT *prc, DWORD dwStyle );
  26. virtual ~CUIFSmartMenuButton( void );
  27. virtual void OnPaint(HDC hDC);
  28. };
  29. //
  30. // CUIFSmartPageButton
  31. //
  32. class CUIFSmartPageButton : public CUIFButton2
  33. {
  34. public:
  35. CUIFSmartPageButton( CUIFObject *pParent, const RECT *prc, DWORD dwStyle );
  36. ~CUIFSmartPageButton( void );
  37. virtual void OnPaint( HDC hDC );
  38. };
  39. //
  40. // CUIFRowButton
  41. //
  42. class CUIFRowButton : public CUIFButton2
  43. {
  44. public:
  45. CUIFRowButton( CUIFObject *pParent, DWORD dwID, DWORD dwStyle );
  46. ~CUIFRowButton(void);
  47. void OnPaint( HDC hDC );
  48. void SetStyle( DWORD dwStyle );
  49. void OnLButtonDown( POINT pt );
  50. void SetCandListItem( CCandListItem* pItem );
  51. virtual void SetInlineCommentPos( int cx );
  52. virtual void SetInlineCommentFont( HFONT hFont );
  53. void GetExtent( SIZE *psize );
  54. void SetSelected( BOOL );
  55. protected:
  56. void UpdateText( void );
  57. CCandListItem *m_pCandListItem;
  58. HFONT m_hFontInlineComment;
  59. int m_cxInlineCommentPos;
  60. BOOL m_fSelected;
  61. };
  62. //
  63. // CANDPAGE
  64. //
  65. struct tagCANDPAGE;
  66. typedef struct tagCANDPAGE {
  67. int iPageStart;
  68. int nPageSize;
  69. tagCANDPAGE* pPrev;
  70. tagCANDPAGE* pNext;
  71. } CANDPAGE;
  72. //
  73. // CUIFRowList
  74. //
  75. class CUIFRowList : public CUIFObject,
  76. public CUIFCandListBase
  77. {
  78. public:
  79. CUIFRowList( CUIFObject *pParent, DWORD dwID, const RECT *prc, DWORD dwStyle );
  80. ~CUIFRowList( void );
  81. //
  82. // CUIFObject members
  83. //
  84. CUIFObject *Initialize( void );
  85. void SetRect( const RECT *prc );
  86. void SetStyle( DWORD dwStyle );
  87. void SetFont( HFONT hFontUI );
  88. LRESULT OnObjectNotify( CUIFObject *pUIObj, DWORD dwCommand, LPARAM lParam );
  89. //
  90. // CUIFCandListBase members
  91. //
  92. virtual int GetCurSel( void );
  93. virtual int GetTopItem( void );
  94. virtual int GetBottomItem( void );
  95. virtual BOOL IsVisible( void );
  96. virtual void GetRect( RECT *prc );
  97. virtual void GetItemRect( int iItem, RECT *prc );
  98. virtual int GetItemCount( void );
  99. virtual BOOL IsItemSelectable( int iListItem );
  100. virtual int AddCandItem( CCandListItem *pCandListItem );
  101. virtual CCandListItem *GetCandItem( int iItem );
  102. virtual void DelAllCandItem( void );
  103. virtual void SetCurSel( int iSelection );
  104. virtual void SetInlineCommentPos( int cx );
  105. virtual void SetInlineCommentFont( HFONT hFont );
  106. virtual void SetIndexFont( HFONT hFont );
  107. virtual void SetCandList( CCandidateList *pCandList );
  108. virtual BSTR GetAccNameProc( int iItem ) { return NULL; }
  109. virtual BSTR GetAccValueProc( int iItem ) { return NULL; }
  110. virtual LONG GetAccRoleProc( int iItem ) { return ROLE_SYSTEM_CLIENT; }
  111. virtual LONG GetAccStateProc( int iItem ) { return STATE_SYSTEM_DEFAULT; }
  112. virtual void GetAccLocationProc( int iItem, RECT *prc ) { ::SetRect( prc, 0, 0, 0, 0 ); }
  113. //
  114. //
  115. //
  116. void ShiftItem( int nItem );
  117. void ShiftPage( int nPage );
  118. protected:
  119. void ClearPageInfo( void );
  120. void Repage( void );
  121. void LayoutCurPage( void );
  122. void GetPageUpBtnRect( RECT *prc );
  123. void GetPageDnBtnRect( RECT *prc );
  124. DWORD GetPageUpBtnStyle( void );
  125. DWORD GetPageDnBtnStyle( void );
  126. DWORD GetRowButtonStyle( void );
  127. int m_nItem;
  128. int m_iItemSelect;
  129. CUIFSmartPageButton *m_pCandPageUpBtn;
  130. CUIFSmartPageButton *m_pCandPageDnBtn;
  131. CUIFRowButton *m_rgpButton[NUM_CANDSTR_MAX];
  132. CUIFObjectArray<CListItemBase> m_listItem;
  133. CANDPAGE *m_pcpCurPage;
  134. CANDPAGE m_cpPageHead;
  135. };
  136. #endif /* CUICAND2_H */