diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-16 16:38:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-21 09:57:58 +0100 |
commit | fa8c85fa90e9565a357b247a69f930098d11ff84 (patch) | |
tree | d14cb6db4faa840ae23b435bbdcd3ff5987c3f44 /vcl/source | |
parent | 9394ad31fb9c325001c97702feda317d61f1cbbb (diff) |
weld gallery panel
Change-Id: I4aebb3f90e9943044d106a507972c39434988f03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87003
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/customweld.cxx | 5 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 12 |
3 files changed, 31 insertions, 0 deletions
diff --git a/vcl/source/app/customweld.cxx b/vcl/source/app/customweld.cxx index d6465ff289f5..07dc7935b198 100644 --- a/vcl/source/app/customweld.cxx +++ b/vcl/source/app/customweld.cxx @@ -13,6 +13,11 @@ namespace weld { CustomWidgetController::~CustomWidgetController() {} +IMPL_LINK_NOARG(CustomWidgetController, DragBeginHdl, weld::DrawingArea&, bool) +{ + return StartDrag(); +} + CustomWeld::CustomWeld(weld::Builder& rBuilder, const OString& rDrawingId, CustomWidgetController& rWidgetController) : m_rWidgetController(rWidgetController) diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 3b6697755bf0..a8f90b24afdd 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5711,6 +5711,7 @@ private: DECL_LINK(StyleUpdatedHdl, VclDrawingArea&, void); DECL_LINK(CommandHdl, const CommandEvent&, bool); DECL_LINK(QueryTooltipHdl, tools::Rectangle&, OUString); + DECL_LINK(StartDragHdl, VclDrawingArea*, bool); // SalInstanceWidget has a generic listener for all these // events, ignore the ones we have specializations for @@ -5757,6 +5758,7 @@ public: m_xDrawingArea->SetStyleUpdatedHdl(LINK(this, SalInstanceDrawingArea, StyleUpdatedHdl)); m_xDrawingArea->SetCommandHdl(LINK(this, SalInstanceDrawingArea, CommandHdl)); m_xDrawingArea->SetQueryTooltipHdl(LINK(this, SalInstanceDrawingArea, QueryTooltipHdl)); + m_xDrawingArea->SetStartDragHdl(LINK(this, SalInstanceDrawingArea, StartDragHdl)); } virtual void queue_draw() override @@ -5830,6 +5832,11 @@ public: return m_xDrawingArea->OutputToAbsoluteScreenPixel(Point()); } + virtual void enable_drag_source(rtl::Reference<TransferDataContainer>& rHelper, sal_uInt8 eDNDConstants) override + { + m_xDrawingArea->SetDragHelper(rHelper, eDNDConstants); + } + virtual ~SalInstanceDrawingArea() override { m_xDrawingArea->SetQueryTooltipHdl(Link<tools::Rectangle&, OUString>()); @@ -5905,6 +5912,13 @@ IMPL_LINK(SalInstanceDrawingArea, QueryTooltipHdl, tools::Rectangle&, rHelpArea, return m_aQueryTooltipHdl.Call(rHelpArea); } +IMPL_LINK_NOARG(SalInstanceDrawingArea, StartDragHdl, VclDrawingArea*, bool) +{ + if (m_aDragBeginHdl.Call(*this)) + return true; + return false; +} + namespace { //ComboBox and ListBox have similar apis, ComboBoxes in LibreOffice have an edit box and ListBoxes diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index be8313c12f00..ce8b3379dbc1 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2694,4 +2694,16 @@ bool isLayoutEnabled(const vcl::Window *pWindow) return pChild && isContainerWindow(*pChild) && !pChild->GetWindow(GetWindowType::Next); } +void VclDrawingArea::StartDrag(sal_Int8, const Point&) +{ + if (m_aStartDragHdl.Call(this)) + return; + + rtl::Reference<TransferDataContainer> xContainer = m_xTransferHelper; + if (!m_xTransferHelper.is()) + return; + + xContainer->StartDrag(this, m_nDragAction); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |