46 #include <wx/settings.h>
47 #include <wx/window.h>
53 #define TTMGR_TIMER_ID 62210
54 #define TTMGR_TIMER_CLEAR_UNPINNED 62211
56 #if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__)
57 std::vector<std::pair<wxWindow*,IStickyTooltipHandlerHost::CWindowRef> >
58 IStickyTooltipHandlerHost::sm_Windows;
62 #if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__)
63 : m_TipGroupWinRef(
NULL)
66 m_ServiceLocator =
NULL;
85 f =
dynamic_cast<wxFrame*
>(p);
94 if( (ff!=
NULL) && (
f!=ff) ){
104 if(
f ==
NULL )
return false;
114 #if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__)
150 #if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__)
156 std::vector<std::pair<wxWindow*,CWindowRef> >::iterator iter;
158 WindowGroupRef view_ref;
159 WindowGroupRef top_ref;
161 for (iter=sm_Windows.begin(); iter != sm_Windows.end(); ++iter) {
162 if ( (*iter).first == (wxWindow*)
f ) {
169 if (iter != sm_Windows.end()) {
170 m_TipGroupWinRef = (*iter).second.m_Ref;
174 WindowGroupRef group_class =
NULL;
176 group_class = GetWindowGroupOfClass(kFloatingWindowClass);
180 group_class = GetWindowGroupOfClass(kDocumentWindowClass);
185 CreateWindowGroup( kWindowGroupAttrSelectAsLayer |
186 kWindowGroupAttrHideOnCollapse, &m_TipGroupWinRef );
187 CreateWindowGroup( kWindowGroupAttrSelectAsLayer|
188 kWindowGroupAttrHideOnCollapse, &view_ref );
189 CreateWindowGroup( kWindowGroupAttrSelectAsLayer |
190 kWindowGroupAttrHideOnCollapse, &top_ref );
192 SetWindowGroupParent(m_TipGroupWinRef, top_ref);
193 SetWindowGroupParent(view_ref, m_TipGroupWinRef);
194 SetWindowGroupParent(top_ref, group_class);
196 SetWindowGroup((WindowRef)
f->MacGetTopLevelWindowRef(), view_ref);
198 sm_Windows.push_back(std::pair<wxWindow*, CWindowRef>((wxWindow*)
f,CWindowRef(m_TipGroupWinRef, dock_count)));
234 , m_UnpinnedTip(
NULL)
239 , m_MouseMoveThreshold(2.0
f)
240 , m_UnpinnedMouseMoveThreshold(4.0
f)
241 , m_ClearUnpinnedDelay(250)
242 , m_PopupDistance(0.22
f)
245 #if defined(NCBI_OS_MSWIN)
246 , m_TipPopupDelay(500)
247 #elif defined(NCBI_OS_MAC)
248 , m_TipPopupDelay(1000)
249 #elif defined(NCBI_OS_UNIX)
251 , m_TipPopupDelay(500)
254 , m_TipPopupDelay(500)
288 static bool initialized =
false;
302 std::vector<CTooltipFrame*>::iterator iter;
328 wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED,
eCmdTipAdded);
347 std::vector<CTooltipFrame*>::iterator iter;
357 (*iter)->SetPinned(
false);
374 std::vector<CTooltipFrame*>::iterator iter;
378 (*iter)->UpdateScreenPosition(screen_pos);
386 std::vector<CTooltipFrame*>::iterator iter;
387 wxRect combined_rect;
397 (*iter)->FitToWindow(
true);
400 combined_rect.Union((*iter)->GetRect());
415 wxRect combined_rect;
418 std::vector<CTooltipFrame*>::iterator iter;
420 (*iter)->FitToWindow();
421 combined_rect.Union((*iter)->GetRect());
432 wxPoint m = wxGetMousePosition();
445 std::vector<CTooltipFrame*>::iterator iter;
451 wxWindow::GetCapture() !=
NULL)
499 bool has_focus =
false;
501 wxWindow* focus_win = wxWindow::FindFocus();
503 if (focus_win ==
NULL) {
513 while (!has_focus && !top) {
514 if (focus_win == w) {
519 wxString(w->GetClassInfo()->GetClassName()) ==
wxT(
"CFloatingFrame"))
548 wxRect
r = (*iter)->GetScreenRect();
549 if (
r.Contains(m) && (*iter)->IsShown()) {
552 #ifdef __WXOSX_COCOA__
565 wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED,
eCmdTipActive);
600 std::vector<CTooltipFrame*>::iterator iter;
625 ,(*iter)->GetParent()->GetScreenPosition() + (*iter)->GetPos()
627 ,(*iter)->GetTipInfo()
628 #
if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__)
633 tt->
Show(is_visible);
638 wxCommandEvent dummy_event;
671 wxCommandEvent evt2(wxEVT_COMMAND_BUTTON_CLICKED,
eCmdTipRemoved);
696 wxPoint p = wxGetMousePosition();
702 if (!screen_rect.Contains(p))
711 wxWindow* mouse_win = ::wxFindWindowAtPointer(unused_pt);
741 int cursor_y = wxSystemSettings::GetMetric(wxSYS_CURSOR_Y);
742 int cursor_x = wxSystemSettings::GetMetric(wxSYS_CURSOR_X);
744 if (p.y + cursor_y/3 > screen_rect.GetBottom())
746 if (p.x + cursor_x/3 > screen_rect.GetRight())
750 ,
wxT(
"wxWidgets Child Frame")
751 #
if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__) || defined(__WXOSX_COCOA__)
752 ,wxPoint(p.x+4,p.y+4)
759 #
if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__)
795 wxPoint m = wxGetMousePosition();
811 bool tip_displayed =
false;
815 if (
m_ToolTips[
i]->GetTipInfo().GetTipID() == need_id) {
816 tip_displayed =
true;
826 if (!tip_displayed &&
872 wxPoint p = wxGetMousePosition();
873 if (screen_rect.Contains(p)) {
891 wxEvtHandler* obj =
dynamic_cast<wxEvtHandler*
>(
event.GetEventObject());
904 f->OnPinButton(event);
927 wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED,
eCmdTipActive);
969 #if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__)
972 while (w !=
NULL && shown) {
1002 if (checkwin==fwin)
return true;
1003 for (
unsigned int i=0;
i<checkwin->GetChildren().
size(); ++
i) {
1014 std::vector<IStickyTooltipHandlerHost::TipLocation> tips;
1016 std::vector<CTooltipFrame*> tip_windows =
m_ToolTips;
1020 for (
size_t i=0;
i<tip_windows.size(); ++
i) {
1021 wxPoint pos = tip_windows[
i]->GetPos();
1022 wxSize sz = tip_windows[
i]->GetSize();
1028 win_sz.GetHeight() - (pos.y + sz.GetHeight()),
1029 pos.x + sz.GetWidth(),
1030 win_sz.GetHeight()-pos.y);
1031 tl.
TipID = tip_windows[
i]->GetTipInfo().GetTipID();
CUICommandRegistry is a centralized registry where all application commands should be registered.
static CUICommandRegistry & GetInstance()
the main instance associated with the application
int RegisterCommand(CUICommand *cmd)
assumes ownership of the given object returns a command id (useful when registry is used for auto id ...
IWindowManagerService Window Manager Service provides access to Window Manager functionality.
GUI command routing and handling framework.
#define NCBI_CATCH(message)
Catch CExceptions as well This macro is deprecated - use *_X or *_XX variant instead of it.
virtual void RaiseFloatingWindowsInZOrder()=0
Raise all floating windows to preserve/refresh z-order.
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
virtual bool IsDragging() const =0
Returns true if a drag operation is currently in progress.
@ eCmdParentHide
tool tip parent window shown
@ eCmdReleaseTip
User clicked somewhere on a tip.
@ eCmdCopySelectedTipText
User selected option to make text selectable.
@ eCmdMoveTip
Left mouse (or equiv) up inside tip area.
@ eCmdParentActivate
tool tip cmd indicating a main-window docking update
@ eCmdCopyTipText
Mouse left a tip (remove glyph highlight)
@ eCmdSelectTipText
User selected option to copy (all) tip text.
@ eCmdReCreate
tool tip parent window about to dock
@ eCmdTipRemoved
Event fired when a new tip added.
@ eCmdSuspend
tool tip window parent moves
@ eCmdParentShow
tool tip parent window activated
@ eCmdTipActive
User is interactively moving a tool tip.
@ eCmdTipAdded
Copy currently selected tip text to clipboard.
@ eCmdDockMainWindow
tool tip parent window finished docking
@ eCmdTipInactive
Mouse entered a tip (highlight matching glyph)
@ eCmdPinTip
tool tip parent window hidden
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const struct ncbi::grid::netcache::search::fields::SIZE size
NCBI C++ auxiliary debug macros.
Int4 delta(size_t dimension_, const Int4 *score_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)