summaryrefslogtreecommitdiff
path: root/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-09 11:23:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-10 21:23:21 +0200
commit3d648f76ac90fe8e28691313d0d4e78a8278e511 (patch)
treef3e0de959d8ddff61a9ff4af79e481bec25aa29d /sc/source/ui/inc/StatisticsInputOutputDialog.hxx
parent47500ab25b9c5bbeeb6fde3866bdd924948fd88a (diff)
weld ScCorrelationDialog
this is first of the calc dialogs with a range selector, so some temp scaffolding is required during interim case of both welded/unwelded in existence Change-Id: I5480179092da7b56864cef066af781b35f735ebc Reviewed-on: https://gerrit.libreoffice.org/70474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/inc/StatisticsInputOutputDialog.hxx')
-rw-r--r--sc/source/ui/inc/StatisticsInputOutputDialog.hxx72
1 files changed, 72 insertions, 0 deletions
diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
index b63ccd35c78e..6a18855851a4 100644
--- a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
+++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
@@ -86,6 +86,78 @@ private:
DECL_LINK( RefInputModifyHandler, Edit&, void );
};
+class ScStatisticsInputOutputDialogController : public ScAnyRefDlgController
+{
+public:
+ enum GroupedBy {
+ BY_COLUMN,
+ BY_ROW
+ };
+
+ ScStatisticsInputOutputDialogController(
+ SfxBindings* pB, SfxChildWindow* pCW,
+ weld::Window* pParent, ScViewData* pViewData,
+ const OUString& rUIXMLDescription,
+ const OString& rID);
+
+ virtual ~ScStatisticsInputOutputDialogController() override;
+
+ virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
+ virtual void SetActive() override;
+
+protected:
+ void CalculateInputAndWriteToOutput();
+
+ virtual ScRange ApplyOutput(ScDocShell* pDocShell) = 0;
+ virtual const char* GetUndoNameId() = 0;
+ virtual bool InputRangesValid();
+ void ValidateDialogInput();
+
+ // Widgets
+ std::unique_ptr<weld::Label> mxInputRangeLabel;
+ std::unique_ptr<formula::WeldRefEdit> mxInputRangeEdit;
+ std::unique_ptr<formula::WeldRefButton> mxInputRangeButton;
+
+ std::unique_ptr<weld::Label> mxOutputRangeLabel;
+ std::unique_ptr<formula::WeldRefEdit> mxOutputRangeEdit;
+ std::unique_ptr<formula::WeldRefButton> mxOutputRangeButton;
+
+ std::unique_ptr<weld::RadioButton> mxGroupByColumnsRadio;
+ std::unique_ptr<weld::RadioButton> mxGroupByRowsRadio;
+
+ // Data
+ ScViewData* const mViewData;
+ ScDocument* const mDocument;
+
+ ScRange mInputRange;
+ ScAddress::Details const mAddressDetails;
+ ScAddress mOutputAddress;
+ GroupedBy mGroupedBy;
+
+ static ScRangeList MakeColumnRangeList(SCTAB aTab, ScAddress const & aStart, ScAddress const & aEnd);
+ static ScRangeList MakeRowRangeList(SCTAB aTab, ScAddress const & aStart, ScAddress const & aEnd);
+
+private:
+ // Widgets
+ std::unique_ptr<weld::Button> mxButtonOk;
+
+ formula::WeldRefEdit* mpActiveEdit;
+ ScAddress const mCurrentAddress;
+ bool mDialogLostFocus;
+
+ void Init();
+ void GetRangeFromSelection();
+
+ DECL_LINK( GroupByChanged, weld::ToggleButton&, void );
+ DECL_LINK( OkClicked, weld::Button&, void );
+ DECL_LINK( GetEditFocusHandler, formula::WeldRefEdit&, void );
+ DECL_LINK( GetButtonFocusHandler, formula::WeldRefButton&, void );
+ DECL_LINK( LoseEditFocusHandler, formula::WeldRefEdit&, void );
+ DECL_LINK( LoseButtonFocusHandler, formula::WeldRefButton&, void );
+ DECL_LINK( RefInputModifyHandler, formula::WeldRefEdit&, void );
+};
+
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */