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.

154 lines
3.8 KiB

  1. //
  2. // cuibln.h
  3. //
  4. #ifndef CUIBLN_H
  5. #define CUIBLN_H
  6. #include "cuiobj.h"
  7. #include "cuiwnd.h"
  8. #define WNDCLASS_BALLOONWND "MSIME_PopupMessage"
  9. #define WNDTITLE_BALLOONWND "MSIME_PopupMessage"
  10. //
  11. // CUIFBallloonButton
  12. //
  13. class CUIFBalloonButton : public CUIFButton
  14. {
  15. public:
  16. CUIFBalloonButton( CUIFObject *pParent, DWORD dwID, const RECT *prc, DWORD dwStyle );
  17. virtual ~CUIFBalloonButton( void );
  18. //
  19. // CUIFObject methods
  20. //
  21. virtual void OnPaint( HDC hDC );
  22. int GetButtonID( void );
  23. void SetButtonID( int iButtonID );
  24. protected:
  25. int m_iButtonID;
  26. void DrawTextProc( HDC hDC, const RECT *prc, BOOL fDown );
  27. };
  28. //
  29. // CUIFBalloonWindow
  30. // = Balloon window class =
  31. //
  32. #define UIBALLOON_OK 0x00010000
  33. #define UIBALLOON_YESNO 0x00020000
  34. #define UIBALLOON_BUTTONS 0x000F0000 /* mask bit */
  35. typedef enum _BALLOONWNDPOS
  36. {
  37. BALLOONPOS_ABOVE,
  38. BALLOONPOS_BELLOW,
  39. BALLOONPOS_LEFT,
  40. BALLOONPOS_RIGHT,
  41. } BALLOONWNDPOS;
  42. typedef enum _BALLONWNDDIR
  43. {
  44. BALLOONDIR_LEFT,
  45. BALLOONDIR_RIGHT,
  46. BALLOONDIR_UP,
  47. BALLOONDIR_DOWN,
  48. } BALLOONWNDDIR;
  49. typedef enum _BALLONWNDALIGN
  50. {
  51. BALLOONALIGN_CENTER,
  52. BALLOONALIGN_LEFT,
  53. BALLOONALIGN_TOP = BALLOONALIGN_LEFT,
  54. BALLOONALIGN_RIGHT,
  55. BALLOONALIGN_BOTTOM = BALLOONALIGN_RIGHT,
  56. } BALLOONWNDALIGN;
  57. class CUIFBalloonWindow : public CUIFWindow
  58. {
  59. public:
  60. CUIFBalloonWindow( HINSTANCE hInst, DWORD dwStyle );
  61. virtual ~CUIFBalloonWindow( void );
  62. LPCTSTR GetClassName( void );
  63. LPCTSTR GetWndTitle( void );
  64. //
  65. // CUIFObject methods
  66. //
  67. virtual CUIFObject *Initialize( void );
  68. virtual void OnCreate( HWND hWnd );
  69. virtual void OnDestroy( HWND hWnd );
  70. virtual void OnPaint( HDC hDC );
  71. virtual void OnKeyDown( HWND hWnd, WPARAM wParam, LPARAM lParam );
  72. virtual LRESULT OnObjectNotify( CUIFObject *pUIObj, DWORD dwCommand, LPARAM lParam );
  73. //
  74. //
  75. //
  76. LRESULT SetText( LPCWSTR pwchMessage );
  77. LRESULT SetNotifyWindow( HWND hWndNotify, UINT uiMsgNotify );
  78. LRESULT SetBalloonPos( BALLOONWNDPOS pos );
  79. LRESULT SetBalloonAlign( BALLOONWNDALIGN align );
  80. LRESULT GetBalloonBkColor( void );
  81. LRESULT GetBalloonTextColor( void );
  82. LRESULT GetMargin( RECT *prc );
  83. LRESULT GetMaxBalloonWidth( void );
  84. LRESULT SetBalloonBkColor( COLORREF col );
  85. LRESULT SetBalloonTextColor( COLORREF col );
  86. LRESULT SetMargin( RECT *prc );
  87. LRESULT SetMaxBalloonWidth( INT iWidth );
  88. LRESULT SetButtonText( int idCmd, LPCWSTR pwszText );
  89. LRESULT SetTargetPos( POINT ptTarget );
  90. LRESULT SetExcludeRect( const RECT *prcExclude );
  91. protected:
  92. WCHAR *m_pwszText;
  93. HRGN m_hWindowRgn;
  94. RECT m_rcMargin;
  95. INT m_iMaxTxtWidth;
  96. BOOL m_fColBack;
  97. BOOL m_fColText;
  98. COLORREF m_colBack;
  99. COLORREF m_colText;
  100. POINT m_ptTarget;
  101. RECT m_rcExclude;
  102. POINT m_ptTail;
  103. BALLOONWNDPOS m_posDef;
  104. BALLOONWNDPOS m_pos;
  105. BALLOONWNDDIR m_dir;
  106. BALLOONWNDALIGN m_align;
  107. int m_nButton;
  108. int m_iCmd;
  109. HWND m_hWndNotify;
  110. UINT m_uiMsgNotify;
  111. HRGN CreateRegion( RECT *prc );
  112. void InitWindowRegion( void );
  113. void DoneWindowRegion( void );
  114. void PaintFrameProc( HDC hDC, RECT *prc );
  115. void PaintMessageProc( HDC hDC, RECT *prc, WCHAR *pwszText );
  116. void GetButtonSize( SIZE *pSize );
  117. void AdjustPos( void );
  118. void LayoutObject( void );
  119. void AddButton( int idCmd );
  120. CUIFObject *FindUIObject( DWORD dwID );
  121. CUIFBalloonButton *FindButton( int idCmd );
  122. void SendNotification( int iCmd );
  123. };
  124. #endif /* CUIBLN_H */