[Libreoffice-commits] .: Branch 'feature/calc-dp-unlimited-fields' - sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Dec 15 19:13:03 PST 2010
sc/source/ui/dbgui/fieldwnd.cxx | 11 +++++++++++
sc/source/ui/inc/fieldwnd.hxx | 18 +++++++++++++++++-
2 files changed, 28 insertions(+), 1 deletion(-)
New commits:
commit f9d6a0014cd41a915f31841c7251177ee8b21e31
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Wed Dec 15 22:11:42 2010 -0500
Wrapper class for the normal scroll bar class.
We need to only to pass the mouse wheel events to its parent control
in order to have them handled properly while the mouse cursor is
over the scroll bar control. For some reason the normal scroll bar
does not handle mouse wheel events natively.
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index a96af6d..c0a0998 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -51,6 +51,17 @@ using ::com::sun::star::accessibility::XAccessible;
const size_t INVALID_INDEX = static_cast<size_t>(-1);
+ScDPFieldControlBase::ScrollBar::ScrollBar(Window* pParent, WinBits nStyle) :
+ ::ScrollBar(pParent, nStyle),
+ mpParent(pParent)
+{
+}
+
+void ScDPFieldControlBase::ScrollBar::Command( const CommandEvent& rCEvt )
+{
+ mpParent->Command(rCEvt);
+}
+
ScDPFieldControlBase::ScDPFieldControlBase( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ) :
Control(pParent, rResId),
mpDlg(pParent),
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index a8128fc..bf707ad 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -65,6 +65,22 @@ protected:
typedef ::std::vector<FieldName> FieldNames;
public:
+
+ /**
+ * Custom scroll bar to pass the command event to its parent window.
+ * We need this to pass the mouse wheel events to its parent field
+ * control to have mouse wheel events appaer to be properly handled by the
+ * scroll bar.
+ */
+ class ScrollBar : public ::ScrollBar
+ {
+ public:
+ ScrollBar(Window* pParent, WinBits nStyle);
+ virtual void Command( const CommandEvent& rCEvt );
+ private:
+ Window* mpParent;
+ };
+
ScDPFieldControlBase(
ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption );
virtual ~ScDPFieldControlBase();
@@ -340,7 +356,7 @@ private:
private:
- ScrollBar maScroll;
+ ScDPFieldControlBase::ScrollBar maScroll;
size_t mnColumnBtnCount;
};
More information about the Libreoffice-commits
mailing list