1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 #ifndef INCLUDED_SC_SOURCE_UI_INC_STATISTICSTWOVARIABLEDIALOG_HXX
12 #define INCLUDED_SC_SOURCE_UI_INC_STATISTICSTWOVARIABLEDIALOG_HXX
14 #include <address.hxx>
15 #include "anyrefdg.hxx"
16 #include "viewdata.hxx"
18 class ScStatisticsTwoVariableDialog
: public ScAnyRefDlgController
26 ScStatisticsTwoVariableDialog(
27 SfxBindings
* pB
, SfxChildWindow
* pCW
,
28 weld::Window
* pParent
, ScViewData
* pViewData
,
29 const OUString
& rUIXMLDescription
, const OString
& rID
);
31 virtual ~ScStatisticsTwoVariableDialog() override
;
33 virtual void SetReference( const ScRange
& rRef
, ScDocument
* pDoc
) override
;
34 virtual void SetActive() override
;
37 void CalculateInputAndWriteToOutput();
39 virtual ScRange
ApplyOutput(ScDocShell
* pDocShell
) = 0;
40 virtual const char* GetUndoNameId() = 0;
41 virtual bool InputRangesValid();
42 void ValidateDialogInput();
45 std::unique_ptr
<weld::Label
> mxVariable1RangeLabel
;
46 std::unique_ptr
<formula::RefEdit
> mxVariable1RangeEdit
;
47 std::unique_ptr
<formula::RefButton
> mxVariable1RangeButton
;
49 std::unique_ptr
<weld::Label
> mxVariable2RangeLabel
;
50 std::unique_ptr
<formula::RefEdit
> mxVariable2RangeEdit
;
51 std::unique_ptr
<formula::RefButton
> mxVariable2RangeButton
;
53 std::unique_ptr
<weld::Label
> mxOutputRangeLabel
;
54 std::unique_ptr
<formula::RefEdit
> mxOutputRangeEdit
;
55 std::unique_ptr
<formula::RefButton
> mxOutputRangeButton
;
58 ScViewData
* const mViewData
;
59 ScDocument
* const mDocument
;
61 ScRange mVariable1Range
;
62 ScRange mVariable2Range
;
64 ScAddress::Details
const mAddressDetails
;
65 ScAddress mOutputAddress
;
70 std::unique_ptr
<weld::Button
> mxButtonOk
;
72 std::unique_ptr
<weld::RadioButton
> mxGroupByColumnsRadio
;
73 std::unique_ptr
<weld::RadioButton
> mxGroupByRowsRadio
;
75 formula::RefEdit
* mpActiveEdit
;
76 ScAddress
const mCurrentAddress
;
77 bool mDialogLostFocus
;
80 void GetRangeFromSelection();
82 DECL_LINK( GroupByChanged
, weld::ToggleButton
&, void );
83 DECL_LINK( OkClicked
, weld::Button
&, void );
84 DECL_LINK( GetEditFocusHandler
, formula::RefEdit
&, void );
85 DECL_LINK( GetButtonFocusHandler
, formula::RefButton
&, void );
86 DECL_LINK( LoseEditFocusHandler
, formula::RefEdit
&, void );
87 DECL_LINK( LoseButtonFocusHandler
, formula::RefButton
&, void );
88 DECL_LINK( RefInputModifyHandler
, formula::RefEdit
&, void );
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */