summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-08-28 22:32:36 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-08-29 15:32:58 +0200
commit492462a3e79a3d6577e4b3a543ae059a4850267a (patch)
treeffa79d6ef754107fd0c515663e46b04900f113d7
parent45acf26775ac7e91ceb88d8941cee25c2cd65873 (diff)
handle scroll wheel scrolling in new ListControl
Change-Id: I8dc68b674aabf446c4b949770ae066d41204efc3 Reviewed-on: https://gerrit.libreoffice.org/41680 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--include/svx/listctrl.hxx1
-rw-r--r--svx/source/dialog/listctrl.cxx13
2 files changed, 14 insertions, 0 deletions
diff --git a/include/svx/listctrl.hxx b/include/svx/listctrl.hxx
index 6f303aa7dec9..ac88c7a1e32b 100644
--- a/include/svx/listctrl.hxx
+++ b/include/svx/listctrl.hxx
@@ -48,6 +48,7 @@ public:
virtual Size GetOptimalSize() const override;
virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
virtual void Resize() override;
+ virtual bool EventNotify( NotifyEvent& rNEvt ) override;
DECL_LINK( ScrollHdl, ScrollBar*, void );
};
diff --git a/svx/source/dialog/listctrl.cxx b/svx/source/dialog/listctrl.cxx
index 29a8b14410d3..b1ecaf5b8972 100644
--- a/svx/source/dialog/listctrl.cxx
+++ b/svx/source/dialog/listctrl.cxx
@@ -142,4 +142,17 @@ void ListControl::deleteEntry(sal_uInt32 nPos)
RecalcAll();
}
+bool ListControl::EventNotify( NotifyEvent& rNEvt )
+{
+ if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
+ {
+ const CommandEvent* pEvent = rNEvt.GetCommandEvent();
+ if (pEvent && pEvent->GetCommand() == CommandEventId::Wheel)
+ {
+ HandleScrollCommand(*pEvent, nullptr, mpScrollBar.get());
+ }
+ }
+ return true;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */