summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-12 15:43:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-12 20:54:15 +0200
commit0b05a04f978688aedce90e259a31873de82a2d2a (patch)
treec825911468c0647cace4a2a266f832ff8be757ba /include
parentbcea211b66910ee6cf6a51e4baa950b3f897e310 (diff)
clarify what WantMouseEvent is for
and add tristate machine support that we also need WantMouseEvent is if the first click in a browse cell that activates it should be passed to the control that appears on click as if it was itself clicked on primarily for the the CheckBoxController to toggle it immediately. Rework to explicitly toggle the checkbox in that implementation rather than rely on passing fake mouse click/release/tracking events. seeing as the main dbaccess table design view doesn't auto-launch its listboxes on clicking in a cell, but the sub create index dialog does, drop the auto-launch in the index dialog to match the main table design rathern than add a feature to weld::ComboBox to auto-launch the popup for that one solitary case Change-Id: Ie3d3f2ecf55d3d5b0b02b85ca09a6ca64bb800e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98603 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/svtools/editbrowsebox.hxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index 3b21aaea53c4..fde44b38d136 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -105,7 +105,7 @@ namespace svt
protected:
virtual bool MoveAllowed(const KeyEvent& rEvt) const;
void SetModifyHdl(const Link<LinkParamNone*,void>& rLink) { maModifyHdl = rLink; }
- virtual bool WantMouseEvent() const;
+ virtual void ActivatingMouseEvent(const BrowserMouseEvent& rEvt, bool bUp);
virtual void callModifyHdl() { maModifyHdl.Call(nullptr); }
};
@@ -581,10 +581,10 @@ namespace svt
class SVT_DLLPUBLIC CheckBoxControl final : public ControlBase
{
std::unique_ptr<weld::CheckButton> m_xBox;
+ weld::TriStateEnabled m_aModeState;
Link<weld::Button&,void> m_aClickLink;
Link<LinkParamNone*,void> m_aModify1Hdl;
Link<LinkParamNone*,void> m_aModify2Hdl;
- bool m_bTriState;
public:
CheckBoxControl(BrowserDataWin* pParent);
@@ -612,8 +612,13 @@ namespace svt
weld::CheckButton& GetBox() {return *m_xBox;};
+ // for pseudo-click when initially clicking in a cell activates
+ // the cell and performs a state change on the button as if
+ // it was clicked on
+ void Clicked();
+
private:
- DECL_LINK(OnClick, weld::Button&, void);
+ DECL_LINK(OnToggle, weld::ToggleButton&, void);
void CallModifyHdls()
{
@@ -634,7 +639,7 @@ namespace svt
virtual void SaveValue() override;
private:
- virtual bool WantMouseEvent() const override;
+ virtual void ActivatingMouseEvent(const BrowserMouseEvent& rEvt, bool bUp) override;
DECL_LINK(ModifyHdl, LinkParamNone*, void);
};