diff options
-rw-r--r-- | include/vcl/treelistbox.hxx | 10 | ||||
-rw-r--r-- | vcl/source/treelist/svimpbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/treelist/treelistbox.cxx | 11 |
3 files changed, 23 insertions, 2 deletions
diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx index 0f47b402dc91..d0fcfabd9e01 100644 --- a/include/vcl/treelistbox.hxx +++ b/include/vcl/treelistbox.hxx @@ -216,7 +216,9 @@ class VCL_DLLPUBLIC SvTreeListBox bool mbContextBmpExpanded; bool mbAlternatingRowColors; bool mbUpdateAlternatingRows; - bool mbQuickSearch; // Enables type-ahead search in the check list box. + bool mbQuickSearch; // Enables type-ahead search in the check list box. + bool mbActivateOnSingleClick; // Make single click "activate" a row like a double-click normally does + bool mbHoverSelection; // Make mouse over a row "select" a row like a single-click normally does SvTreeListEntry* pHdlEntry; @@ -725,6 +727,12 @@ public: // Enables type-ahead search in the check list box. void SetQuickSearch(bool bEnable) { mbQuickSearch = bEnable; } + // Make single click "activate" a row like a double-click normally does + void SetActivateOnSingleClick(bool bEnable) { mbActivateOnSingleClick = bEnable; } + + // Make mouse over a row "select" a row like a single-click normally does + void SetHoverSelection(bool bEnable) { mbHoverSelection = bEnable; } + void SetForceMakeVisible(bool bEnable); virtual FactoryFunction GetUITestFactory() const override; diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index e56932047df0..7ccbb5856f01 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -2099,6 +2099,10 @@ void SvImpLBox::MouseMove( const MouseEvent& rMEvt) if (m_pView->mbHoverSelection) { if (aPos.X() < 0 || aPos.Y() < 0 || aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height()) + pEntry = nullptr; + else + pEntry = GetEntry(aPos); + if (!pEntry) m_pView->SelectAll(false); else if (!m_pView->IsSelected(pEntry) && IsSelectable(pEntry)) m_pView->Select(pEntry); diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index aa56db5b718f..6e3c612093d8 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -369,6 +369,8 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) : mbAlternatingRowColors(false), mbUpdateAlternatingRows(false), mbQuickSearch(false), + mbActivateOnSingleClick(false), + mbHoverSelection(false), eSelMode(SelectionMode::NONE), nMinWidthInChars(0), mbCenterAndClipText(false) @@ -2327,7 +2329,6 @@ void SvTreeListBox::MouseMove( const MouseEvent& rMEvt ) pImpl->MouseMove( rMEvt ); } - void SvTreeListBox::SetUpdateMode( bool bUpdate ) { pImpl->SetUpdateMode( bUpdate ); @@ -3645,6 +3646,14 @@ bool SvTreeListBox::set_property(const OString &rKey, const OUString &rValue) { SetQuickSearch(toBool(rValue)); } + else if (rKey == "activate-on-single-click") + { + SetActivateOnSingleClick(toBool(rValue)); + } + else if (rKey == "hover-selection") + { + SetHoverSelection(toBool(rValue)); + } else if (rKey == "reorderable") { if (toBool(rValue)) |