foobar2000 SDK  2015-01-14
Public Member Functions | Private Member Functions | Private Attributes
CPopupTooltipMessage

#include <misc.h>

Public Member Functions

 CPopupTooltipMessage (DWORD style=TTS_BALLOON|TTS_NOPREFIX)
 
void CleanUp ()
 
void Hide ()
 
void Show (const TCHAR *message, CWindow wndParent)
 
void ShowEx (const TCHAR *message, CWindow wndParent, CRect rect)
 
void ShowFocus (const TCHAR *message, CWindow wndParent)
 
void ShutDown ()
 

Private Member Functions

void Initialize ()
 
void ShowInternal (const TCHAR *message, CWindow wndParent, CRect rect)
 

Private Attributes

bool m_shutDown
 
const DWORD m_style
 
TOOLINFO m_toolinfo
 
CContainedWindowSimpleT< CToolTipCtrl > m_tooltip
 

Detailed Description

Definition at line 361 of file misc.h.

Constructor & Destructor Documentation

CPopupTooltipMessage::CPopupTooltipMessage ( DWORD  style = TTS_BALLOON | TTS_NOPREFIX)
inline

Definition at line 363 of file misc.h.

363 : m_style(style | WS_POPUP), m_toolinfo(), m_shutDown() {}
const DWORD m_style
Definition: misc.h:422
TOOLINFO m_toolinfo
Definition: misc.h:421

Member Function Documentation

void CPopupTooltipMessage::CleanUp ( )
inline

Definition at line 391 of file misc.h.

391  {
392  if (m_tooltip.m_hWnd != NULL) {
393  m_tooltip.DestroyWindow();
394  }
395  }
CContainedWindowSimpleT< CToolTipCtrl > m_tooltip
Definition: misc.h:420
void CPopupTooltipMessage::Hide ( )
inline

Definition at line 384 of file misc.h.

384  {
385  if (m_tooltip.m_hWnd != NULL && m_tooltip.GetToolCount() > 0) {
386  m_tooltip.TrackActivate(&m_toolinfo,FALSE);
387  m_tooltip.DelTool(&m_toolinfo);
388  }
389  }
CContainedWindowSimpleT< CToolTipCtrl > m_tooltip
Definition: misc.h:420
TOOLINFO m_toolinfo
Definition: misc.h:421
void CPopupTooltipMessage::Initialize ( )
inlineprivate

Definition at line 415 of file misc.h.

415  {
416  if (m_tooltip.m_hWnd == NULL) {
417  WIN32_OP( m_tooltip.Create( NULL , NULL, NULL, m_style) );
418  }
419  }
const DWORD m_style
Definition: misc.h:422
CContainedWindowSimpleT< CToolTipCtrl > m_tooltip
Definition: misc.h:420
void CPopupTooltipMessage::Show ( const TCHAR *  message,
CWindow  wndParent 
)
inline

Definition at line 367 of file misc.h.

367  {
368  if (m_shutDown || (message == NULL && m_tooltip.m_hWnd == NULL)) return;
369  Initialize();
370  Hide();
371 
372  if (message != NULL) {
373  CRect rect;
374  WIN32_OP_D( wndParent.GetWindowRect(rect) );
375  ShowInternal(message, wndParent, rect);
376  }
377  }
void ShowInternal(const TCHAR *message, CWindow wndParent, CRect rect)
Definition: misc.h:400
CContainedWindowSimpleT< CToolTipCtrl > m_tooltip
Definition: misc.h:420
void Initialize()
Definition: misc.h:415
void CPopupTooltipMessage::ShowEx ( const TCHAR *  message,
CWindow  wndParent,
CRect  rect 
)
inline

Definition at line 378 of file misc.h.

378  {
379  if (m_shutDown) return;
380  Initialize();
381  Hide();
382  ShowInternal(message, wndParent, rect);
383  }
void ShowInternal(const TCHAR *message, CWindow wndParent, CRect rect)
Definition: misc.h:400
void Initialize()
Definition: misc.h:415
void CPopupTooltipMessage::ShowFocus ( const TCHAR *  message,
CWindow  wndParent 
)
inline

Definition at line 364 of file misc.h.

364  {
365  Show(message, wndParent); wndParent.SetFocus();
366  }
void Show(const TCHAR *message, CWindow wndParent)
Definition: misc.h:367
void CPopupTooltipMessage::ShowInternal ( const TCHAR *  message,
CWindow  wndParent,
CRect  rect 
)
inlineprivate

Definition at line 400 of file misc.h.

400  {
401  PFC_ASSERT( !m_shutDown );
402  PFC_ASSERT( message != NULL );
403  PFC_ASSERT( wndParent != NULL );
404  m_toolinfo.cbSize = sizeof(m_toolinfo);
405  m_toolinfo.uFlags = TTF_TRACK|TTF_IDISHWND|TTF_ABSOLUTE|TTF_TRANSPARENT|TTF_CENTERTIP;
406  m_toolinfo.hwnd = wndParent;
407  m_toolinfo.uId = 0;
408  m_toolinfo.lpszText = const_cast<TCHAR*>(message);
409  m_toolinfo.hinst = NULL; //core_api::get_my_instance();
410  if (m_tooltip.AddTool(&m_toolinfo)) {
411  m_tooltip.TrackPosition(rect.CenterPoint().x,rect.bottom);
412  m_tooltip.TrackActivate(&m_toolinfo,TRUE);
413  }
414  }
CContainedWindowSimpleT< CToolTipCtrl > m_tooltip
Definition: misc.h:420
TOOLINFO m_toolinfo
Definition: misc.h:421
void CPopupTooltipMessage::ShutDown ( )
inline

Definition at line 396 of file misc.h.

396  {
397  m_shutDown = true; CleanUp();
398  }
void CleanUp()
Definition: misc.h:391

Field Documentation

bool CPopupTooltipMessage::m_shutDown
private

Definition at line 423 of file misc.h.

const DWORD CPopupTooltipMessage::m_style
private

Definition at line 422 of file misc.h.

TOOLINFO CPopupTooltipMessage::m_toolinfo
private

Definition at line 421 of file misc.h.

CContainedWindowSimpleT<CToolTipCtrl> CPopupTooltipMessage::m_tooltip
private

Definition at line 420 of file misc.h.


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