123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- //
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright 2015 Autodesk, Inc. All rights reserved.
- //
- // Use of this software is subject to the terms of the Autodesk license
- // agreement provided at the time of installation or download, or which
- // otherwise accompanies this software in either electronic or hard copy form.
- //
- //////////////////////////////////////////////////////////////////////////////
- #ifndef _aduiTextTip_h
- #define _aduiTextTip_h
- #pragma pack (push, 8)
- #pragma once
- #ifndef _ADESK_MAC_
- /////////////////////////////////////////////////////////////////////////////
- // CAdUiTipWindow
- #pragma warning(push)
- #pragma warning(disable : 4275)
- class ADUI_PORT CAdUiTipWindow : public CWnd {
- DECLARE_DYNAMIC(CAdUiTipWindow)
- public:
- CAdUiTipWindow ();
- virtual ~CAdUiTipWindow ();
- // Tip Window
- private:
- void ForwardClickMessage (UINT msg, UINT nFlags, CPoint& point, BOOL focus);
- protected:
- static LPCTSTR m_className; // Registered class name
- static const UINT_PTR m_timerEvent;
- BOOL m_bUseText; // Draw as text vs. owner-draw.
- CWnd *m_control; // Related control
- CWnd *m_owner; // Owner (dialog, etc.)
- UINT_PTR m_timerId;
- virtual void DrawBorder (CDC& dc, CRect& rExterior, CRect& rInterior);
- virtual void DrawContent (CDC& dc, CRect& rInterior);
- void StartTimer (DWORD ms=50);
- void StopTimer ();
- public:
- virtual BOOL Create (CWnd *owner);
- CWnd *GetControl ();
- void GetTextExtent (LPCTSTR text, int& width, int& height);
- BOOL GetUseText ();
- virtual void Hide ();
- CWnd *Owner ();
- void SetControl (CWnd *control);
- void SetUseText (BOOL useText);
- virtual void Show ();
- // ClassWizard-controlled
- public:
- //{{AFX_VIRTUAL(CAdUiTipWindow)
- //}}AFX_VIRTUAL
- protected:
- //{{AFX_MSG(CAdUiTipWindow)
- afx_msg void OnActivateApp(BOOL bActive, DWORD hTask);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnMButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnNcDestroy();
- afx_msg void OnPaint();
- afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnTimer(UINT_PTR nIDEvent);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- #pragma warning(pop)
- /////////////////////////////////////////////////////////////////////////////
- // CAdUiBalloonTip window - INTERNAL USE ONLY
- class ADUI_PORT CAdUiBalloonTip : public CAdUiTipWindow {
- DECLARE_DYNAMIC(CAdUiBalloonTip)
- public:
- CAdUiBalloonTip ();
- virtual ~CAdUiBalloonTip ();
- // Text Tip
- protected:
- CPoint m_initialCursorPos;
- virtual void DrawBorder (CDC& dc, CRect& rExterior, CRect& rInterior);
- virtual void DrawContent (CDC& dc, CRect& rInterior);
- public:
- virtual void Hide ();
- virtual void Show ();
- // ClassWizard-controlled
- public:
- //{{AFX_VIRTUAL(CAdUiBalloonTip)
- //}}AFX_VIRTUAL
- protected:
- //{{AFX_MSG(CAdUiBalloonTip)
- afx_msg void OnTimer(UINT_PTR nIDEvent);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- // CAdUiTextTip window
- class ADUI_PORT CAdUiTextTip : public CAdUiTipWindow {
- DECLARE_DYNAMIC(CAdUiTextTip)
- public:
- CAdUiTextTip ();
- virtual ~CAdUiTextTip ();
- // Text Tip
- protected:
- virtual void DrawBorder (CDC& dc, CRect& rExterior, CRect& rInterior);
- virtual void DrawContent (CDC& dc, CRect& rInterior);
- public:
- virtual void Hide ();
- void Update (CWnd *control, BOOL useText);
- void UpdateIfNecessary (CWnd *control, BOOL useText);
- // ClassWizard-controlled
- public:
- //{{AFX_VIRTUAL(CAdUiTextTip)
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- //}}AFX_VIRTUAL
- protected:
- //{{AFX_MSG(CAdUiTextTip)
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- // CAdToolTipCtrl: for INTERNAL USE ONLY.
- class AdToolTip;
- #pragma warning(push)
- #pragma warning(disable : 4275)
- class ADUI_PORT CAdToolTipCtrl : public CToolTipCtrl{
- DECLARE_MESSAGE_MAP()
- public:
- CAdToolTipCtrl();
- virtual ~CAdToolTipCtrl ();
- virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDestroy();
- static void SetToolTipsFlag(BOOL bToolTipsFlag);
- static void SetDeaultDelayTime(int nDelay);
- protected:
- virtual AdToolTip * CreateAdToolTipInstance();
- AdToolTip* m_pToolTip;
- BOOL m_bActivate;
- UINT m_nDelayTime;
- private:
- static BOOL m_bToolTipHasCreated;
- static BOOL m_bToolTipsFlag;
- static UINT m_nDefaultDealyTime;
- };
- #pragma warning(pop)
- /////////////////////////////////////////////////////////////////////////////
- // CAdWthToolTipCtrl, used for What's this help: for INTERNAL USE ONLY.
- class AdWthToolTip;
- class ADUI_PORT CAdWthToolTipCtrl : public CAdToolTipCtrl
- {
- DECLARE_MESSAGE_MAP()
- public:
- AdWthToolTip* GetWthToolTip();
- protected:
- virtual AdToolTip * CreateAdToolTipInstance();
- };
- /////////////////////////////////////////////////////////////////////////////
- // These functions are all for INTERNAL USE ONLY.
- void ADUI_PORT AdUiHideBalloonTip (CWnd *control);
- BOOL ADUI_PORT AdUiShowBalloonTip (
- CWnd *owner, CWnd *control, LPCTSTR text, BOOL beep
- );
- BOOL ADUI_PORT AdUiShowBalloonTip (
- CWnd *owner, CWnd *control, CRect& rect, LPCTSTR text, BOOL beep
- );
- #endif // _ADESK_MAC_
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
- #pragma pack (pop)
- #endif
- //////////////////////////////////////////////////////////////////////////////
|