diff options
author | Dennis Francis <dennisfrancis.in@gmail.com> | 2016-01-30 17:54:58 +0530 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-03-10 14:45:25 +0000 |
commit | d799daa48987c4fa19696967dd98f690e7b94c4f (patch) | |
tree | 3c1b3266825a8435f91f231d2c33b03d8782fd7e /sc/source/ui/inc | |
parent | 3b0fda641467cc99ef86eb538de02b7bfda8fae0 (diff) |
tdf#97344 : Allow focus change using mouse in autofilter popup
Also modified CycleFocus() to skip controls that are
disabled.
Change-Id: I6d84e0d4aacc719b83c70e92a17f58f1756ff072
Reviewed-on: https://gerrit.libreoffice.org/21922
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/inc')
-rw-r--r-- | sc/source/ui/inc/checklistmenu.hxx | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx index bf8281f90f1b..5f280d8a96ea 100644 --- a/sc/source/ui/inc/checklistmenu.hxx +++ b/sc/source/ui/inc/checklistmenu.hxx @@ -190,9 +190,31 @@ private: VclPtr<ScMenuFloatingWindow> mpParentMenu; }; +class ScCheckListMenuWindow; + +class ScTabStops +{ +private: + typedef std::unordered_map<vcl::Window*, size_t> ControlToPosMap; + ScCheckListMenuWindow* mpMenuWindow; + ControlToPosMap maControlToPos; + std::vector<vcl::Window*> maControls; + size_t mnCurTabStop; +public: + ScTabStops( ScCheckListMenuWindow* mpMenuWin ); + ~ScTabStops(); + void AddTabStop( vcl::Window* pWin ); + void SetTabStop( vcl::Window* pWin ); + void CycleFocus( bool bReverse = false ); + vcl::Window* GetCurrentControl(); + void clear(); +}; + class ScCheckListBox : public SvTreeListBox { SvLBoxButtonData* mpCheckButton; + ScTabStops* mpTabStops; + bool mbSeenMouseButtonDown; void CountCheckedEntries( SvTreeListEntry* pParent, sal_uLong& nCount ) const; void CheckAllChildren( SvTreeListEntry* pEntry, bool bCheck = true ); @@ -210,7 +232,23 @@ class ScCheckListBox : public SvTreeListBox sal_uInt16 GetCheckedEntryCount() const; void ExpandChildren( SvTreeListEntry* pParent ); virtual void KeyInput( const KeyEvent& rKEvt ) override; + virtual void MouseButtonDown(const MouseEvent& rMEvt) override; + virtual void MouseButtonUp(const MouseEvent& rMEvt) override; + void SetTabStopsContainer( ScTabStops* pTabStops ) { mpTabStops = pTabStops; } }; + +class ScSearchEdit : public Edit +{ +private: + ScTabStops* mpTabStops; +public: + ScSearchEdit(Window* pParent) : Edit(pParent) {} + virtual ~ScSearchEdit() {} + + virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; + void SetTabStopsContainer( ScTabStops* pTabStops ) { mpTabStops = pTabStops; } +}; + /** * This class implements a popup window for field button, for quick access * of hide-item list, and possibly more stuff related to field options. @@ -334,7 +372,7 @@ private: DECL_LINK_TYPED( EdModifyHdl, Edit&, void ); private: - VclPtr<Edit> maEdSearch; + VclPtr<ScSearchEdit> maEdSearch; VclPtr<ScCheckListBox> maChecks; VclPtr<TriStateBox> maChkToggleAll; @@ -344,9 +382,6 @@ private: VclPtr<OKButton> maBtnOk; VclPtr<CancelButton> maBtnCancel; - std::vector<VclPtr<vcl::Window> > maTabStopCtrls; - size_t mnCurTabStop; - std::vector<Member> maMembers; std::unique_ptr<ExtendedData> mpExtendedData; std::unique_ptr<Action> mpOKAction; @@ -356,6 +391,7 @@ private: Size maWndSize; /// whole window size. Size maMenuSize; /// size of all menu items combined. TriState mePrevToggleAllState; + ScTabStops maTabStops; }; #endif |