NCBI C++ ToolKit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CStickyTooltipHandler Class Reference

Search Toolkit Book for CStickyTooltipHandler

CStickyTooltipHandler : Class that manages all the tooltips for a specific window. More...

#include <gui/widgets/wx/sticky_tooltip_handler.hpp>

+ Inheritance diagram for CStickyTooltipHandler:
+ Collaboration diagram for CStickyTooltipHandler:

Public Member Functions

 CStickyTooltipHandler ()
 
virtual ~CStickyTooltipHandler ()
 
virtual void SetHost (IStickyTooltipHandlerHost *host)
 
virtual void AddTip (CTooltipFrame *tt)
 Add tool tip to current window. More...
 
virtual void AddUnpinned (CTooltipFrame *tt)
 Add an unpinned tip to the window. More...
 
virtual void PinUnpinned (CTooltipFrame *tt)
 Take the current upinned tip and pin it (add it to m_ToolTips) More...
 
virtual void UnpinPinned (CTooltipFrame *tt)
 Remove a tip from m_ToolTips, and set m_UnpinnedTip to the tip. More...
 
virtual void ClearUnpinned ()
 Delete the current unpinned tip (if any) More...
 
virtual void ParentMove (const wxPoint &screen_pos)
 Move all the tooltip windows along with the parent. More...
 
virtual void ParentShow (bool show)
 Called when parent is unhidden to show all tips. More...
 
virtual void Resize ()
 Clips all tip windows to parent window. More...
 
virtual void OnTimer (wxTimerEvent &event)
 Determines which tip mouse is on (if any) and brings it to front. More...
 
virtual void Suspend ()
 Hides tips and then copies them from m_ToolTips to m_SuspendedTips - called before docking starts. More...
 
virtual void ReCreate (int dock_count=0)
 Recreates suspended tips (old tips are deleted). More...
 
virtual void OnSetFocus ()
 Currently does nothing. More...
 
void CheckForNewTip (wxPoint pos)
 Checks if a new tip should be popped up for the current location. More...
 
void OnMotion (wxMouseEvent &event)
 Commands propogated from parent windows to initiate move, resize, docking (suspend/recreate), hide, and show of current tips. More...
 
void OnRightMouseDown (wxMouseEvent &event)
 
void OnMouseWheel (wxMouseEvent &event)
 
void OnLeaveWindow (wxMouseEvent &event)
 
void OnSize (wxSizeEvent &event)
 
void OnWindowMoveCmd (wxCommandEvent &event)
 
void OnSuspendCmd (wxCommandEvent &event)
 
void OnReCreateCmd (wxCommandEvent &event)
 
void OnMainWindowDockCmd (wxCommandEvent &event)
 
void OnActivateCmd (wxCommandEvent &event)
 
void OnWindowShowCmd (wxCommandEvent &event)
 
void OnWindowHideCmd (wxCommandEvent &event)
 
void OnTipRelease (wxCommandEvent &event)
 
void OnTipMove (wxCommandEvent &event)
 
void OnCloseTip (wxCommandEvent &event)
 Commands from buttons on individual tips. More...
 
void OnPinTip (wxCommandEvent &event)
 
void UpdateTips ()
 Any command that updates tip position should use this to keep the list of user-accessible tip information up-to-date. More...
 
void Notify ()
 
float & GetMoveThreshold ()
 
float & GetUnpinnedMoveThreshold ()
 
intGetClearUnpinnedDelay ()
 
float & GetPopupDistance ()
 
intGetTipPopupDelay ()
 
IGlEventHandler implementaion
virtual void SetPane (CGlPane *pane)
 
virtual wxEvtHandler * GetEvtHandler ()
 
ILinkEventHandler implementaion
virtual bool OnLinkClicked (const wxString &href)
 Invoked when an URL is clicked. More...
 
- Public Member Functions inherited from IGlEventHandler
virtual ~IGlEventHandler ()
 

Static Public Member Functions

static void RegisterCommands ()
 

Protected Member Functions

bool checkChildFocus (wxWindow *fwin, wxWindow *checkwin)
 

Protected Attributes

IStickyTooltipHandlerHostm_Host
 Host window for tips. More...
 
CTooltipFramem_UnpinnedTip
 At a given time, only 1 tip can be unpinned. More...
 
wxPoint m_TipInitPos
 position of mouse when need for new tip indicated More...
 
CTooltipFramem_ActiveTip
 If the mouse pointer is inside the boundries of a tip,that tip is m_ActiveTip. More...
 
wxTimer m_Timer
 Timer to watch mouse and change active tip as mouse moves. More...
 
int m_SuspendCount
 Tracks suspend count for window for debugging. More...
 
wxTimer m_TimerClearUnpinned
 Timer to clear away unpinned tip if mouse starts moving. More...
 
std::vector< CTooltipFrame * > m_ToolTips
 All tooltips for current window (m_Host) More...
 
std::vector< CTooltipFrame * > m_SuspendedTips
 Hidden tooltips (tips are all hidden when window is being (un)docked) More...
 
float m_MouseMoveThreshold
 Mouse move threshold for disabling tip before it pops up. More...
 
float m_UnpinnedMouseMoveThreshold
 Mouse move threshold for disabling tip after it pops up. More...
 
int m_ClearUnpinnedDelay
 When the mouse starts moving after a tip pops up, this is the delay until the tip is removed (mouse must get inside tip before this time) More...
 
float m_PopupDistance
 Distance from tip that the tooltip pops up. More...
 
int m_TipPopupDelay
 Delay between seeing the need for a tip and displaying it. More...
 
CGlPanem_Pane
 

Detailed Description

CStickyTooltipHandler : Class that manages all the tooltips for a specific window.

Primarily it responds to move, size, and dock/undock messages of the hosting window in order to make the tips look as if they are attached to the window. The tooltip windows are toplevel windows just like their hosting windows. This means quite a bit is also done to make sure that the tips always appear in front of their parent window, and never jump in front of another application window that is on top of their parent window. The details of managing this feature are in some cases platform dependent.

Definition at line 241 of file sticky_tooltip_handler.hpp.

Constructor & Destructor Documentation

◆ CStickyTooltipHandler()

CStickyTooltipHandler::CStickyTooltipHandler ( )

Definition at line 232 of file sticky_tooltip_handler.cpp.

◆ ~CStickyTooltipHandler()

CStickyTooltipHandler::~CStickyTooltipHandler ( )
virtual

Member Function Documentation

◆ AddTip()

void CStickyTooltipHandler::AddTip ( CTooltipFrame tt)
virtual

Add tool tip to current window.

Definition at line 300 of file sticky_tooltip_handler.cpp.

References m_Timer, m_ToolTips, and UpdateTips().

Referenced by PinUnpinned(), and ReCreate().

◆ AddUnpinned()

void CStickyTooltipHandler::AddUnpinned ( CTooltipFrame tt)
virtual

Add an unpinned tip to the window.

Since there can be only one, delete the current upinned tip (m_UnpinnedTip) if any.

Definition at line 321 of file sticky_tooltip_handler.cpp.

References ClearUnpinned(), eCmdTipAdded, m_Host, m_UnpinnedTip, IStickyTooltipHandlerHost::TTHH_GetWindow(), and UpdateTips().

Referenced by Notify().

◆ checkChildFocus()

bool CStickyTooltipHandler::checkChildFocus ( wxWindow *  fwin,
wxWindow *  checkwin 
)
protected

Definition at line 999 of file sticky_tooltip_handler.cpp.

References b, i, and ncbi::grid::netcache::search::fields::size.

Referenced by OnTimer().

◆ CheckForNewTip()

void CStickyTooltipHandler::CheckForNewTip ( wxPoint  pos)

◆ ClearUnpinned()

void CStickyTooltipHandler::ClearUnpinned ( )
virtual

◆ GetClearUnpinnedDelay()

int& CStickyTooltipHandler::GetClearUnpinnedDelay ( )
inline

Definition at line 328 of file sticky_tooltip_handler.hpp.

References m_ClearUnpinnedDelay.

◆ GetEvtHandler()

virtual wxEvtHandler* CStickyTooltipHandler::GetEvtHandler ( )
inlinevirtual

Implements IGlEventHandler.

Definition at line 258 of file sticky_tooltip_handler.hpp.

◆ GetMoveThreshold()

float& CStickyTooltipHandler::GetMoveThreshold ( )
inline

Definition at line 326 of file sticky_tooltip_handler.hpp.

References m_MouseMoveThreshold.

◆ GetPopupDistance()

float& CStickyTooltipHandler::GetPopupDistance ( )
inline

Definition at line 329 of file sticky_tooltip_handler.hpp.

References m_PopupDistance.

◆ GetTipPopupDelay()

int& CStickyTooltipHandler::GetTipPopupDelay ( )
inline

Definition at line 330 of file sticky_tooltip_handler.hpp.

References m_TipPopupDelay.

◆ GetUnpinnedMoveThreshold()

float& CStickyTooltipHandler::GetUnpinnedMoveThreshold ( )
inline

Definition at line 327 of file sticky_tooltip_handler.hpp.

References m_UnpinnedMouseMoveThreshold.

◆ Notify()

void CStickyTooltipHandler::Notify ( )

◆ OnActivateCmd()

void CStickyTooltipHandler::OnActivateCmd ( wxCommandEvent &  event)

◆ OnCloseTip()

void CStickyTooltipHandler::OnCloseTip ( wxCommandEvent &  event)

Commands from buttons on individual tips.

◆ OnLeaveWindow()

void CStickyTooltipHandler::OnLeaveWindow ( wxMouseEvent &  event)

◆ OnLinkClicked()

virtual bool CStickyTooltipHandler::OnLinkClicked ( const wxString &  href)
inlinevirtual

Invoked when an URL is clicked.

Parameters
[in]hrefString, containing the HREF value of the tag.
Returns
True if the event was handled, false otherwise.

Implements ILinkEventHandler.

Definition at line 263 of file sticky_tooltip_handler.hpp.

References _ASSERT, m_Host, and IStickyTooltipHandlerHost::TTHH_ProcessURL().

◆ OnMainWindowDockCmd()

void CStickyTooltipHandler::OnMainWindowDockCmd ( wxCommandEvent &  event)

Definition at line 955 of file sticky_tooltip_handler.cpp.

References ReCreate().

◆ OnMotion()

void CStickyTooltipHandler::OnMotion ( wxMouseEvent &  event)

Commands propogated from parent windows to initiate move, resize, docking (suspend/recreate), hide, and show of current tips.

Definition at line 838 of file sticky_tooltip_handler.cpp.

References CheckForNewTip().

◆ OnMouseWheel()

void CStickyTooltipHandler::OnMouseWheel ( wxMouseEvent &  event)

Definition at line 857 of file sticky_tooltip_handler.cpp.

References CheckForNewTip().

◆ OnPinTip()

void CStickyTooltipHandler::OnPinTip ( wxCommandEvent &  event)

Definition at line 887 of file sticky_tooltip_handler.cpp.

References f(), NULL, PinUnpinned(), and UnpinPinned().

◆ OnReCreateCmd()

void CStickyTooltipHandler::OnReCreateCmd ( wxCommandEvent &  event)

Definition at line 950 of file sticky_tooltip_handler.cpp.

References ReCreate().

◆ OnRightMouseDown()

void CStickyTooltipHandler::OnRightMouseDown ( wxMouseEvent &  event)

Definition at line 847 of file sticky_tooltip_handler.cpp.

References ClearUnpinned().

◆ OnSetFocus()

void CStickyTooltipHandler::OnSetFocus ( )
virtual

Currently does nothing.

Definition at line 655 of file sticky_tooltip_handler.cpp.

◆ OnSize()

void CStickyTooltipHandler::OnSize ( wxSizeEvent &  event)

Definition at line 684 of file sticky_tooltip_handler.cpp.

References Resize().

◆ OnSuspendCmd()

void CStickyTooltipHandler::OnSuspendCmd ( wxCommandEvent &  event)

Definition at line 945 of file sticky_tooltip_handler.cpp.

References Suspend().

◆ OnTimer()

void CStickyTooltipHandler::OnTimer ( wxTimerEvent &  event)
virtual

◆ OnTipMove()

void CStickyTooltipHandler::OnTipMove ( wxCommandEvent &  event)

◆ OnTipRelease()

void CStickyTooltipHandler::OnTipRelease ( wxCommandEvent &  event)

Definition at line 909 of file sticky_tooltip_handler.cpp.

◆ OnWindowHideCmd()

void CStickyTooltipHandler::OnWindowHideCmd ( wxCommandEvent &  event)

Definition at line 993 of file sticky_tooltip_handler.cpp.

References ParentShow().

◆ OnWindowMoveCmd()

void CStickyTooltipHandler::OnWindowMoveCmd ( wxCommandEvent &  event)

◆ OnWindowShowCmd()

void CStickyTooltipHandler::OnWindowShowCmd ( wxCommandEvent &  event)

Definition at line 988 of file sticky_tooltip_handler.cpp.

References ParentShow().

◆ ParentMove()

void CStickyTooltipHandler::ParentMove ( const wxPoint &  screen_pos)
virtual

Move all the tooltip windows along with the parent.

Definition at line 372 of file sticky_tooltip_handler.cpp.

References m_ToolTips, and UpdateTips().

Referenced by OnWindowMoveCmd(), and Resize().

◆ ParentShow()

void CStickyTooltipHandler::ParentShow ( bool  show)
virtual

Called when parent is unhidden to show all tips.

Definition at line 384 of file sticky_tooltip_handler.cpp.

References ClearUnpinned(), m_Host, m_ToolTips, IStickyTooltipHandlerHost::RaiseOverlappingWindows(), and UpdateTips().

Referenced by OnActivateCmd(), OnWindowHideCmd(), OnWindowShowCmd(), and Suspend().

◆ PinUnpinned()

void CStickyTooltipHandler::PinUnpinned ( CTooltipFrame tt)
virtual

Take the current upinned tip and pin it (add it to m_ToolTips)

Definition at line 335 of file sticky_tooltip_handler.cpp.

References _ASSERT, AddTip(), m_UnpinnedTip, NULL, and CTooltipFrame::SetPinned().

Referenced by OnPinTip().

◆ ReCreate()

void CStickyTooltipHandler::ReCreate ( int  dock_count = 0)
virtual

◆ RegisterCommands()

void CStickyTooltipHandler::RegisterCommands ( )
static

◆ Resize()

void CStickyTooltipHandler::Resize ( void  )
virtual

◆ SetHost()

virtual void CStickyTooltipHandler::SetHost ( IStickyTooltipHandlerHost host)
inlinevirtual

Definition at line 253 of file sticky_tooltip_handler.hpp.

References m_Host.

Referenced by CSeqGraphicPane::CSeqGraphicPane().

◆ SetPane()

virtual void CStickyTooltipHandler::SetPane ( CGlPane pane)
inlinevirtual

Reimplemented from IGlEventHandler.

Definition at line 257 of file sticky_tooltip_handler.hpp.

References m_Pane.

◆ Suspend()

void CStickyTooltipHandler::Suspend ( void  )
virtual

Hides tips and then copies them from m_ToolTips to m_SuspendedTips - called before docking starts.

Definition at line 580 of file sticky_tooltip_handler.cpp.

References ClearUnpinned(), m_ActiveTip, m_SuspendCount, m_SuspendedTips, m_ToolTips, NULL, ParentShow(), and UpdateTips().

Referenced by OnSuspendCmd().

◆ UnpinPinned()

void CStickyTooltipHandler::UnpinPinned ( CTooltipFrame tt)
virtual

Remove a tip from m_ToolTips, and set m_UnpinnedTip to the tip.

Definition at line 345 of file sticky_tooltip_handler.cpp.

References _ASSERT, ClearUnpinned(), eCmdTipInactive, m_ActiveTip, m_Host, m_Timer, m_ToolTips, m_UnpinnedTip, NULL, IStickyTooltipHandlerHost::TTHH_GetWindow(), and UpdateTips().

Referenced by OnPinTip().

◆ UpdateTips()

void CStickyTooltipHandler::UpdateTips ( )

Member Data Documentation

◆ m_ActiveTip

CTooltipFrame* CStickyTooltipHandler::m_ActiveTip
protected

If the mouse pointer is inside the boundries of a tip,that tip is m_ActiveTip.

Otherwise nULL

Definition at line 345 of file sticky_tooltip_handler.hpp.

Referenced by OnTimer(), OnTipMove(), Suspend(), and UnpinPinned().

◆ m_ClearUnpinnedDelay

int CStickyTooltipHandler::m_ClearUnpinnedDelay
protected

When the mouse starts moving after a tip pops up, this is the delay until the tip is removed (mouse must get inside tip before this time)

Definition at line 364 of file sticky_tooltip_handler.hpp.

Referenced by CheckForNewTip(), and GetClearUnpinnedDelay().

◆ m_Host

IStickyTooltipHandlerHost* CStickyTooltipHandler::m_Host
protected

◆ m_MouseMoveThreshold

float CStickyTooltipHandler::m_MouseMoveThreshold
protected

Mouse move threshold for disabling tip before it pops up.

Definition at line 359 of file sticky_tooltip_handler.hpp.

Referenced by GetMoveThreshold(), and Notify().

◆ m_Pane

CGlPane* CStickyTooltipHandler::m_Pane
protected

Definition at line 370 of file sticky_tooltip_handler.hpp.

Referenced by SetPane().

◆ m_PopupDistance

float CStickyTooltipHandler::m_PopupDistance
protected

Distance from tip that the tooltip pops up.

Definition at line 366 of file sticky_tooltip_handler.hpp.

Referenced by GetPopupDistance(), and Notify().

◆ m_SuspendCount

int CStickyTooltipHandler::m_SuspendCount
protected

Tracks suspend count for window for debugging.

Definition at line 349 of file sticky_tooltip_handler.hpp.

Referenced by ReCreate(), and Suspend().

◆ m_SuspendedTips

std::vector<CTooltipFrame*> CStickyTooltipHandler::m_SuspendedTips
protected

Hidden tooltips (tips are all hidden when window is being (un)docked)

Definition at line 356 of file sticky_tooltip_handler.hpp.

Referenced by ReCreate(), Suspend(), and ~CStickyTooltipHandler().

◆ m_Timer

wxTimer CStickyTooltipHandler::m_Timer
protected

Timer to watch mouse and change active tip as mouse moves.

Definition at line 347 of file sticky_tooltip_handler.hpp.

Referenced by AddTip(), UnpinPinned(), and ~CStickyTooltipHandler().

◆ m_TimerClearUnpinned

wxTimer CStickyTooltipHandler::m_TimerClearUnpinned
protected

Timer to clear away unpinned tip if mouse starts moving.

Definition at line 351 of file sticky_tooltip_handler.hpp.

Referenced by CheckForNewTip(), and ClearUnpinned().

◆ m_TipInitPos

wxPoint CStickyTooltipHandler::m_TipInitPos
protected

position of mouse when need for new tip indicated

Definition at line 341 of file sticky_tooltip_handler.hpp.

Referenced by CheckForNewTip(), and Notify().

◆ m_TipPopupDelay

int CStickyTooltipHandler::m_TipPopupDelay
protected

Delay between seeing the need for a tip and displaying it.

Definition at line 368 of file sticky_tooltip_handler.hpp.

Referenced by CheckForNewTip(), and GetTipPopupDelay().

◆ m_ToolTips

std::vector<CTooltipFrame*> CStickyTooltipHandler::m_ToolTips
protected

All tooltips for current window (m_Host)

Definition at line 354 of file sticky_tooltip_handler.hpp.

Referenced by AddTip(), CheckForNewTip(), OnTimer(), ParentMove(), ParentShow(), ReCreate(), Resize(), Suspend(), UnpinPinned(), UpdateTips(), and ~CStickyTooltipHandler().

◆ m_UnpinnedMouseMoveThreshold

float CStickyTooltipHandler::m_UnpinnedMouseMoveThreshold
protected

Mouse move threshold for disabling tip after it pops up.

Definition at line 361 of file sticky_tooltip_handler.hpp.

Referenced by CheckForNewTip(), and GetUnpinnedMoveThreshold().

◆ m_UnpinnedTip

CTooltipFrame* CStickyTooltipHandler::m_UnpinnedTip
protected

At a given time, only 1 tip can be unpinned.

Definition at line 339 of file sticky_tooltip_handler.hpp.

Referenced by AddUnpinned(), CheckForNewTip(), ClearUnpinned(), OnTimer(), PinUnpinned(), UnpinPinned(), UpdateTips(), and ~CStickyTooltipHandler().


The documentation for this class was generated from the following files:
Modified on Fri Apr 12 17:15:29 2024 by modify_doxy.py rev. 669887