ReactOS 0.4.15-dev-8390-g075894b
CUIFToolTip Class Reference

#include <cicuif.h>

Inheritance diagram for CUIFToolTip:
Collaboration diagram for CUIFToolTip:

Public Types

enum  { TOOLTIP_TIMER_ID = 0x3216 }
 
- Public Types inherited from CUIFWindow
enum  { POINTING_TIMER_ID = 0x7982 , USER_TIMER_ID = 0x5461 }
 

Public Member Functions

 CUIFToolTip (HINSTANCE hInst, DWORD style, CUIFWindow *pToolTipOwner)
 
 ~CUIFToolTip () override
 
LONG GetDelayTime (UINT uType)
 
void GetMargin (LPRECT prc)
 
COLORREF GetTipBkColor ()
 
COLORREF GetTipTextColor ()
 
CUIFObjectFindObject (HWND hWnd, POINT pt)
 
void ShowTip ()
 
void HideTip ()
 
void GetTipWindowSize (LPSIZE pSize)
 
void GetTipWindowRect (LPRECT pRect, SIZE toolTipSize, LPCRECT prc)
 
void RelayEvent (LPMSG pMsg)
 
 STDMETHOD_ (void, OnPaint)(HDC hDC) override
 
 STDMETHOD_ (void, Enable)(BOOL bEnable) override
 
 STDMETHOD_ (void, OnTimer)(WPARAM wParam) override
 
- Public Member Functions inherited from CUIFWindow
 operator HWND () const
 
 CUIFWindow (HINSTANCE hInst, DWORD style)
 
 ~CUIFWindow () override
 
 STDMETHOD_ (BOOL, Initialize)() override
 
 STDMETHOD_ (void, Show)(BOOL bVisible) override
 
 STDMETHOD_ (void, SetRect)(LPCRECT prc) override
 
 STDMETHOD_ (void, PaintObject)(HDC hDC
 
 STDMETHOD_ (void, RemoveUIObj)(CUIFObject *pRemove) override
 
void SetCaptureObject (CUIFObject *pCaptured)
 
void SetObjectPointed (CUIFObject *pPointed, POINT pt)
 
void CreateScheme ()
 
BOOL GetWorkArea (LPCRECT prcWnd, LPRECT prcWorkArea)
 
void AdjustWindowPosition ()
 
void SetBehindModal (CUIFWindow *pBehindModal)
 
void SetTimerObject (CUIFObject *pTimerObject, UINT uElapse)
 
 STDMETHOD_ (LPCTSTR, GetClassName)()
 
 STDMETHOD_ (LPCTSTR, GetWndTitle)()
 
 STDMETHOD_ (DWORD, GetWndStyle)()
 
 STDMETHOD_ (DWORD, GetWndStyleEx)()
 
 STDMETHOD_ (HWND, CreateWnd)(HWND hwndParent)
 
 STDMETHOD_ (void, Move)(INT x
 
 STDMETHOD_ (BOOL, AnimateWnd)(DWORD dwTime
 
 STDMETHOD_ (void, OnObjectMoved)(CUIFObject *pObject)
 
 STDMETHOD_ (void, OnMouseOutFromWindow)(LONG x
 
 STDMETHOD_ (LRESULT, OnDisplayChange)(HWND hWnd
 
 STDMETHOD_ (HRESULT, OnGetObject)(HWND hWnd
 
 STDMETHOD_ (LRESULT, WindowProc)(HWND hWnd
 
 STDMETHOD_ (BOOL, OnEraseBkGnd)(HWND hWnd
 
 STDMETHOD_ (void, OnThemeChanged)(HWND hWnd
 
 STDMETHOD_ (void, UpdateUI)(LPCRECT prc)
 
 STDMETHOD_ (void, SetCapture)(int)
 
 STDMETHOD_ (void, ModalMouseNotify)(UINT uMsg
 
 STDMETHOD_ (void, HandleMouseMsg)(UINT uMsg
 
 STDMETHOD_ (void, ClientRectToWindowRect)(LPRECT pRect)
 
 STDMETHOD_ (void, GetWindowFrameSize)(LPSIZE pSize)
 
- Public Member Functions inherited from CUIFObject
 CUIFObject (CUIFObject *pParent, DWORD nObjectID, LPCRECT prc, DWORD style)
 @unimplemented
 
virtual ~CUIFObject ()
 
void StartCapture ()
 
void EndCapture ()
 
BOOL IsCapture ()
 
BOOL IsRTL ()
 
LRESULT NotifyCommand (WPARAM wParam, LPARAM lParam)
 
CUIFObjectObjectFromPoint (POINT pt)
 
void SetScheme (CUIFScheme *scheme)
 
void StartTimer (WPARAM wParam)
 
void EndTimer ()
 
 STDMETHOD_ (BOOL, Initialize)()
 
 STDMETHOD_ (void, OnPaint)(HDC hDC)
 
 STDMETHOD_ (void, OnTimer)()
 
 STDMETHOD_ (void, OnLButtonDown)(LONG x
 
 STDMETHOD_ (void, GetRect)(LPRECT prc)
 
 STDMETHOD_ (void, SetRect)(LPCRECT prc)
 
 STDMETHOD_ (BOOL, PtInObject)(POINT pt)
 
 STDMETHOD_ (void, PaintObject)(HDC hDC
 
 STDMETHOD_ (void, CallOnPaint)()
 
 STDMETHOD_ (void, Enable)(BOOL bEnable)
 
 STDMETHOD_ (void, Show)(BOOL bVisible)
 
 STDMETHOD_ (void, SetFontToThis)(HFONT hFont)
 
 STDMETHOD_ (void, SetFont)(HFONT hFont)
 
 STDMETHOD_ (void, SetStyle)(DWORD style)
 
 STDMETHOD_ (void, AddUIObj)(CUIFObject *pObject)
 
 STDMETHOD_ (void, RemoveUIObj)(CUIFObject *pObject)
 
 STDMETHOD_ (LRESULT, OnObjectNotify)(CUIFObject *pObject
 
 STDMETHOD_ (void, SetToolTip)(LPCWSTR pszToolTip)
 
 STDMETHOD_ (LPCWSTR, GetToolTip)()
 
 STDMETHOD_ (LRESULT, OnShowToolTip)()
 
 STDMETHOD_ (void, OnHideToolTip)()
 
 STDMETHOD_ (void, DetachWndObj)()
 
 STDMETHOD_ (void, ClearWndObj)()
 
 STDMETHOD_ (BOOL, OnPaintTheme)(HDC hDC)
 
 STDMETHOD_ (void, OnPaintNoTheme)(HDC hDC)
 
 STDMETHOD_ (void, ClearTheme)()
 
- Public Member Functions inherited from CUIFTheme
HRESULT InternalOpenThemeData (HWND hWnd)
 
HRESULT EnsureThemeData (HWND hWnd)
 
HRESULT CloseThemeData ()
 
STDMETHOD() DrawThemeBackground (HDC hDC, int iStateId, LPCRECT pRect, LPCRECT pClipRect)
 
STDMETHOD() DrawThemeParentBackground (HWND hwnd, HDC hDC, LPRECT prc)
 
STDMETHOD() DrawThemeText (HDC hDC, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect)
 
STDMETHOD() DrawThemeIcon (HDC hDC, int iStateId, LPCRECT pRect, HIMAGELIST himl, int iImageIndex)
 
STDMETHOD() GetThemeBackgroundExtent (HDC hDC, int iStateId, LPCRECT pContentRect, LPRECT pExtentRect)
 
STDMETHOD() GetThemeBackgroundContentRect (HDC hDC, int iStateId, LPCRECT pBoundingRect, LPRECT pContentRect)
 
STDMETHOD() GetThemeTextExtent (HDC hDC, int iStateId, LPCWSTR pszText, int cchCharCount, DWORD dwTextFlags, LPCRECT pBoundingRect, LPRECT pExtentRect)
 
STDMETHOD() GetThemePartSize (HDC hDC, int iStateId, LPRECT prc, THEMESIZE eSize, SIZE *psz)
 
STDMETHOD() DrawThemeEdge (HDC hDC, int iStateId, LPCRECT pDestRect, UINT uEdge, UINT uFlags, LPRECT pContentRect)
 
STDMETHOD() GetThemeColor (int iStateId, int iPropId, COLORREF *pColor)
 
STDMETHOD() GetThemeMargins (HDC hDC, int iStateId, int iPropId, LPRECT prc, MARGINS *pMargins)
 
STDMETHOD() GetThemeFont (HDC hDC, int iStateId, int iPropId, LOGFONTW *pFont)
 
 STDMETHOD_ (COLORREF, GetThemeSysColor)(INT iColorId)
 
 STDMETHOD_ (int, GetThemeSysSize)(int iSizeId)
 
 STDMETHOD_ (void, SetActiveTheme)(LPCWSTR pszClassList
 

Protected Attributes

CUIFWindowm_pToolTipOwner
 
CUIFObjectm_pToolTipTarget
 
LPWSTR m_pszToolTipText
 
BOOL m_bShowToolTip
 
DWORD m_dwUnknown10
 
LONG m_nDelayTimeType2
 
LONG m_nDelayTimeType3
 
LONG m_nDelayTimeType1
 
RECT m_rcToolTipMargin
 
LONG m_cxToolTipWidth
 
BOOL m_bToolTipHasBkColor
 
BOOL m_bToolTipHasTextColor
 
COLORREF m_rgbToolTipBkColor
 
COLORREF m_rgbToolTipTextColor
 
- Protected Attributes inherited from CUIFWindow
INT m_nLeft
 
INT m_nTop
 
INT m_nHeight
 
INT m_nWidth
 
HINSTANCE m_hInst
 
HWND m_hWnd
 
CUIFObjectm_pTimerObject
 
CUIFObjectm_pCaptured
 
CUIFObjectm_pPointed
 
BOOL m_bPointing
 
CUIFWindowm_pBehindModal
 
CUIFToolTipm_pToolTip
 
CUIFShadowm_pShadow
 
BOOL m_bShowShadow
 
- Protected Attributes inherited from CUIFObject
CUIFObjectm_pParent
 
CUIFWindowm_pWindow
 
CUIFSchemem_pScheme
 
CUIFObjectArray m_ObjectArray
 
DWORD m_nObjectID
 
DWORD m_style
 
RECT m_rc
 
BOOL m_bEnable
 
BOOL m_bVisible
 
HFONT m_hFont
 
BOOL m_bHasCustomFont
 
LPWSTR m_pszToolTip
 
DWORD m_dwUnknown4 [2]
 

Friends

class CUIFObject
 
class CTipbarWnd
 

Additional Inherited Members

- Static Public Member Functions inherited from CUIFWindow
static CUIFWindowGetThis (HWND hWnd)
 
static void SetThis (HWND hWnd, LONG_PTR dwNewLong)
 
static LRESULT CALLBACK WindowProcedure (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Public Attributes inherited from CUIFWindow
LPCRECT prc override
 
INT y
 
INT INT nWidth
 
INT INT INT nHeight
 
DWORD dwFlags
 
LONG y
 
UINT uMsg
 
UINT WPARAM wParam
 
UINT WPARAM LPARAM lParam { return 0
 
WPARAM wParam
 
WPARAM LPARAM lParam
 
LONG x
 
LONG LONG y
 
- Public Attributes inherited from CUIFObject
LONG y
 
LPCRECT prc
 
WPARAM wParam
 
WPARAM LPARAM lParam
 
- Public Attributes inherited from CUIFTheme
LPCWSTR m_pszClassList
 
INT m_iPartId
 
INT m_iStateId
 
HTHEME m_hTheme
 
INT iPartId
 
INT INT iStateId
 
- Static Public Attributes inherited from CUIFTheme
static HINSTANCE s_hUXTHEME = NULL
 
static FN_OpenThemeData s_fnOpenThemeData = NULL
 
static FN_CloseThemeData s_fnCloseThemeData = NULL
 
static FN_DrawThemeBackground s_fnDrawThemeBackground = NULL
 
static FN_DrawThemeParentBackground s_fnDrawThemeParentBackground = NULL
 
static FN_DrawThemeText s_fnDrawThemeText = NULL
 
static FN_DrawThemeIcon s_fnDrawThemeIcon = NULL
 
static FN_GetThemeBackgroundExtent s_fnGetThemeBackgroundExtent = NULL
 
static FN_GetThemeBackgroundContentRect s_fnGetThemeBackgroundContentRect = NULL
 
static FN_GetThemeTextExtent s_fnGetThemeTextExtent = NULL
 
static FN_GetThemePartSize s_fnGetThemePartSize = NULL
 
static FN_DrawThemeEdge s_fnDrawThemeEdge = NULL
 
static FN_GetThemeColor s_fnGetThemeColor = NULL
 
static FN_GetThemeMargins s_fnGetThemeMargins = NULL
 
static FN_GetThemeFont s_fnGetThemeFont = NULL
 
static FN_GetThemeSysColor s_fnGetThemeSysColor = NULL
 
static FN_GetThemeSysSize s_fnGetThemeSysSize = NULL
 

Detailed Description

Definition at line 609 of file cicuif.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
TOOLTIP_TIMER_ID 

Definition at line 630 of file cicuif.h.

630{ TOOLTIP_TIMER_ID = 0x3216 };
@ TOOLTIP_TIMER_ID
Definition: cicuif.h:630

Constructor & Destructor Documentation

◆ CUIFToolTip()

CUIFToolTip::CUIFToolTip ( HINSTANCE  hInst,
DWORD  style,
CUIFWindow pToolTipOwner 
)

Definition at line 2338 of file cicuif.cpp.

2340{
2341 m_pToolTipOwner = pToolTipOwner;
2348 m_dwUnknown10 = 0; //FIXME: name and type
2349 m_nDelayTimeType2 = -1;
2350 m_nDelayTimeType3 = -1;
2351 m_nDelayTimeType1 = -1;
2352 m_cxToolTipWidth = -1;
2357}
Arabic default style
Definition: afstyles.h:94
CUIFObject * m_pToolTipTarget
Definition: cicuif.h:613
COLORREF m_rgbToolTipTextColor
Definition: cicuif.h:625
LONG m_nDelayTimeType3
Definition: cicuif.h:618
LONG m_nDelayTimeType2
Definition: cicuif.h:617
RECT m_rcToolTipMargin
Definition: cicuif.h:620
LPWSTR m_pszToolTipText
Definition: cicuif.h:614
LONG m_nDelayTimeType1
Definition: cicuif.h:619
LONG m_cxToolTipWidth
Definition: cicuif.h:621
BOOL m_bToolTipHasBkColor
Definition: cicuif.h:622
DWORD m_dwUnknown10
Definition: cicuif.h:616
CUIFWindow * m_pToolTipOwner
Definition: cicuif.h:612
COLORREF m_rgbToolTipBkColor
Definition: cicuif.h:624
BOOL m_bToolTipHasTextColor
Definition: cicuif.h:623
#define NULL
Definition: types.h:112
HINSTANCE hInst
Definition: dxdiag.c:13
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306

◆ ~CUIFToolTip()

CUIFToolTip::~CUIFToolTip ( )
override

Definition at line 2359 of file cicuif.cpp.

2360{
2361 if (m_pToolTipOwner)
2363 if (m_pszToolTipText)
2364 delete[] m_pszToolTipText;
2365}
CUIFToolTip * m_pToolTip
Definition: cicuif.h:524

Member Function Documentation

◆ FindObject()

CUIFObject * CUIFToolTip::FindObject ( HWND  hWnd,
POINT  pt 
)

Definition at line 2424 of file cicuif.cpp.

2425{
2426 if (hWnd == *m_pToolTipOwner)
2428 return NULL;
2429}
HWND hWnd
Definition: settings.c:17
CUIFObject * ObjectFromPoint(POINT pt)
Definition: cicuif.cpp:480
#define pt(x, y)
Definition: drawing.c:79

Referenced by RelayEvent().

◆ GetDelayTime()

LONG CUIFToolTip::GetDelayTime ( UINT  uType)

Definition at line 2368 of file cicuif.cpp.

2369{
2370 LONG nDelayTime;
2371 switch (uType)
2372 {
2373 case 1:
2374 {
2375 nDelayTime = m_nDelayTimeType1;
2376 if (nDelayTime == -1)
2377 return ::GetDoubleClickTime() / 5;
2378 return nDelayTime;
2379 }
2380 case 2:
2381 {
2382 nDelayTime = m_nDelayTimeType2;
2383 if (nDelayTime == -1)
2384 return 10 * ::GetDoubleClickTime();
2385 return nDelayTime;
2386 }
2387 case 3:
2388 {
2389 nDelayTime = m_nDelayTimeType3;
2390 if (nDelayTime == -1)
2391 return ::GetDoubleClickTime();
2392 return nDelayTime;
2393 }
2394 default:
2395 {
2396 return 0;
2397 }
2398 }
2399}
long LONG
Definition: pedump.c:60
UINT WINAPI GetDoubleClickTime(void)
Definition: ntwrapper.h:314

Referenced by RelayEvent().

◆ GetMargin()

void CUIFToolTip::GetMargin ( LPRECT  prc)

Definition at line 2401 of file cicuif.cpp.

2402{
2403 if (prc)
2405}
LPCRECT prc
Definition: cicuif.h:230

Referenced by GetTipWindowSize().

◆ GetTipBkColor()

COLORREF CUIFToolTip::GetTipBkColor ( )

Definition at line 2408 of file cicuif.cpp.

2409{
2411 return m_rgbToolTipBkColor;
2412 return ::GetSysColor(COLOR_INFOBK);
2413}
#define COLOR_INFOBK
Definition: winuser.h:942

◆ GetTipTextColor()

COLORREF CUIFToolTip::GetTipTextColor ( )

Definition at line 2416 of file cicuif.cpp.

2417{
2419 return m_rgbToolTipTextColor;
2420 return ::GetSysColor(COLOR_INFOTEXT);
2421}
#define COLOR_INFOTEXT
Definition: winuser.h:941

◆ GetTipWindowRect()

void CUIFToolTip::GetTipWindowRect ( LPRECT  pRect,
SIZE  toolTipSize,
LPCRECT  prc 
)

Definition at line 2534 of file cicuif.cpp.

2535{
2536 POINT Point;
2538
2539 HCURSOR hCursor = ::GetCursor();
2541 INT yHotspot = 0;
2543 if (hCursor && ::GetIconInfo(hCursor, &IconInfo))
2544 {
2545 BITMAP bm;
2546 ::GetObject(IconInfo.hbmMask, sizeof(bm), &bm);
2547 if (!IconInfo.fIcon)
2548 {
2549 cyCursor = bm.bmHeight;
2550 yHotspot = IconInfo.yHotspot;
2551 if (!IconInfo.hbmColor)
2552 cyCursor = bm.bmHeight / 2;
2553 }
2554 if (IconInfo.hbmColor)
2556 if (IconInfo.hbmMask)
2558 }
2559
2560 RECT rcMonitor;
2561 rcMonitor.left = 0;
2562 rcMonitor.top = 0;
2563 rcMonitor.right = GetSystemMetrics(SM_CXSCREEN);
2564 rcMonitor.bottom = GetSystemMetrics(SM_CYSCREEN);
2565
2566 HMONITOR hMon = ::MonitorFromPoint(Point, MONITOR_DEFAULTTONEAREST);
2568 if (hMon)
2569 {
2570 mi.cbSize = sizeof(MONITORINFO);
2571 if (::GetMonitorInfo(hMon, &mi))
2572 rcMonitor = mi.rcMonitor;
2573 }
2574
2575 pRect->left = Point.x;
2576 pRect->right = pRect->left + toolTipSize.cx;
2577 pRect->top = Point.y + cyCursor - yHotspot;
2578 pRect->bottom = pRect->top + toolTipSize.cy;
2579
2580 if (rcMonitor.right < pRect->right)
2581 {
2582 pRect->left = rcMonitor.right - toolTipSize.cx;
2583 pRect->right = rcMonitor.right;
2584 }
2585 if (pRect->left < rcMonitor.left)
2586 {
2587 pRect->left = rcMonitor.left;
2588 pRect->right = rcMonitor.left + toolTipSize.cx;
2589 }
2590 if (rcMonitor.bottom < pRect->bottom)
2591 {
2592 pRect->top = rcMonitor.bottom - toolTipSize.cy;
2593 pRect->bottom = rcMonitor.bottom;
2594 }
2595 if (pRect->top < rcMonitor.top)
2596 {
2597 pRect->top = rcMonitor.top;
2598 pRect->bottom = rcMonitor.top + toolTipSize.cy;
2599 }
2600}
pKey DeleteObject()
_Out_opt_ PICONINFO IconInfo
Definition: ntuser.h:2294
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
Definition: bl.h:1331
DWORD yHotspot
Definition: winuser.h:3125
BOOL fIcon
Definition: winuser.h:3123
HBITMAP hbmColor
Definition: winuser.h:3127
HBITMAP hbmMask
Definition: winuser.h:3126
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
RECT rcMonitor
Definition: winuser.h:3785
DWORD cbSize
Definition: winuser.h:3784
int32_t INT
Definition: typedefs.h:58
static MONITORINFO mi
Definition: win.c:7338
HICON HCURSOR
Definition: windef.h:299
HCURSOR WINAPI GetCursor(void)
Definition: cursoricon.c:2728
#define GetObject
Definition: wingdi.h:4468
#define GetMonitorInfo
Definition: winuser.h:5800
#define SM_CYSCREEN
Definition: winuser.h:960
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2089
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2714
struct tagMONITORINFO MONITORINFO
#define SM_CXSCREEN
Definition: winuser.h:959
#define SM_CYCURSOR
Definition: winuser.h:975
int WINAPI GetSystemMetrics(_In_ int)

Referenced by ShowTip().

◆ GetTipWindowSize()

void CUIFToolTip::GetTipWindowSize ( LPSIZE  pSize)

Definition at line 2496 of file cicuif.cpp.

2497{
2498 if (!m_pszToolTipText)
2499 return;
2500
2501 HDC hDC = ::GetDC(m_hWnd);
2502 HGDIOBJ hFontOld = ::SelectObject(hDC, m_hFont);
2503
2504 RECT rcText = { 0, 0, 0, 0 };
2505 INT cyText;
2506 if (m_cxToolTipWidth <= 0)
2507 {
2508 cyText = ::DrawTextW(hDC, m_pszToolTipText, -1, &rcText, DT_CALCRECT | DT_SINGLELINE);
2509 }
2510 else
2511 {
2512 rcText.right = m_cxToolTipWidth;
2513 cyText = ::DrawTextW(hDC, m_pszToolTipText, -1, &rcText, DT_CALCRECT | DT_WORDBREAK);
2514 }
2515
2516 RECT rcMargin;
2517 GetMargin(&rcMargin);
2518
2519 RECT rc;
2520 rc.left = rcText.left - rcMargin.left;
2521 rc.top = rcText.top - rcMargin.top;
2522 rc.right = rcText.right + rcMargin.right;
2523 rc.bottom = rcText.top + cyText + rcMargin.bottom;
2524 ClientRectToWindowRect(&rc);
2525
2526 pSize->cx = rc.right - rc.left;
2527 pSize->cy = rc.bottom - rc.top;
2528
2529 ::SelectObject(hDC, hFontOld);
2531}
static HDC hDC
Definition: 3dtext.c:33
HFONT m_hFont
Definition: cicuif.h:192
void GetMargin(LPRECT prc)
Definition: cicuif.cpp:2401
HWND m_hWnd
Definition: cicuif.h:518
static HDC
Definition: imagelist.c:92
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
LONG cx
Definition: windef.h:334
LONG cy
Definition: windef.h:335
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define DT_SINGLELINE
Definition: winuser.h:540
#define DT_WORDBREAK
Definition: winuser.h:544
HDC WINAPI GetDC(_In_opt_ HWND)
#define DT_CALCRECT
Definition: winuser.h:526

Referenced by ShowTip().

◆ HideTip()

void CUIFToolTip::HideTip ( )

Definition at line 2476 of file cicuif.cpp.

2477{
2480
2481 if (m_pToolTipTarget)
2482 m_pToolTipTarget->OnHideToolTip();
2483
2484 if (m_bVisible)
2485 {
2486 if (m_pszToolTipText)
2487 {
2488 delete[] m_pszToolTipText;
2490 }
2491 Show(FALSE);
2492 }
2493}
BOOL m_bVisible
Definition: cicuif.h:191
BOOL m_bShowToolTip
Definition: cicuif.h:615
#define FALSE
Definition: types.h:117
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by RelayEvent().

◆ RelayEvent()

void CUIFToolTip::RelayEvent ( LPMSG  pMsg)

Definition at line 2603 of file cicuif.cpp.

2604{
2605 if (!pMsg)
2606 return;
2607
2608 switch (pMsg->message)
2609 {
2610 case WM_MOUSEMOVE:
2611 {
2612 if (m_bEnable &&
2613 ::GetKeyState(VK_LBUTTON) >= 0 &&
2614 ::GetKeyState(VK_MBUTTON) >= 0 &&
2616 {
2617 POINT pt = { (SHORT)LOWORD(pMsg->lParam), (SHORT)HIWORD(pMsg->lParam) };
2618 CUIFObject *pFound = CUIFToolTip::FindObject(pMsg->hwnd, pt);
2619 if (pFound)
2620 {
2621 if (m_pToolTipTarget != pFound)
2622 {
2623 HideTip();
2624
2625 LONG DelayTime;
2626 if (!m_bVisible)
2627 DelayTime = GetDelayTime(3);
2628 else
2629 DelayTime = GetDelayTime(1);
2630 ::SetTimer(m_hWnd, TOOLTIP_TIMER_ID, DelayTime, NULL);
2631 }
2632 }
2633 else
2634 {
2635 HideTip();
2636 }
2637 m_pToolTipTarget = pFound;
2638 }
2639 break;
2640 }
2641 case WM_LBUTTONDOWN:
2642 case WM_RBUTTONDOWN:
2643 case WM_MBUTTONDOWN:
2644 {
2645 HideTip();
2646 break;
2647 }
2648 }
2649}
BOOL m_bEnable
Definition: cicuif.h:190
LONG GetDelayTime(UINT uType)
Definition: cicuif.cpp:2368
CUIFObject * FindObject(HWND hWnd, POINT pt)
Definition: cicuif.cpp:2424
void HideTip()
Definition: cicuif.cpp:2476
#define LOWORD(l)
Definition: pedump.c:82
short SHORT
Definition: pedump.c:59
UINT message
Definition: winuser.h:3115
HWND hwnd
Definition: winuser.h:3114
LPARAM lParam
Definition: winuser.h:3117
#define HIWORD(l)
Definition: typedefs.h:247
#define VK_RBUTTON
Definition: winuser.h:2191
#define WM_MOUSEMOVE
Definition: winuser.h:1775
#define VK_MBUTTON
Definition: winuser.h:2193
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_RBUTTONDOWN
Definition: winuser.h:1779
#define WM_MBUTTONDOWN
Definition: winuser.h:1782
SHORT WINAPI GetKeyState(_In_ int)
#define VK_LBUTTON
Definition: winuser.h:2190

◆ ShowTip()

void CUIFToolTip::ShowTip ( )

Definition at line 2432 of file cicuif.cpp.

2433{
2435
2436 if (!m_pToolTipTarget)
2437 return;
2438
2439 LPCWSTR pszText = m_pToolTipTarget->GetToolTip();
2440 if (!pszText)
2441 return;
2442
2443 if (!m_pToolTipTarget || m_pToolTipTarget->OnShowToolTip())
2444 return;
2445
2446 POINT Point;
2449
2450 RECT rc;
2451 m_pToolTipTarget->GetRect(&rc);
2452 if (!::PtInRect(&rc, Point))
2453 return;
2454
2455 size_t cchText = wcslen(pszText);
2457 if (!m_pszToolTipText)
2458 return;
2459
2460 lstrcpynW(m_pszToolTipText, pszText, cchText + 1);
2461
2462 SIZE size;
2464
2465 RECT rc2 = rc;
2468 GetTipWindowRect(&rc2, size, &rc);
2469
2471 Move(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
2472 Show(TRUE);
2473}
#define cicNoThrow
Definition: cicbase.h:34
CUIFWindow * m_pWindow
Definition: cicuif.h:184
void GetTipWindowRect(LPRECT pRect, SIZE toolTipSize, LPCRECT prc)
Definition: cicuif.cpp:2534
void GetTipWindowSize(LPSIZE pSize)
Definition: cicuif.cpp:2496
#define TRUE
Definition: types.h:120
static const WCHAR rc2[]
Definition: oid.c:1216
#define lstrcpynW
Definition: compat.h:738
GLsizeiptr size
Definition: glext.h:5919
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
_In_ int cchText
Definition: winuser.h:4465
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ STDMETHOD_() [1/3]

CUIFToolTip::STDMETHOD_ ( void  ,
Enable   
)
override

◆ STDMETHOD_() [2/3]

CUIFToolTip::STDMETHOD_ ( void  ,
OnPaint   
)
override

◆ STDMETHOD_() [3/3]

CUIFToolTip::STDMETHOD_ ( void  ,
OnTimer   
)
override

Friends And Related Function Documentation

◆ CTipbarWnd

friend class CTipbarWnd
friend

Definition at line 627 of file cicuif.h.

◆ CUIFObject

friend class CUIFObject
friend

Definition at line 626 of file cicuif.h.

Member Data Documentation

◆ m_bShowToolTip

BOOL CUIFToolTip::m_bShowToolTip
protected

Definition at line 615 of file cicuif.h.

Referenced by HideTip(), and ShowTip().

◆ m_bToolTipHasBkColor

BOOL CUIFToolTip::m_bToolTipHasBkColor
protected

Definition at line 622 of file cicuif.h.

Referenced by CUIFToolTip(), and GetTipBkColor().

◆ m_bToolTipHasTextColor

BOOL CUIFToolTip::m_bToolTipHasTextColor
protected

Definition at line 623 of file cicuif.h.

Referenced by CUIFToolTip(), and GetTipTextColor().

◆ m_cxToolTipWidth

LONG CUIFToolTip::m_cxToolTipWidth
protected

Definition at line 621 of file cicuif.h.

Referenced by CUIFToolTip(), and GetTipWindowSize().

◆ m_dwUnknown10

DWORD CUIFToolTip::m_dwUnknown10
protected

Definition at line 616 of file cicuif.h.

Referenced by CUIFToolTip().

◆ m_nDelayTimeType1

LONG CUIFToolTip::m_nDelayTimeType1
protected

Definition at line 619 of file cicuif.h.

Referenced by CUIFToolTip(), and GetDelayTime().

◆ m_nDelayTimeType2

LONG CUIFToolTip::m_nDelayTimeType2
protected

Definition at line 617 of file cicuif.h.

Referenced by CUIFToolTip(), and GetDelayTime().

◆ m_nDelayTimeType3

LONG CUIFToolTip::m_nDelayTimeType3
protected

Definition at line 618 of file cicuif.h.

Referenced by CUIFToolTip(), and GetDelayTime().

◆ m_pszToolTipText

LPWSTR CUIFToolTip::m_pszToolTipText
protected

Definition at line 614 of file cicuif.h.

Referenced by CUIFToolTip(), GetTipWindowSize(), HideTip(), ShowTip(), and ~CUIFToolTip().

◆ m_pToolTipOwner

CUIFWindow* CUIFToolTip::m_pToolTipOwner
protected

Definition at line 612 of file cicuif.h.

Referenced by CUIFToolTip(), FindObject(), and ~CUIFToolTip().

◆ m_pToolTipTarget

CUIFObject* CUIFToolTip::m_pToolTipTarget
protected

Definition at line 613 of file cicuif.h.

Referenced by CUIFToolTip(), HideTip(), RelayEvent(), ShowTip(), and CUIFObject::~CUIFObject().

◆ m_rcToolTipMargin

RECT CUIFToolTip::m_rcToolTipMargin
protected

Definition at line 620 of file cicuif.h.

Referenced by CUIFToolTip(), and GetMargin().

◆ m_rgbToolTipBkColor

COLORREF CUIFToolTip::m_rgbToolTipBkColor
protected

Definition at line 624 of file cicuif.h.

Referenced by CUIFToolTip(), and GetTipBkColor().

◆ m_rgbToolTipTextColor

COLORREF CUIFToolTip::m_rgbToolTipTextColor
protected

Definition at line 625 of file cicuif.h.

Referenced by CUIFToolTip(), and GetTipTextColor().


The documentation for this class was generated from the following files: