[Libreoffice-commits] core.git: include/vcl svx/source vcl/inc vcl/source vcl/unx

2022-04-15 Thread Caolán McNamara (via logerrit)
 include/vcl/weld.hxx   |3 
 svx/source/tbxctrls/tbunosearchcontrollers.cxx |   29 ---
 vcl/inc/salvtables.hxx |7 +
 vcl/source/app/salvtables.cxx  |   81 ++
 vcl/unx/gtk3/gtkinst.cxx   |   92 +
 5 files changed, 201 insertions(+), 11 deletions(-)

New commits:
commit d1da1c59d196b7f6037b7e0820b81fc527d56a4c
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 20:13:17 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 15 20:44:49 2022 +0200

tdf#148349 add a way to call the user's attention to a widget

Change-Id: I2846155a44f3e51ddd8cc1acd81e84a38b4d3934
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133030
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index bdef5b22b9ca..226e2cb6c21a 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -320,6 +320,9 @@ public:
 
 virtual VclPtr create_virtual_device() const = 0;
 
+//do something transient to attract the attention of the user to the widget
+virtual void call_attention_to() = 0;
+
 //make this widget look like a page in a notebook
 virtual void set_stack_background() = 0;
 //make this widget look like it has a highlighted background
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx 
b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 6deb930c18f2..b168462baf2d 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -295,22 +295,29 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const 
KeyEvent&, rKeyEvent, bool)
 }
 }
 }
-// Select text in the search box when Ctrl-F pressed
-else if ( bMod1 && nCode == KEY_F )
-m_xWidget->select_entry_region(0, -1);
-
-// Execute the search when Ctrl-G, F3 and Shift-RETURN pressed (in 
addition to ActivateHdl condition which handles bare RETURN)
-else if ( (bMod1 && KEY_G == nCode) || (bShift && KEY_RETURN == nCode) || 
(KEY_F3 == nCode) )
-{
-ActivateFind(bShift);
-bRet = true;
-}
 else
 {
 auto awtKey = 
svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyEvent.GetKeyCode());
 const OUString aCommand(m_pAcc->findCommand(awtKey));
-if (aCommand == ".uno:SearchDialog")
+
+// Select text in the search box when Ctrl-F pressed
+if ( bMod1 && nCode == KEY_F )
+m_xWidget->select_entry_region(0, -1);
+// Execute the search when Ctrl-G, F3 and Shift-RETURN pressed (in 
addition to ActivateHdl condition which handles bare RETURN)
+else if ( (bMod1 && KEY_G == nCode) || (bShift && KEY_RETURN == nCode) 
|| (KEY_F3 == nCode) )
+{
+ActivateFind(bShift);
+bRet = true;
+}
+else if (aCommand == ".uno:SearchDialog")
 bRet = m_pAcc->execute(awtKey);
+
+// find-shortcut called with focus already in find
+if (aCommand == "vnd.sun.star.findbar:FocusToFindbar")
+{
+m_xWidget->call_attention_to();
+bRet = true;
+}
 }
 
 return bRet || ChildKeyInput(rKeyEvent);
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 5f8ceb6b9ae3..3f574237444b 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -167,10 +167,13 @@ public:
 virtual ~SalInstanceMenu() override;
 };
 
+class SalFlashAttention;
+
 class SalInstanceWidget : public virtual weld::Widget
 {
 protected:
 VclPtr m_xWidget;
+std::unique_ptr m_xFlashAttention;
 SalInstanceBuilder* m_pBuilder;
 
 private:
@@ -367,6 +370,8 @@ public:
 
 virtual void get_property_tree(tools::JsonWriter& rJsonWriter) override;
 
+virtual void call_attention_to() override;
+
 virtual void set_stack_background() override;
 
 virtual void set_title_background() override;
@@ -1000,6 +1005,8 @@ public:
 
 virtual void HandleEventListener(VclWindowEvent& rEvent) override;
 
+virtual void call_attention_to() override;
+
 virtual ~SalInstanceComboBoxWithEdit() override;
 };
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 263c29ff5eea..a8fdaf2a7978 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -559,6 +559,79 @@ VclPtr 
SalInstanceWidget::create_virtual_device() const
  DeviceFormat::DEFAULT);
 }
 
+class SalFlashAttention
+{
+private:
+VclPtr m_xWidget;
+Timer m_aFlashTimer;
+Color m_aOrigControlBackground;
+Wallpaper m_aOrigBackground;
+bool m_bOrigControlBackground;
+int m_nFlashCount;
+
+void SetFlash()
+{
+Color 
aColor(Application::GetSettings().GetStyleSettings().GetHighlightColor());
+m_xWidget->SetControlBackground(aColor);
+}
+
+void ClearFlash()
+{
+if 

[Libreoffice-commits] core.git: include/vcl svx/source vcl/inc vcl/source vcl/unx

2020-05-21 Thread Caolán McNamara (via logerrit)
 include/vcl/weld.hxx   |   10 -
 svx/source/fmcomp/gridcell.cxx |  255 -
 svx/source/inc/gridcell.hxx|   32 -
 vcl/inc/salvtables.hxx |   20 ---
 vcl/source/app/salvtables.cxx  |   82 -
 vcl/unx/gtk3/gtk3gtkinst.cxx   |  150 ++--
 6 files changed, 42 insertions(+), 507 deletions(-)

New commits:
commit 0677d46bcc56c1f6c27b9331662990b38fd452d6
Author: Caolán McNamara 
AuthorDate: Wed May 20 15:22:56 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 21 13:25:38 2020 +0200

FmXListBoxCell doesn't need to implement css::awt::XListBox

FmXListBoxCell implements css::awt::XListBox but none of that functionality 
is
needed locally where it is used to pick a value in a cell when edited
interactively.

As an XInterface a FmXListBoxCell does fall into the
script::XEventAttacherManager attach/detach sink-hole so its very difficult 
to
determine if it (and any of its siblings) really need to implement the 
amount
of uno interfaces they actually implement, so this is a little speculative.

See 
https://ask.libreoffice.org/en/question/152691/how-to-populate-combo-box-within-table-control-in-form/
for an example of the ComboBox interaction case which is similar to this 
ListBox case.

The exotic "multiselection" option definitely isn't shown as an option in 
the property browser
for a listbox column in the table control.

Change-Id: I7bdc351e615c9df708a30e4396f6f352fabaed36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94584
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index d7a9ec278731..fd734309d6a9 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -749,16 +749,6 @@ public:
 virtual void set_max_mru_count(int nCount) = 0;
 virtual OUString get_mru_entries() const = 0;
 virtual void set_mru_entries(const OUString& rEntries) = 0;
-
-// Form Controls List Box related multi-selection support
-// Only SelectionMode::Single or SelectionMode::Multiple are supported.
-// SelectionMode::Multiple mode is basically bizarre but in use in
-// the Form Controls List Box which we seem stuck with
-virtual void set_selection_mode(SelectionMode eMode) = 0;
-virtual void scroll_to_row(int pos) = 0;
-virtual void select(int pos) = 0;
-virtual void unselect(int pos) = 0;
-virtual std::vector get_selected_rows() const = 0;
 };
 
 class VCL_DLLPUBLIC TreeIter
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 2eef5e666941..0700e03e435c 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -3967,8 +3967,6 @@ FmXListBoxCell::FmXListBoxCell(DbGridColumn* pColumn, 
std::unique_ptr(m_pCellControl->GetWindow()).get_widget())
-  , 
m_nLines(Application::GetSettings().GetStyleSettings().GetListBoxMaximumLineCount())
-  , m_bMulti(false)
 {
 m_pBox->connect_changed(LINK(this, FmXListBoxCell, ChangedHdl));
 }
@@ -3995,257 +3993,8 @@ void FmXListBoxCell::disposing()
 FmXTextCell::disposing();
 }
 
-Any SAL_CALL FmXListBoxCell::queryAggregation( const css::uno::Type& _rType )
-{
-Any aReturn = FmXTextCell::queryAggregation(_rType);
-
-if ( !aReturn.hasValue() )
-aReturn = FmXListBoxCell_Base::queryInterface( _rType );
-
-return aReturn;
-}
-
-Sequence< css::uno::Type > SAL_CALL FmXListBoxCell::getTypes(  )
-{
-return ::comphelper::concatSequences(
-FmXTextCell::getTypes(),
-FmXListBoxCell_Base::getTypes()
-);
-}
-
 IMPLEMENT_GET_IMPLEMENTATION_ID( FmXListBoxCell )
 
-void SAL_CALL FmXListBoxCell::addItemListener(const Reference< 
css::awt::XItemListener >& l)
-{
-m_aItemListeners.addInterface( l );
-}
-
-
-void SAL_CALL FmXListBoxCell::removeItemListener(const Reference< 
css::awt::XItemListener >& l)
-{
-m_aItemListeners.removeInterface( l );
-}
-
-
-void SAL_CALL FmXListBoxCell::addActionListener(const Reference< 
css::awt::XActionListener >& l)
-{
-m_aActionListeners.addInterface( l );
-}
-
-
-void SAL_CALL FmXListBoxCell::removeActionListener(const Reference< 
css::awt::XActionListener >& l)
-{
-m_aActionListeners.removeInterface( l );
-}
-
-void SAL_CALL FmXListBoxCell::addItem(const OUString& aItem, sal_Int16 nPos)
-{
-::osl::MutexGuard aGuard( m_aMutex );
-if (m_pBox)
-m_pBox->insert_text(nPos, aItem);
-}
-
-void SAL_CALL FmXListBoxCell::addItems(const css::uno::Sequence& 
aItems, sal_Int16 nPos)
-{
-::osl::MutexGuard aGuard( m_aMutex );
-if (m_pBox)
-{
-sal_uInt16 nP = nPos;
-for ( const auto& rItem : aItems )
-{
-m_pBox->insert_text(nP, rItem);
-if ( nPos != -1 )// Not if 0x, because LIST_APPEND
-nP++;
-}
-}
-}
-
-void SAL_CALL FmXListBoxCell::removeItems(sal_Int16 nPos, sal_Int16