Skip to content

Commit

Permalink
Mouse move/release/drag now remembers which mouse (LH/RH) was clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgammon committed Nov 15, 2010
1 parent 7a9202e commit 80c3097
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion miniwindow.cpp
Expand Up @@ -25,7 +25,8 @@ CMiniWindow::CMiniWindow () :
m_bTemporarilyHide (false),
m_last_mouseposition (0, 0),
m_last_mouse_update (0),
m_client_mouseposition (0, 0)
m_client_mouseposition (0, 0),
m_FlagsOnMouseDown (0)
{
dc.CreateCompatibleDC(NULL);
dc.SetTextAlign (TA_LEFT | TA_TOP);
Expand Down
1 change: 1 addition & 0 deletions miniwindow.h
Expand Up @@ -111,6 +111,7 @@ class CMiniWindow

string m_sMouseOverHotspot; // last hotspot we moused over
string m_sMouseDownHotspot; // last hotspot we mouse clicked in
long m_FlagsOnMouseDown; // which mouse-down we got

string m_sCallbackPlugin; // plugin we are using

Expand Down
15 changes: 10 additions & 5 deletions mushview.cpp
Expand Up @@ -6530,7 +6530,8 @@ bool CMUSHView::Mouse_Move_MiniWindow (CMUSHclientDoc* pDoc, CPoint point)
Send_Mouse_Event_To_Plugin (it->second->m_dispid_MoveCallback,
prev_mw->m_sCallbackPlugin,
it->second->m_sMoveCallback,
prev_mw->m_sMouseDownHotspot);
prev_mw->m_sMouseDownHotspot,
prev_mw->m_FlagsOnMouseDown);
return true; // that's all

} // we had previous hotspot
Expand Down Expand Up @@ -6724,6 +6725,7 @@ bool CMUSHView::Mouse_Down_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long
if (pHotspot)
{
mw->m_sMouseDownHotspot = sHotspotId; // remember this is mousedown hotspot
mw->m_FlagsOnMouseDown = flags & 0x70; // remember mouse flags

Send_Mouse_Event_To_Plugin (pHotspot->m_dispid_MouseDown,
mw->m_sCallbackPlugin,
Expand Down Expand Up @@ -6782,7 +6784,8 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
Send_Mouse_Event_To_Plugin (it->second->m_dispid_ReleaseCallback,
prev_mw->m_sCallbackPlugin,
it->second->m_sReleaseCallback,
prev_mw->m_sMouseDownHotspot);
prev_mw->m_sMouseDownHotspot,
prev_mw->m_FlagsOnMouseDown);

} // we had previous hotspot

Expand Down Expand Up @@ -6826,7 +6829,8 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
Send_Mouse_Event_To_Plugin (it->second->m_dispid_CancelMouseDown,
old_mw->m_sCallbackPlugin,
it->second->m_sCancelMouseDown,
old_mw->m_sMouseDownHotspot);
old_mw->m_sMouseDownHotspot,
old_mw->m_FlagsOnMouseDown);
old_mw->m_sMouseDownHotspot.erase (); // no mouse-down right now
} // we had previous hotspot

Expand Down Expand Up @@ -6859,7 +6863,8 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
Send_Mouse_Event_To_Plugin (it->second->m_dispid_CancelMouseDown,
mw->m_sCallbackPlugin,
it->second->m_sCancelMouseDown,
mw->m_sMouseDownHotspot);
mw->m_sMouseDownHotspot,
mw->m_FlagsOnMouseDown);

mw->m_sMouseDownHotspot.erase (); // no mouse-down right now
} // previous one which isn't this one, or we are no longer on one
Expand All @@ -6871,7 +6876,7 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
mw->m_sCallbackPlugin,
pHotspot->m_sMouseUp,
sHotspotId,
flags); // LH / RH mouse?
mw->m_FlagsOnMouseDown); // LH / RH mouse?

mw->m_sMouseDownHotspot.erase (); // no mouse-down right now
}
Expand Down
2 changes: 1 addition & 1 deletion resource.h
Expand Up @@ -1562,7 +1562,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 365
#define _APS_NEXT_RESOURCE_VALUE 366
#define _APS_NEXT_COMMAND_VALUE 33054
#define _APS_NEXT_CONTROL_VALUE 2897
#define _APS_NEXT_SYMED_VALUE 312
Expand Down

0 comments on commit 80c3097

Please sign in to comment.