NCBI C++ ToolKit
|
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>
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 () |
int & | GetClearUnpinnedDelay () |
float & | GetPopupDistance () |
int & | GetTipPopupDelay () |
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 | |
IStickyTooltipHandlerHost * | m_Host |
Host window for tips. More... | |
CTooltipFrame * | m_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... | |
CTooltipFrame * | m_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... | |
CGlPane * | m_Pane |
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.
CStickyTooltipHandler::CStickyTooltipHandler | ( | ) |
Definition at line 232 of file sticky_tooltip_handler.cpp.
|
virtual |
Definition at line 260 of file sticky_tooltip_handler.cpp.
References i, m_SuspendedTips, m_Timer, m_ToolTips, m_UnpinnedTip, NULL, CTooltipFrame::Show(), and UpdateTips().
|
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().
|
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().
|
protected |
Definition at line 999 of file sticky_tooltip_handler.cpp.
References b, i, and ncbi::grid::netcache::search::fields::size.
Referenced by OnTimer().
void CStickyTooltipHandler::CheckForNewTip | ( | wxPoint | pos | ) |
Checks if a new tip should be popped up for the current location.
Definition at line 782 of file sticky_tooltip_handler.cpp.
References delta(), CTooltipFrame::GetInitialMousePos(), i, m_ClearUnpinnedDelay, m_Host, m_TimerClearUnpinned, m_TipInitPos, m_TipPopupDelay, m_ToolTips, m_UnpinnedMouseMoveThreshold, m_UnpinnedTip, NCBI_CATCH, NULL, and IStickyTooltipHandlerHost::TTHH_NeedTooltip().
Referenced by Notify(), OnMotion(), OnMouseWheel(), and OnTimer().
|
virtual |
Delete the current unpinned tip (if any)
Definition at line 659 of file sticky_tooltip_handler.cpp.
References eCmdTipInactive, eCmdTipRemoved, m_Host, m_TimerClearUnpinned, m_UnpinnedTip, NULL, CTooltipFrame::Show(), IStickyTooltipHandlerHost::TTHH_GetWindow(), and UpdateTips().
Referenced by AddUnpinned(), OnLeaveWindow(), OnRightMouseDown(), OnTimer(), ParentShow(), Suspend(), and UnpinPinned().
|
inline |
Definition at line 328 of file sticky_tooltip_handler.hpp.
References m_ClearUnpinnedDelay.
|
inlinevirtual |
Implements IGlEventHandler.
Definition at line 258 of file sticky_tooltip_handler.hpp.
|
inline |
Definition at line 326 of file sticky_tooltip_handler.hpp.
References m_MouseMoveThreshold.
|
inline |
Definition at line 329 of file sticky_tooltip_handler.hpp.
References m_PopupDistance.
|
inline |
Definition at line 330 of file sticky_tooltip_handler.hpp.
References m_TipPopupDelay.
|
inline |
Definition at line 327 of file sticky_tooltip_handler.hpp.
References m_UnpinnedMouseMoveThreshold.
void CStickyTooltipHandler::Notify | ( | ) |
Definition at line 694 of file sticky_tooltip_handler.cpp.
References AddUnpinned(), CheckForNewTip(), delta(), CTooltipInfo::GetTipID(), m_Host, m_MouseMoveThreshold, m_PopupDistance, m_TipInitPos, CTooltipFrame::SetInitialMousePos(), CTooltipFrame::SetLinkEventHandler(), CTooltipFrame::Show(), IStickyTooltipHandlerHost::TTHH_GetTooltip(), IStickyTooltipHandlerHost::TTHH_GetWindow(), IStickyTooltipHandlerHost::TTHH_PopupMenuDisplayed(), and wxT.
void CStickyTooltipHandler::OnActivateCmd | ( | wxCommandEvent & | event | ) |
Definition at line 963 of file sticky_tooltip_handler.cpp.
References m_Host, NULL, ParentShow(), and IStickyTooltipHandlerHost::TTHH_GetWindow().
void CStickyTooltipHandler::OnCloseTip | ( | wxCommandEvent & | event | ) |
Commands from buttons on individual tips.
void CStickyTooltipHandler::OnLeaveWindow | ( | wxMouseEvent & | event | ) |
Definition at line 865 of file sticky_tooltip_handler.cpp.
References ClearUnpinned(), m_Host, and IStickyTooltipHandlerHost::TTHH_GetWindow().
Invoked when an URL is clicked.
[in] | href | String, containing the HREF value of the tag. |
Implements ILinkEventHandler.
Definition at line 263 of file sticky_tooltip_handler.hpp.
References _ASSERT, m_Host, and IStickyTooltipHandlerHost::TTHH_ProcessURL().
void CStickyTooltipHandler::OnMainWindowDockCmd | ( | wxCommandEvent & | event | ) |
Definition at line 955 of file sticky_tooltip_handler.cpp.
References ReCreate().
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().
void CStickyTooltipHandler::OnMouseWheel | ( | wxMouseEvent & | event | ) |
Definition at line 857 of file sticky_tooltip_handler.cpp.
References CheckForNewTip().
void CStickyTooltipHandler::OnPinTip | ( | wxCommandEvent & | event | ) |
Definition at line 887 of file sticky_tooltip_handler.cpp.
References f, NULL, PinUnpinned(), and UnpinPinned().
void CStickyTooltipHandler::OnReCreateCmd | ( | wxCommandEvent & | event | ) |
Definition at line 950 of file sticky_tooltip_handler.cpp.
References ReCreate().
void CStickyTooltipHandler::OnRightMouseDown | ( | wxMouseEvent & | event | ) |
Definition at line 847 of file sticky_tooltip_handler.cpp.
References ClearUnpinned().
|
virtual |
Currently does nothing.
Definition at line 655 of file sticky_tooltip_handler.cpp.
void CStickyTooltipHandler::OnSize | ( | wxSizeEvent & | event | ) |
Definition at line 684 of file sticky_tooltip_handler.cpp.
References Resize().
void CStickyTooltipHandler::OnSuspendCmd | ( | wxCommandEvent & | event | ) |
Definition at line 945 of file sticky_tooltip_handler.cpp.
References Suspend().
|
virtual |
Determines which tip mouse is on (if any) and brings it to front.
Definition at line 430 of file sticky_tooltip_handler.cpp.
References CTooltipFrame::AddChildWindow(), checkChildFocus(), CheckForNewTip(), ClearUnpinned(), eCmdTipActive, eCmdTipInactive, CTooltipFrame::FitToWindow(), IStickyTooltipHandlerHost::IsDragging(), CTooltipFrame::LaunchedBrowser(), m_ActiveTip, m_Host, m_ToolTips, m_UnpinnedTip, NULL, r(), IStickyTooltipHandlerHost::RaiseOverlappingWindows(), CTooltipFrame::RemoveChildWindow(), CTooltipFrame::SetLaunchedFalse(), CTooltipFrame::SetToDefaultSize(), CTooltipFrame::TipPopupMenuDisplayed(), IStickyTooltipHandlerHost::TTHH_GetWindow(), IStickyTooltipHandlerHost::TTHH_PopupMenuDisplayed(), TTMGR_TIMER_CLEAR_UNPINNED, TTMGR_TIMER_ID, and wxT.
void CStickyTooltipHandler::OnTipMove | ( | wxCommandEvent & | event | ) |
Definition at line 924 of file sticky_tooltip_handler.cpp.
References eCmdTipActive, m_ActiveTip, m_Host, IStickyTooltipHandlerHost::TTHH_GetWindow(), and UpdateTips().
void CStickyTooltipHandler::OnTipRelease | ( | wxCommandEvent & | event | ) |
Definition at line 909 of file sticky_tooltip_handler.cpp.
void CStickyTooltipHandler::OnWindowHideCmd | ( | wxCommandEvent & | event | ) |
Definition at line 993 of file sticky_tooltip_handler.cpp.
References ParentShow().
void CStickyTooltipHandler::OnWindowMoveCmd | ( | wxCommandEvent & | event | ) |
Definition at line 932 of file sticky_tooltip_handler.cpp.
References m_Host, ParentMove(), and IStickyTooltipHandlerHost::TTHH_GetWindow().
void CStickyTooltipHandler::OnWindowShowCmd | ( | wxCommandEvent & | event | ) |
Definition at line 988 of file sticky_tooltip_handler.cpp.
References ParentShow().
|
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().
|
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().
|
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().
|
virtual |
Recreates suspended tips (old tips are deleted).
Definition at line 598 of file sticky_tooltip_handler.cpp.
References _ASSERT, AddTip(), CTooltipFrame::FitToWindow(), IStickyTooltipHandlerHost::InitWindowGroup(), m_Host, m_SuspendCount, m_SuspendedTips, m_ToolTips, CTooltipFrame::OnPinButton(), IStickyTooltipHandlerHost::RaiseOverlappingWindows(), CTooltipFrame::SetLinkEventHandler(), CTooltipFrame::SetPinned(), CTooltipFrame::SetTargetSize(), CTooltipFrame::Show(), IStickyTooltipHandlerHost::TTHH_GetWindow(), and UpdateTips().
Referenced by OnMainWindowDockCmd(), and OnReCreateCmd().
|
static |
Definition at line 286 of file sticky_tooltip_handler.cpp.
References eCmdCopySelectedTipText, eCmdCopyTipText, eCmdSelectTipText, CUICommandRegistry::GetInstance(), and CUICommandRegistry::RegisterCommand().
|
virtual |
Clips all tip windows to parent window.
Definition at line 412 of file sticky_tooltip_handler.cpp.
References m_Host, m_ToolTips, ParentMove(), IStickyTooltipHandlerHost::RaiseOverlappingWindows(), IStickyTooltipHandlerHost::TTHH_GetWindow(), and UpdateTips().
Referenced by OnSize().
|
inlinevirtual |
Definition at line 253 of file sticky_tooltip_handler.hpp.
References m_Host.
Referenced by CSeqGraphicPane::CSeqGraphicPane().
|
inlinevirtual |
Reimplemented from IGlEventHandler.
Definition at line 257 of file sticky_tooltip_handler.hpp.
References m_Pane.
|
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().
|
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().
void CStickyTooltipHandler::UpdateTips | ( | ) |
Any command that updates tip position should use this to keep the list of user-accessible tip information up-to-date.
Definition at line 1011 of file sticky_tooltip_handler.cpp.
References i, CGlRect< T >::Init(), m_Host, m_ToolTips, m_UnpinnedTip, NULL, IStickyTooltipHandlerHost::TipLocation::TipID, IStickyTooltipHandlerHost::TipLocation::TipRect, IStickyTooltipHandlerHost::TTHH_GetWindow(), and IStickyTooltipHandlerHost::x_SetCurrentTips().
Referenced by AddTip(), AddUnpinned(), ClearUnpinned(), OnTipMove(), ParentMove(), ParentShow(), ReCreate(), Resize(), Suspend(), UnpinPinned(), and ~CStickyTooltipHandler().
|
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().
|
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().
|
protected |
Host window for tips.
Definition at line 336 of file sticky_tooltip_handler.hpp.
Referenced by AddUnpinned(), CheckForNewTip(), ClearUnpinned(), Notify(), OnActivateCmd(), OnLeaveWindow(), OnLinkClicked(), OnTimer(), OnTipMove(), OnWindowMoveCmd(), ParentShow(), ReCreate(), Resize(), SetHost(), UnpinPinned(), and UpdateTips().
|
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().
|
protected |
Definition at line 370 of file sticky_tooltip_handler.hpp.
Referenced by SetPane().
|
protected |
Distance from tip that the tooltip pops up.
Definition at line 366 of file sticky_tooltip_handler.hpp.
Referenced by GetPopupDistance(), and Notify().
|
protected |
Tracks suspend count for window for debugging.
Definition at line 349 of file sticky_tooltip_handler.hpp.
Referenced by ReCreate(), and Suspend().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().