summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/salvtables.hxx6
-rw-r--r--vcl/jsdialog/executor.cxx26
-rw-r--r--vcl/source/app/salvtables.cxx18
3 files changed, 40 insertions, 10 deletions
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index bd462ad56ccd..cbb9fce51eee 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1341,6 +1341,12 @@ public:
virtual void click(const Point& rPos) override;
virtual void dblclick(const Point& rPos) override;
+
+ virtual void mouse_up(const Point& rPos) override;
+
+ virtual void mouse_down(const Point& rPos) override;
+
+ virtual void mouse_move(const Point& rPos) override;
};
class SalInstanceToolbar : public SalInstanceWidget, public virtual weld::Toolbar
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index cb8dfa4d455c..eb11af9b2884 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -192,7 +192,8 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap
auto pArea = dynamic_cast<weld::DrawingArea*>(pWidget);
if (pArea)
{
- if (sAction == "click" || sAction == "dblclick")
+ if (sAction == "click" || sAction == "dblclick" || sAction == "mousemove"
+ || sAction == "mousedown" || sAction == "mouseup")
{
OUString sClickData = rData["data"];
int nSeparatorPos = sClickData.indexOf(';');
@@ -205,23 +206,28 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap
if (nClickPosX.empty() || nClickPosY.empty())
return true;
- double posX = o3tl::toDouble(nClickPosX);
- double posY = o3tl::toDouble(nClickPosY);
+ double fPosX = o3tl::toDouble(nClickPosX);
+ double fPosY = o3tl::toDouble(nClickPosY);
OutputDevice& rRefDevice = pArea->get_ref_device();
// We send OutPutSize for the drawing area bitmap
// get_size_request is not necessarily updated
// therefore it may be incorrect.
Size size = rRefDevice.GetOutputSizePixel();
- posX = posX * size.Width();
- posY = posY * size.Height();
+ fPosX = fPosX * size.Width();
+ fPosY = fPosY * size.Height();
+
if (sAction == "click")
- LOKTrigger::trigger_click(*pArea, Point(posX, posY));
- else
- LOKTrigger::trigger_dblclick(*pArea, Point(posX, posY));
- return true;
+ LOKTrigger::trigger_click(*pArea, Point(fPosX, fPosY));
+ else if (sAction == "dblclick")
+ LOKTrigger::trigger_dblclick(*pArea, Point(fPosX, fPosY));
+ else if (sAction == "mouseup")
+ LOKTrigger::trigger_mouse_up(*pArea, Point(fPosX, fPosY));
+ else if (sAction == "mousedown")
+ LOKTrigger::trigger_mouse_down(*pArea, Point(fPosX, fPosY));
+ else if (sAction == "mousemove")
+ LOKTrigger::trigger_mouse_move(*pArea, Point(fPosX, fPosY));
}
- LOKTrigger::trigger_click(*pArea, Point(10, 10));
return true;
}
else if (sAction == "keypress")
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 3e13d215f2cb..0b818bf2f5f4 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6348,6 +6348,24 @@ void SalInstanceDrawingArea::dblclick(const Point& rPos)
m_xDrawingArea->MouseButtonUp(aEvent);
}
+void SalInstanceDrawingArea::mouse_up(const Point& rPos)
+{
+ MouseEvent aEvent(rPos, 0, MouseEventModifiers::NONE, MOUSE_LEFT, 0);
+ m_xDrawingArea->MouseButtonUp(aEvent);
+}
+
+void SalInstanceDrawingArea::mouse_down(const Point& rPos)
+{
+ MouseEvent aEvent(rPos, 0, MouseEventModifiers::NONE, MOUSE_LEFT, 0);
+ m_xDrawingArea->MouseButtonDown(aEvent);
+}
+
+void SalInstanceDrawingArea::mouse_move(const Point& rPos)
+{
+ MouseEvent aEvent(rPos, 0, MouseEventModifiers::NONE, MOUSE_LEFT, 0);
+ m_xDrawingArea->MouseMove(aEvent);
+}
+
IMPL_LINK(SalInstanceDrawingArea, PaintHdl, target_and_area, aPayload, void)
{
m_aDrawHdl.Call(aPayload);