summaryrefslogtreecommitdiffstats
path: root/include/svtools/editbrowsebox.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-18 17:22:31 +0000
committerAndras Timar <andras.timar@collabora.com>2021-08-16 10:15:14 +0200
commiteaf7e188e1f695e4d165838b4b40414601d28591 (patch)
treed1e5653647607b414891ac6d3c45f63a9835df7d /include/svtools/editbrowsebox.hxx
parentundo blocking emitting focus events during grab_focus (diff)
downloadcore-eaf7e188e1f695e4d165838b4b40414601d28591.tar.gz
core-eaf7e188e1f695e4d165838b4b40414601d28591.zip
Resolves: tdf#143023 explicitly connect to ControlBase focus-[in/out]
instead of listening to the generic vcl::Window/Control focus events. The thing which really gets/loses focus is now a Widget hosted inside the ControlBase. also contains... fix comment Change-Id: Ia1783aff3fded7fd73de2b04b9aced647771a92c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119998 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> establish that DbCellControl Window member is always a ControlBase and remove resulting known redundant dynamic_casting Change-Id: I5f098ef1adee3ad5d2a2bc5fcd30523f980df2f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119999 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> EventWindow is always a svt::ControlBase update DataBrowser has-focus when child widget loses focus similar to tdf#135641 case, focus-out becomes an issue with the bibliography editor if focus-in is seen on clicking in a cell, then click in a GtkEntry and tab around in a circle. Without this lose-focus support focus will be grabbed back to the cell of the initial click on a circuit of the focus-cycle Change-Id: I36288ed21dc4357c077f8dee55b55abf2457c2a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111157 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 422a8c3218b484817a8723b57fe9845d6abb83f4) reportdesigner focus out handler clobbering the preexisting handler set by the databrowser, so chain one after the other Change-Id: I5aa16635031be425b9354e5a2d6b891a81d54e55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111384 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 731f08e5a84817dbc3c6be6e670025d51f39cd61) Change-Id: I012d0bea687aa6d5965a4e2f6ce3899bfc629f1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120006 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'include/svtools/editbrowsebox.hxx')
-rw-r--r--include/svtools/editbrowsebox.hxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index 34696522bd78..a1badb8cce80 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -171,9 +171,26 @@ namespace svt
virtual void SetEditableReadOnly(bool bReadOnly);
virtual bool ProcessKey(const KeyEvent& rKEvt);
+
+ // chain after the FocusInHdl
+ void SetFocusInHdl(const Link<LinkParamNone*,void>& rHdl)
+ {
+ m_aFocusInHdl = rHdl;
+ }
+
+ // chain after the FocusOutHdl
+ void SetFocusOutHdl(const Link<LinkParamNone*,void>& rHdl)
+ {
+ m_aFocusOutHdl = rHdl;
+ }
+
protected:
DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
DECL_LINK(FocusInHdl, weld::Widget&, void);
+ DECL_LINK(FocusOutHdl, weld::Widget&, void);
+ private:
+ Link<LinkParamNone*,void> m_aFocusInHdl;
+ Link<LinkParamNone*,void> m_aFocusOutHdl;
};
class SVT_DLLPUBLIC EditControlBase : public ControlBase
@@ -191,6 +208,7 @@ namespace svt
weld::Entry& get_widget() { return *m_pEntry; }
virtual void connect_changed(const Link<weld::Entry&, void>& rLink) = 0;
+ virtual void connect_focus_out(const Link<weld::Widget&, void>& rLink) = 0;
protected:
void InitEditControlBase(weld::Entry* pEntry);
@@ -211,6 +229,11 @@ namespace svt
m_xWidget->connect_changed(rLink);
}
+ virtual void connect_focus_out(const Link<weld::Widget&, void>& rLink) override
+ {
+ m_xWidget->connect_focus_out(rLink);
+ }
+
protected:
std::unique_ptr<weld::Entry> m_xWidget;
};
@@ -696,6 +719,7 @@ namespace svt
virtual void dispose() override;
virtual void connect_changed(const Link<weld::Entry&, void>& rLink) override;
+ virtual void connect_focus_out(const Link<weld::Widget&, void>& rLink) override;
weld::EntryFormatter& get_formatter();
@@ -762,6 +786,7 @@ namespace svt
weld::PatternFormatter& get_formatter() { return *m_xEntryFormatter; }
virtual void connect_changed(const Link<weld::Entry&, void>& rLink) override;
+ virtual void connect_focus_out(const Link<weld::Widget&, void>& rLink) override;
virtual void dispose() override;
private:
@@ -995,6 +1020,7 @@ namespace svt
virtual bool ProcessKey(const KeyEvent& rEvt) override;
virtual void ChildFocusIn() override;
+ virtual void ChildFocusOut() override;
css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCheckBoxCell(sal_Int32 _nRow, sal_uInt16 _nColumnPos,const TriState& eState);
bool ControlHasFocus() const;