Skip to content

Commit 093802f

Browse files
committed
Detect mouseover if mouse is over newly created hotspot
1 parent 504a387 commit 093802f

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

scripting/methods/methods_miniwindows.cpp

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,9 @@ long CMUSHclientDoc::WindowAddHotspot(LPCTSTR Name,
547547
if (m_CurrentPlugin)
548548
sPluginID = m_CurrentPlugin->m_strID;
549549

550-
return it->second->AddHotspot (this,
550+
long status;
551+
552+
status = it->second->AddHotspot (this,
551553
HotspotId,
552554
sPluginID,
553555
Left, Top, Right, Bottom,
@@ -559,6 +561,31 @@ long CMUSHclientDoc::WindowAddHotspot(LPCTSTR Name,
559561
TooltipText,
560562
Cursor,
561563
Flags);
564+
565+
// in mouse was over hotspot when it was created, do a "mouse move" to detect this
566+
if (status == eOK)
567+
{
568+
MiniWindowMapIterator it = m_MiniWindows.find (Name);
569+
if (it != m_MiniWindows.end ())
570+
{
571+
CMiniWindow * mw = it->second;
572+
573+
for(POSITION pos=GetFirstViewPosition();pos!=NULL;)
574+
{
575+
CView* pView = GetNextView(pos);
576+
577+
if (pView->IsKindOf(RUNTIME_CLASS(CMUSHView)))
578+
{
579+
CMUSHView* pmyView = (CMUSHView*)pView;
580+
pmyView->Mouse_Move_MiniWindow (this,
581+
CPoint (mw->m_last_mouseposition.x + mw->m_rect.left, mw->m_last_mouseposition.y + mw->m_rect.top) );
582+
}
583+
} // end of looping through views
584+
} // end of miniwindow still exists
585+
} // end of added hotspot OK
586+
587+
return status;
588+
562589
} // end of CMUSHclientDoc::WindowHotspot
563590

564591
// remove a previously-installed hotspot

0 commit comments

Comments
 (0)