diff options
-rw-r--r-- | include/vcl/jsdialog/executor.hxx | 2 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/pvfundlg.cxx | 38 | ||||
-rw-r--r-- | sc/source/ui/inc/pvfundlg.hxx | 8 | ||||
-rw-r--r-- | vcl/jsdialog/executor.cxx | 1 |
5 files changed, 51 insertions, 0 deletions
diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx index 1e2a0806e3e9..0c7abbf693ca 100644 --- a/include/vcl/jsdialog/executor.hxx +++ b/include/vcl/jsdialog/executor.hxx @@ -36,6 +36,8 @@ public: rToolbar.signal_clicked(rIdent); } + static void trigger_clicked(weld::Button& rButton) { rButton.signal_clicked(); } + static void trigger_click(weld::DrawingArea& rDrawingArea, const Point& rPos) { rDrawingArea.click(rPos); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 648c1746b15e..e4524a4dc9b5 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1309,6 +1309,8 @@ public: class VCL_DLLPUBLIC Button : virtual public Container { + friend class ::LOKTrigger; + protected: Link<Button&, void> m_aClickHdl; diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 7d8c7bc42b12..431ef89407de 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -245,6 +245,8 @@ ScDPFunctionDlg::ScDPFunctionDlg( , mxFtBaseItem(m_xBuilder->weld_label("baseitemft")) , mxLbBaseItem(m_xBuilder->weld_combo_box("baseitem")) , mxBtnOk(m_xBuilder->weld_button("ok")) + , mxBtnCancel(m_xBuilder->weld_button("cancel")) + , mxExpander(m_xBuilder->weld_expander("expander")) , mrLabelVec(rLabelVec) , mbEmptyItem(false) { @@ -291,6 +293,9 @@ DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) { + mxBtnOk->connect_clicked( LINK( this, ScDPFunctionDlg, ButtonClicked ) ); + mxBtnCancel->connect_clicked( LINK( this, ScDPFunctionDlg, ButtonClicked ) ); + // list box PivotFunc nFuncMask = (rFuncData.mnFuncMask == PivotFunc::NONE) ? PivotFunc::Sum : rFuncData.mnFuncMask; mxLbFunc->SetSelection( nFuncMask ); @@ -438,6 +443,14 @@ IMPL_LINK( ScDPFunctionDlg, SelectHdl, weld::ComboBox&, rLBox, void ) } } +IMPL_LINK(ScDPFunctionDlg, ButtonClicked, weld::Button&, rButton, void) +{ + if (&rButton == mxBtnOk.get()) + response(RET_OK); + else + response(RET_CANCEL); +} + IMPL_LINK_NOARG(ScDPFunctionDlg, DblClickHdl, weld::TreeView&, bool) { m_xDialog->response(RET_OK); @@ -459,6 +472,7 @@ ScDPSubtotalDlg::ScDPSubtotalDlg(weld::Widget* pParent, ScDPObject& rDPObj, , mxFtName(m_xBuilder->weld_label("name")) , mxCbShowAll(m_xBuilder->weld_check_button("showall")) , mxBtnOk(m_xBuilder->weld_button("ok")) + , mxBtnCancel(m_xBuilder->weld_button("cancel")) , mxBtnOptions(m_xBuilder->weld_button("options")) { mxLbFunc->set_selection_mode(SelectionMode::Multiple); @@ -496,6 +510,9 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) { + mxBtnOk->connect_clicked( LINK( this, ScDPSubtotalDlg, ButtonClicked ) ); + mxBtnCancel->connect_clicked( LINK( this, ScDPSubtotalDlg, ButtonClicked ) ); + // field name mxFtName->set_label(rLabelData.getDisplayName()); @@ -525,6 +542,14 @@ void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa mxBtnOptions->connect_clicked( LINK( this, ScDPSubtotalDlg, ClickHdl ) ); } +IMPL_LINK(ScDPSubtotalDlg, ButtonClicked, weld::Button&, rButton, void) +{ + if (&rButton == mxBtnOk.get()) + response(RET_OK); + else + response(RET_CANCEL); +} + IMPL_LINK(ScDPSubtotalDlg, RadioClickHdl, weld::Button&, rBtn, void) { mxLbFunc->set_sensitive(&rBtn == mxRbUser.get()); @@ -625,6 +650,8 @@ ScDPSubtotalOptDlg::ScDPSubtotalOptDlg(weld::Window* pParent, ScDPObject& rDPObj , m_xLbHide(m_xBuilder->weld_tree_view("hideitems")) , m_xFtHierarchy(m_xBuilder->weld_label("hierarchyft")) , m_xLbHierarchy(m_xBuilder->weld_combo_box("hierarchy")) + , m_xBtnOk(m_xBuilder->weld_button("ok")) + , m_xBtnCancel(m_xBuilder->weld_button("cancel")) , mrDPObj(rDPObj) , maLabelData(rLabelData) { @@ -690,6 +717,9 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayout ) { + m_xBtnOk->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked)); + m_xBtnCancel->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked)); + // *** SORTING *** sal_Int32 nSortMode = maLabelData.maSortInfo.Mode; @@ -820,6 +850,14 @@ sal_Int32 ScDPSubtotalOptDlg::FindListBoxEntry( return bFound ? nPos : -1; } +IMPL_LINK(ScDPSubtotalOptDlg, ButtonClicked, weld::Button&, rButton, void) +{ + if (&rButton == m_xBtnOk.get()) + response(RET_OK); + else + response(RET_CANCEL); +} + IMPL_LINK(ScDPSubtotalOptDlg, RadioClickHdl, weld::Button&, rBtn, void) { m_xLbSortBy->set_sensitive(&rBtn != m_xRbSortMan.get()); diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx index 79bd41f60bd2..4a60ec93e18a 100644 --- a/sc/source/ui/inc/pvfundlg.hxx +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -71,6 +71,7 @@ private: DECL_LINK(SelectHdl, weld::ComboBox&, void); DECL_LINK(DblClickHdl, weld::TreeView&, bool); + DECL_LINK(ButtonClicked, weld::Button&, void); private: std::unique_ptr<ScDPFunctionListBox> mxLbFunc; @@ -81,6 +82,8 @@ private: std::unique_ptr<weld::Label> mxFtBaseItem; std::unique_ptr<weld::ComboBox> mxLbBaseItem; std::unique_ptr<weld::Button> mxBtnOk; + std::unique_ptr<weld::Button> mxBtnCancel; + std::unique_ptr<weld::Expander> mxExpander; NameMapType maBaseFieldNameMap; // cache for base field display -> original name. NameMapType maBaseItemNameMap; // cache for base item display -> original name. @@ -106,6 +109,7 @@ private: DECL_LINK( DblClickHdl, weld::TreeView&, bool ); DECL_LINK( RadioClickHdl, weld::Button&, void ); DECL_LINK( ClickHdl, weld::Button&, void ); + DECL_LINK( ButtonClicked, weld::Button&, void ); private: ScDPObject& mrDPObj; /// The DataPilot object (for member names). @@ -121,6 +125,7 @@ private: std::unique_ptr<weld::Label> mxFtName; std::unique_ptr<weld::CheckButton> mxCbShowAll; std::unique_ptr<weld::Button> mxBtnOk; + std::unique_ptr<weld::Button> mxBtnCancel; std::unique_ptr<weld::Button> mxBtnOptions; }; @@ -145,6 +150,7 @@ private: DECL_LINK( RadioClickHdl, weld::Button&, void ); DECL_LINK( CheckHdl, weld::Button&, void ); DECL_LINK( SelectHdl, weld::ComboBox&, void ); + DECL_LINK( ButtonClicked, weld::Button&, void ); private: std::unique_ptr<weld::ComboBox> m_xLbSortBy; @@ -166,6 +172,8 @@ private: std::unique_ptr<weld::TreeView> m_xLbHide; std::unique_ptr<weld::Label> m_xFtHierarchy; std::unique_ptr<weld::ComboBox> m_xLbHierarchy; + std::unique_ptr<weld::Button> m_xBtnOk; + std::unique_ptr<weld::Button> m_xBtnCancel; ScDPObject& mrDPObj; /// The DataPilot object (for member names). ScDPLabelData maLabelData; /// Cache for members data. diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index cfb36dd858be..da2cea423d3d 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -106,6 +106,7 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat { bool bChecked = rData["data"] == "true"; pCheckButton->set_state(bChecked ? TRISTATE_TRUE : TRISTATE_FALSE); + LOKTrigger::trigger_clicked(*static_cast<weld::Button*>(pCheckButton)); LOKTrigger::trigger_toggled(*static_cast<weld::ToggleButton*>(pCheckButton)); return true; } |