Kaydet (Commit) 845708fc authored tarafından Miklos Vajna's avatar Miklos Vajna

Add vcl::Window::SetLastMousePos()

This is needed, as e.g. sd::FuText::DoExecute() queries the mouse
position from VCL, which won't be correct in case the mouse event is
generated by a LOK client, not by VCL. So add a method that makes it
possible to set the position before MouseButton*() starts.

Change-Id: I1e24ffb2a4a866c9cac89367907ffaec336ad1f6
üst e900aaeb
...@@ -1013,6 +1013,8 @@ public: ...@@ -1013,6 +1013,8 @@ public:
void SetPointerPosPixel( const Point& rPos ); void SetPointerPosPixel( const Point& rPos );
Point GetPointerPosPixel(); Point GetPointerPosPixel();
Point GetLastPointerPosPixel(); Point GetLastPointerPosPixel();
/// Similar to SetPointerPosPixel(), but sets the frame data's last mouse position instead.
void SetLastMousePos(const Point& rPos);
void ShowPointer( bool bVisible ); void ShowPointer( bool bVisible );
void EnterWait(); void EnterWait();
void LeaveWait(); void LeaveWait();
......
...@@ -532,6 +532,15 @@ void Window::SetPointerPosPixel( const Point& rPos ) ...@@ -532,6 +532,15 @@ void Window::SetPointerPosPixel( const Point& rPos )
mpWindowImpl->mpFrame->SetPointerPos( aPos.X(), aPos.Y() ); mpWindowImpl->mpFrame->SetPointerPos( aPos.X(), aPos.Y() );
} }
void Window::SetLastMousePos(const Point& rPos)
{
// Do this conversion, so when GetPointerPosPixel() calls
// ImplFrameToOutput(), we get back the original position.
Point aPos = ImplOutputToFrame(rPos);
mpWindowImpl->mpFrameData->mnLastMouseX = aPos.X();
mpWindowImpl->mpFrameData->mnLastMouseY = aPos.Y();
}
Point Window::GetPointerPosPixel() Point Window::GetPointerPosPixel()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment