diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-11-15 18:13:45 +0100 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-11-15 18:42:48 +0100 |
commit | 475c2a083965cf358414f9ddb7d8e191f547a9d9 (patch) | |
tree | 174d824b4af236df4f38d43e54734aa1f9bd38df | |
parent | 225af09be9ae7b10aaf5bf0e3714c74c5a2f1391 (diff) |
fdo#74669 Add z-test Statistics Dialog
Change-Id: I8169e9ceefc48c06b358d5a8e1fc08dabf019eb3
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 8 | ||||
-rw-r--r-- | sc/Library_sc.mk | 1 | ||||
-rw-r--r-- | sc/UIConfig_scalc.mk | 1 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 3 | ||||
-rw-r--r-- | sc/sdi/cellsh.sdi | 1 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 24 | ||||
-rw-r--r-- | sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc | 11 | ||||
-rw-r--r-- | sc/source/ui/StatisticsDialogs/StatisticsDialogs.src | 42 | ||||
-rw-r--r-- | sc/source/ui/StatisticsDialogs/ZTestDialog.cxx | 179 | ||||
-rw-r--r-- | sc/source/ui/app/scdll.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/ZTestDialog.hxx | 34 | ||||
-rw-r--r-- | sc/source/ui/inc/reffact.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 7 | ||||
-rw-r--r-- | sc/uiconfig/scalc/menubar/menubar.xml | 1 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/ztestdialog.ui | 319 |
17 files changed, 644 insertions, 6 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 85053c0406a5..1054efcf7611 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -747,6 +747,14 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:ZTestDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">~z-test...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:EditHeaderAndFooter" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">~Headers & Footers...</value> diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 042fc156e63f..2c591c946bad 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -506,6 +506,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog \ sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools \ sc/source/ui/StatisticsDialogs/TTestDialog \ + sc/source/ui/StatisticsDialogs/ZTestDialog \ sc/source/ui/undo/areasave \ sc/source/ui/undo/refundo \ sc/source/ui/undo/target \ diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 1dc9bc4ade57..9bcc908e7ae2 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -184,6 +184,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/validationcriteriapage \ sc/uiconfig/scalc/ui/validationhelptabpage \ sc/uiconfig/scalc/ui/xmlsourcedialog \ + sc/uiconfig/scalc/ui/ztestdialog \ )) # vim: set noet sw=4 ts=4: diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 0287773acd03..155ef286fdbe 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -271,7 +271,8 @@ #define SID_MOVING_AVERAGE_DIALOG (SC_MESSAGE_START + 77) #define SID_TTEST_DIALOG (SC_MESSAGE_START + 78) #define SID_FTEST_DIALOG (SC_MESSAGE_START + 79) -#define SID_SEARCH_RESULTS_DIALOG (SC_MESSAGE_START + 80) +#define SID_ZTEST_DIALOG (SC_MESSAGE_START + 80) +#define SID_SEARCH_RESULTS_DIALOG (SC_MESSAGE_START + 81) // functions diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 9bc9444df90f..287af9803941 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -161,6 +161,7 @@ interface CellSelection SID_MOVING_AVERAGE_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_TTEST_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_FTEST_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] + SID_ZTEST_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_SEARCH_RESULTS_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_MARKDATAAREA [ ExecMethod = ExecuteMove; StateMethod = GetStateCursor; ] SID_MARKARRAYFORMULA [ ExecMethod = ExecuteMove; StateMethod = GetStateCursor; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index f9c6cc770d04..72eedc652458 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -3207,6 +3207,30 @@ SfxVoidItem FTestDialog SID_FTEST_DIALOG GroupId = GID_OPTIONS; ] +SfxVoidItem ZTestDialog SID_ZTEST_DIALOG +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_OPTIONS; +] + SfxVoidItem SolverDialog SID_OPENDLG_OPTSOLVER () [ diff --git a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc index 2574797c6f5a..c4fdd4c950cb 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc +++ b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc @@ -59,6 +59,8 @@ #define STR_TTEST_UNDO_NAME 67 #define STR_FTEST 68 #define STR_FTEST_UNDO_NAME 69 +#define STR_ZTEST 70 +#define STR_ZTEST_UNDO_NAME 71 #define STR_COLUMN_LABEL_TEMPLATE 100 #define STR_ROW_LABEL_TEMPLATE 101 @@ -84,6 +86,7 @@ #define STR_VARIABLE_2_LABEL 134 #define STR_HYPOTHESIZED_MEAN_DIFFERENCE_LABEL 135 #define STR_OBSERVATIONS_LABEL 136 +#define STR_OBSERVED_MEAN_DIFFERENCE_LABEL 137 #define STR_FTEST_P_RIGHT_TAIL 140 #define STR_FTEST_F_CRITICAL_RIGHT_TAIL 141 @@ -93,7 +96,6 @@ #define STR_FTEST_F_CRITICAL_TWO_TAIL 145 #define STR_TTEST_PEARSON_CORRELATION 150 -#define STR_TTEST_OBSERVED_MEAN_DIFFERENCE 151 #define STR_TTEST_VARIANCE_OF_THE_DIFFERENCES 152 #define STR_TTEST_T_STAT 153 #define STR_TTEST_P_ONE_TAIL 154 @@ -101,4 +103,11 @@ #define STR_TTEST_P_TWO_TAIL 156 #define STR_TTEST_T_CRITICAL_TWO_TAIL 157 +#define STR_ZTEST_KNOWN_VARIANCE 160 +#define STR_ZTEST_Z_VALUE 161 +#define STR_ZTEST_P_ONE_TAIL 162 +#define STR_ZTEST_Z_CRITICAL_ONE_TAIL 163 +#define STR_ZTEST_P_TWO_TAIL 164 +#define STR_ZTEST_Z_CRITICAL_TWO_TAIL 165 + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src index 49c9575b9c37..f6865627d232 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src +++ b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src @@ -292,6 +292,14 @@ Resource RID_STATISTICS_DLGS { Text [ en-US ] = "t-test"; }; + String STR_ZTEST + { + Text [ en-US ] = "z-test"; + }; + String STR_ZTEST_UNDO_NAME + { + Text [ en-US ] = "z-test"; + }; /* Common */ String STR_COLUMN_LABEL_TEMPLATE @@ -322,6 +330,10 @@ Resource RID_STATISTICS_DLGS { Text [ en-US ] = "Observations"; }; + String STR_OBSERVED_MEAN_DIFFERENCE_LABEL + { + Text [ en-US ] = "Observed Mean Difference"; + }; /*F Test */ String STR_FTEST_P_RIGHT_TAIL @@ -354,10 +366,6 @@ Resource RID_STATISTICS_DLGS { Text [ en-US ] = "Pearson Correlation"; }; - String STR_TTEST_OBSERVED_MEAN_DIFFERENCE - { - Text [ en-US ] = "Observed Mean Difference"; - }; String STR_TTEST_VARIANCE_OF_THE_DIFFERENCES { Text [ en-US ] = "Variance of the Differences"; @@ -382,6 +390,32 @@ Resource RID_STATISTICS_DLGS { Text [ en-US ] = "t Critical two-tail"; }; + + /*Z Test*/ + String STR_ZTEST_Z_VALUE + { + Text [ en-US ] = "z"; + }; + String STR_ZTEST_KNOWN_VARIANCE + { + Text [ en-US ] = "Known Variance"; + }; + String STR_ZTEST_P_ONE_TAIL + { + Text [ en-US ] = "P (Z<=z) one-tail"; + }; + String STR_ZTEST_Z_CRITICAL_ONE_TAIL + { + Text [ en-US ] = "z Critical one-tail"; + }; + String STR_ZTEST_P_TWO_TAIL + { + Text [ en-US ] = "P (Z<=z) two-tail"; + }; + String STR_ZTEST_Z_CRITICAL_TWO_TAIL + { + Text [ en-US ] = "z Critical two-tail"; + }; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx b/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx new file mode 100644 index 000000000000..4ab24c4ffbf7 --- /dev/null +++ b/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx @@ -0,0 +1,179 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include <sfx2/dispatch.hxx> +#include <svl/zforlist.hxx> +#include <svl/undo.hxx> +#include <boost/random.hpp> +#include <boost/scoped_ptr.hpp> + +#include "formulacell.hxx" +#include "rangelst.hxx" +#include "scitems.hxx" +#include "docsh.hxx" +#include "document.hxx" +#include "uiitems.hxx" +#include "reffact.hxx" +#include "strload.hxx" +#include "docfunc.hxx" +#include "StatisticsDialogs.hrc" +#include "TableFillingAndNavigationTools.hxx" + +#include "ZTestDialog.hxx" + +ScZTestDialog::ScZTestDialog( + SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, + vcl::Window* pParent, ScViewData* pViewData ) : + ScStatisticsTwoVariableDialog( + pSfxBindings, pChildWindow, pParent, pViewData, + "ZTestDialog", "modules/scalc/ui/ztestdialog.ui" ) +{ + SetText(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ZTEST)); +} + +ScZTestDialog::~ScZTestDialog() +{} + +bool ScZTestDialog::Close() +{ + return DoClose( ScZTestDialogWrapper::GetChildWindowId() ); +} + +sal_Int16 ScZTestDialog::GetUndoNameId() +{ + return STR_ZTEST_UNDO_NAME; +} + +ScRange ScZTestDialog::ApplyOutput(ScDocShell* pDocShell) +{ + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, + formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); + FormulaTemplate aTemplate(mDocument); + + boost::scoped_ptr<DataRangeIterator> pVariable1Iterator; + if (mGroupedBy == BY_COLUMN) + pVariable1Iterator.reset(new DataRangeByColumnIterator(mVariable1Range)); + else + pVariable1Iterator.reset(new DataRangeByRowIterator(mVariable1Range)); + + boost::scoped_ptr<DataRangeIterator> pVariable2Iterator; + if (mGroupedBy == BY_COLUMN) + pVariable2Iterator.reset(new DataRangeByColumnIterator(mVariable2Range)); + else + pVariable2Iterator.reset(new DataRangeByRowIterator(mVariable2Range)); + + aTemplate.autoReplaceRange("%VARIABLE1_RANGE%", pVariable1Iterator->get()); + aTemplate.autoReplaceRange("%VARIABLE2_RANGE%", pVariable2Iterator->get()); + + aOutput.writeBoldString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ZTEST)); + aOutput.newLine(); + + // Alpha + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_LABEL_ALPHA)); + aOutput.nextColumn(); + aOutput.writeValue(0.05); + aTemplate.autoReplaceAddress("%ALPHA%", aOutput.current()); + aOutput.newLine(); + + // Hypothesized mean difference + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_HYPOTHESIZED_MEAN_DIFFERENCE_LABEL)); + aOutput.nextColumn(); + aOutput.writeValue(0); + aTemplate.autoReplaceAddress("%HYPOTHESIZED_MEAN_DIFFERENCE%", aOutput.current()); + aOutput.newLine(); + + // Variable Label + aOutput.nextColumn(); + aOutput.writeBoldString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_VARIABLE_1_LABEL)); + aOutput.nextColumn(); + aOutput.writeBoldString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_VARIABLE_2_LABEL)); + aOutput.newLine(); + + // Known Variance + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ZTEST_KNOWN_VARIANCE)); + aOutput.nextColumn(); + aOutput.writeValue(0); + aTemplate.autoReplaceAddress("%KNOWN_VARIANCE_VARIABLE1%", aOutput.current()); + aOutput.nextColumn(); + aOutput.writeValue(0); + aTemplate.autoReplaceAddress("%KNOWN_VARIANCE_VARIABLE2%", aOutput.current()); + aOutput.newLine(); + + // Mean + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STRID_CALC_MEAN)); + aOutput.nextColumn(); + aTemplate.setTemplate("=AVERAGE(%VARIABLE1_RANGE%)"); + aTemplate.autoReplaceAddress("%MEAN_VARIABLE1%", aOutput.current()); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.nextColumn(); + aTemplate.setTemplate("=AVERAGE(%VARIABLE2_RANGE%)"); + aTemplate.autoReplaceAddress("%MEAN_VARIABLE2%", aOutput.current()); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.newLine(); + + // Observations + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_OBSERVATIONS_LABEL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=COUNT(%VARIABLE1_RANGE%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%OBSERVATION_VARIABLE1%", aOutput.current()); + aOutput.nextColumn(); + aTemplate.setTemplate("=COUNT(%VARIABLE2_RANGE%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%OBSERVATION_VARIABLE2%", aOutput.current()); + aOutput.newLine(); + + // Observed mean difference + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_OBSERVED_MEAN_DIFFERENCE_LABEL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=%MEAN_VARIABLE1% - %MEAN_VARIABLE2%"); + aOutput.writeMatrixFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%OBSERVED_MEAN_DIFFERENCE%", aOutput.current()); + aOutput.newLine(); + + // z + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ZTEST_Z_VALUE)); + aOutput.nextColumn(); + aTemplate.setTemplate("=(%OBSERVED_MEAN_DIFFERENCE% - %HYPOTHESIZED_MEAN_DIFFERENCE%) / SQRT( %KNOWN_VARIANCE_VARIABLE1% / %OBSERVATION_VARIABLE1% + %KNOWN_VARIANCE_VARIABLE2% / %OBSERVATION_VARIABLE2% )"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%Z_STAT%", aOutput.current()); + aOutput.newLine(); + + // P one-tail + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ZTEST_P_ONE_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=1 - NORMSDIST(ABS(%Z_STAT%))"); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.newLine(); + + // z critical one-tail + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ZTEST_Z_CRITICAL_ONE_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=-NORMSINV(%ALPHA%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.newLine(); + + // P two-tail + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ZTEST_P_TWO_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=2 * NORMSDIST(-ABS(%Z_STAT%))"); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.newLine(); + + // z critical two-tail + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ZTEST_Z_CRITICAL_TWO_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=-NORMSINV(%ALPHA%/2)"); + aOutput.writeFormula(aTemplate.getTemplate()); + + return ScRange(aOutput.mMinimumAddress, aOutput.mMaximumAddress); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index d94522205a28..d62004964da2 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -259,6 +259,7 @@ void ScDLL::Init() ScMovingAverageDialogWrapper ::RegisterChildWindow(false, pMod); ScTTestDialogWrapper ::RegisterChildWindow(false, pMod); ScFTestDialogWrapper ::RegisterChildWindow(false, pMod); + ScZTestDialogWrapper ::RegisterChildWindow(false, pMod); // First docking Window for Calc ScFunctionChildWindow ::RegisterChildWindow(false, pMod); diff --git a/sc/source/ui/inc/ZTestDialog.hxx b/sc/source/ui/inc/ZTestDialog.hxx new file mode 100644 index 000000000000..8af6f14ee65a --- /dev/null +++ b/sc/source/ui/inc/ZTestDialog.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#ifndef INCLUDED_SC_SOURCE_UI_INC_ZTESTDIALOG_HXX +#define INCLUDED_SC_SOURCE_UI_INC_ZTESTDIALOG_HXX + +#include "StatisticsTwoVariableDialog.hxx" + +class ScZTestDialog : public ScStatisticsTwoVariableDialog +{ +public: + ScZTestDialog( + SfxBindings* pB, SfxChildWindow* pCW, + vcl::Window* pParent, ScViewData* pViewData ); + + virtual ~ScZTestDialog(); + + virtual bool Close() SAL_OVERRIDE; + +protected: + virtual sal_Int16 GetUndoNameId() SAL_OVERRIDE; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) SAL_OVERRIDE; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index 7ae4a9f0a29e..4fd3b270d631 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -121,6 +121,13 @@ private: ScFTestDialogWrapper() SAL_DELETED_FUNCTION; }; +class ScZTestDialogWrapper : + public ChildWindowWrapper<SID_ZTEST_DIALOG> +{ +private: + ScZTestDialogWrapper() SAL_DELETED_FUNCTION; +}; + class ScAcceptChgDlgWrapper: public SfxChildWindow { public: diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 32c237daa2ad..624b77dc8e14 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -992,6 +992,16 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; + case SID_ZTEST_DIALOG: + { + sal_uInt16 nId = ScZTestDialogWrapper::GetChildWindowId(); + SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + + pScMod->SetRefDialog( nId, pWnd ? false : sal_True ); + + } + break; case SID_SEARCH_RESULTS_DIALOG: { diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx index 51aaae8facef..d07feb7bb453 100644 --- a/sc/source/ui/view/tabvwsh.cxx +++ b/sc/source/ui/view/tabvwsh.cxx @@ -95,6 +95,7 @@ void ScTabViewShell::InitInterface_Impl() GetStaticInterface()->RegisterChildWindow(ScMovingAverageDialogWrapper::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(ScTTestDialogWrapper::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(ScFTestDialogWrapper::GetChildWindowId()); + GetStaticInterface()->RegisterChildWindow(ScZTestDialogWrapper::GetChildWindowId()); } SFX_IMPL_NAMED_VIEWFACTORY( ScTabViewShell, "Default" ) diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 2285768fca73..6621d55bc3bb 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -68,6 +68,7 @@ #include "MovingAverageDialog.hxx" #include "TTestDialog.hxx" #include "FTestDialog.hxx" +#include "ZTestDialog.hxx" #include "PivotLayoutDialog.hxx" @@ -381,6 +382,12 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( } break; + case SID_ZTEST_DIALOG: + { + pResult = new ScZTestDialog( pB, pCW, pParent, &GetViewData() ); + } + break; + case SID_OPENDLG_OPTSOLVER: { ScViewData& rViewData = GetViewData(); diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index 00368d36363c..d906957b644a 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -507,6 +507,7 @@ <menu:menuitem menu:id=".uno:MovingAverageDialog"/> <menu:menuitem menu:id=".uno:TTestDialog"/> <menu:menuitem menu:id=".uno:FTestDialog"/> + <menu:menuitem menu:id=".uno:ZTestDialog"/> </menu:menupopup> </menu:menu> </menu:menupopup> diff --git a/sc/uiconfig/scalc/ui/ztestdialog.ui b/sc/uiconfig/scalc/ui/ztestdialog.ui new file mode 100644 index 000000000000..efe00addccaa --- /dev/null +++ b/sc/uiconfig/scalc/ui/ztestdialog.ui @@ -0,0 +1,319 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.18.3 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <requires lib="LibreOffice" version="1.0"/> + <object class="GtkDialog" id="ZTestDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkFrame" id="frame-data"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="bottom_padding">6</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="variable1-range-label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Variable 1 range:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">variable1-range-edit</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="foruilo-RefEdit" id="variable1-range-edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="valign">center</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + <property name="width_chars">30</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="foruilo-RefButton" id="variable1-range-button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="variable2-range-label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Variable 2 range:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">variable2-range-edit</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="foruilo-RefEdit" id="variable2-range-edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="valign">center</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + <property name="width_chars">30</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="foruilo-RefButton" id="variable2-range-button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="output-range-label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Results to:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">variable2-range-edit</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="foruilo-RefEdit" id="output-range-edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="valign">center</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + <property name="width_chars">30</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="foruilo-RefButton" id="output-range-button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Data</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + <property name="secondary">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="bottom_padding">6</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkRadioButton" id="groupedby-columns-radio"> + <property name="label" translatable="yes">Columns</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="groupedby-rows-radio"> + <property name="label" translatable="yes">Rows</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">groupedby-columns-radio</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Grouped by</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + </action-widgets> + </object> + <object class="GtkSizeGroup" id="sizegroup1"> + <widgets> + <widget name="variable1-range-label"/> + <widget name="variable2-range-label"/> + <widget name="output-range-label"/> + <widget name="groupedby-columns-radio"/> + </widgets> + </object> +</interface> |