summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-05-12 08:28:36 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-05-12 09:03:00 +0200
commita2576b2d43684c54a9270ce93b5a721296faf8da (patch)
tree18ea13b8dec61b727a90fdfb3f3d934196b59aeb /sc/source/ui/view/gridwin.cxx
parent859363d2a0958e3da3a65c208bcabe65ce508f23 (diff)
send mouse events to the OpenGL window
No idea why the events are send to ScgridWindow but this hack works for now. It is not perfect and surely not beautiful but does work. Change-Id: If620e471083d34004ee877a25f8731d7b4212f3c
Diffstat (limited to 'sc/source/ui/view/gridwin.cxx')
-rw-r--r--sc/source/ui/view/gridwin.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 2082d8d343a7..95ce9fd30263 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1636,6 +1636,33 @@ bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, bool bAction )
void ScGridWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
+ if(!maChildWindows.empty())
+ {
+ const Point& rPos = rMEvt.GetPosPixel();
+ for(boost::ptr_vector<Window>::iterator itr = maChildWindows.begin(),
+ itrEnd = maChildWindows.end(); itr != itrEnd; ++itr)
+ {
+ Point aPoint = itr->GetPosPixel();
+ Size aSize = itr->GetSizePixel();
+
+ if(rPos.X() >= aPoint.X() && rPos.X() <= (aPoint.X() + aSize.Width())
+ && rPos.Y() >= aPoint.Y() && rPos.Y() <= (aPoint.Y() + aSize.Height()))
+ {
+ // we found a mouse event for the child window
+ // we need to recalculate the position based on the child window
+
+ Point aNewPos = rPos - aPoint;
+ sal_uInt16 nClicks = rMEvt.GetClicks();
+ sal_uInt16 nMode = rMEvt.GetMode();
+ sal_uInt16 nButtons = rMEvt.GetButtons();
+ sal_uInt16 nModifier = rMEvt.GetModifier();
+
+ MouseEvent aEvent(aNewPos, nClicks, nMode, nButtons, nModifier);
+ itr->MouseButtonDown(aEvent);
+ return;
+ }
+ }
+ }
nNestedButtonState = SC_NESTEDBUTTON_DOWN;
MouseEventState aState;