Kaydet (Commit) a5a0d605 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld ScAnalysisOfVarianceDialog

Change-Id: I94b736bbc5268f36a56a4a40ec39c6adaf67afbf
Reviewed-on: https://gerrit.libreoffice.org/70506Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 48af979d
......@@ -67,10 +67,10 @@ OUString lclCreateMultiParameterFormula(
return aResult.makeStringAndClear();
}
void lclMakeSubRangesList(ScRangeList& rRangeList, const ScRange& rInputRange, ScStatisticsInputOutputDialog::GroupedBy aGroupedBy)
void lclMakeSubRangesList(ScRangeList& rRangeList, const ScRange& rInputRange, ScStatisticsInputOutputDialogController::GroupedBy aGroupedBy)
{
std::unique_ptr<DataRangeIterator> pIterator;
if (aGroupedBy == ScStatisticsInputOutputDialog::BY_COLUMN)
if (aGroupedBy == ScStatisticsInputOutputDialogController::BY_COLUMN)
pIterator.reset(new DataRangeByColumnIterator(rInputRange));
else
pIterator.reset(new DataRangeByRowIterator(rInputRange));
......@@ -86,43 +86,33 @@ void lclMakeSubRangesList(ScRangeList& rRangeList, const ScRange& rInputRange, S
ScAnalysisOfVarianceDialog::ScAnalysisOfVarianceDialog(
SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
vcl::Window* pParent, ScViewData* pViewData ) :
ScStatisticsInputOutputDialog(
weld::Window* pParent, ScViewData* pViewData )
: ScStatisticsInputOutputDialogController(
pSfxBindings, pChildWindow, pParent, pViewData,
"AnalysisOfVarianceDialog", "modules/scalc/ui/analysisofvariancedialog.ui" ),
meFactor(SINGLE_FACTOR)
"modules/scalc/ui/analysisofvariancedialog.ui",
"AnalysisOfVarianceDialog")
, meFactor(SINGLE_FACTOR)
, mxAlphaField(m_xBuilder->weld_spin_button("alpha-spin"))
, mxSingleFactorRadio(m_xBuilder->weld_radio_button("radio-single-factor"))
, mxTwoFactorRadio(m_xBuilder->weld_radio_button("radio-two-factor"))
, mxRowsPerSampleField(m_xBuilder->weld_spin_button("rows-per-sample-spin"))
{
get(mpAlphaField, "alpha-spin");
get(mpSingleFactorRadio, "radio-single-factor");
get(mpTwoFactorRadio, "radio-two-factor");
get(mpRowsPerSampleField, "rows-per-sample-spin");
mxSingleFactorRadio->connect_toggled( LINK( this, ScAnalysisOfVarianceDialog, FactorChanged ) );
mxTwoFactorRadio->connect_toggled( LINK( this, ScAnalysisOfVarianceDialog, FactorChanged ) );
mpSingleFactorRadio->SetToggleHdl( LINK( this, ScAnalysisOfVarianceDialog, FactorChanged ) );
mpTwoFactorRadio->SetToggleHdl( LINK( this, ScAnalysisOfVarianceDialog, FactorChanged ) );
mpSingleFactorRadio->Check();
mpTwoFactorRadio->Check(false);
mxSingleFactorRadio->set_active(true);
mxTwoFactorRadio->set_active(false);
FactorChanged();
}
ScAnalysisOfVarianceDialog::~ScAnalysisOfVarianceDialog()
{
disposeOnce();
}
void ScAnalysisOfVarianceDialog::dispose()
{
mpAlphaField.clear();
mpSingleFactorRadio.clear();
mpTwoFactorRadio.clear();
mpRowsPerSampleField.clear();
ScStatisticsInputOutputDialog::dispose();
}
bool ScAnalysisOfVarianceDialog::Close()
void ScAnalysisOfVarianceDialog::Close()
{
return DoClose( ScAnalysisOfVarianceDialogWrapper::GetChildWindowId() );
DoClose( ScAnalysisOfVarianceDialogWrapper::GetChildWindowId() );
}
const char* ScAnalysisOfVarianceDialog::GetUndoNameId()
......@@ -130,25 +120,25 @@ const char* ScAnalysisOfVarianceDialog::GetUndoNameId()
return STR_ANALYSIS_OF_VARIANCE_UNDO_NAME;
}
IMPL_LINK_NOARG( ScAnalysisOfVarianceDialog, FactorChanged, RadioButton&, void )
IMPL_LINK_NOARG( ScAnalysisOfVarianceDialog, FactorChanged, weld::ToggleButton&, void )
{
FactorChanged();
}
void ScAnalysisOfVarianceDialog::FactorChanged()
{
if (mpSingleFactorRadio->IsChecked())
if (mxSingleFactorRadio->get_active())
{
mpGroupByRowsRadio->Enable();
mpGroupByColumnsRadio->Enable();
mpRowsPerSampleField->Enable(false);
mxGroupByRowsRadio->set_sensitive(true);
mxGroupByColumnsRadio->set_sensitive(true);
mxRowsPerSampleField->set_sensitive(false);
meFactor = SINGLE_FACTOR;
}
else if (mpTwoFactorRadio->IsChecked())
else if (mxTwoFactorRadio->get_active())
{
mpGroupByRowsRadio->Enable(false);
mpGroupByColumnsRadio->Enable(false);
mpRowsPerSampleField->Enable(false); // Rows per sample not yet implemented
mxGroupByRowsRadio->set_sensitive(false);
mxGroupByColumnsRadio->set_sensitive(false);
mxRowsPerSampleField->set_sensitive(false); // Rows per sample not yet implemented
meFactor = TWO_FACTOR;
}
}
......@@ -193,7 +183,7 @@ void ScAnalysisOfVarianceDialog::AnovaSingleFactor(AddressWalkerWriter& output,
output.writeBoldString(ScResId(STR_ANOVA_SINGLE_FACTOR_LABEL));
output.newLine();
double aAlphaValue = mpAlphaField->GetValue() / 100.0;
double aAlphaValue = mxAlphaField->get_value() / 100.0;
output.writeString(ScResId(STR_LABEL_ALPHA));
output.nextColumn();
output.writeValue(aAlphaValue);
......@@ -340,7 +330,7 @@ void ScAnalysisOfVarianceDialog::AnovaTwoFactor(AddressWalkerWriter& output, For
output.writeBoldString(ScResId(STR_ANOVA_TWO_FACTOR_LABEL));
output.newLine();
double aAlphaValue = mpAlphaField->GetValue() / 100.0;
double aAlphaValue = mxAlphaField->get_value() / 100.0;
output.writeString("Alpha");
output.nextColumn();
output.writeValue(aAlphaValue);
......
......@@ -19,7 +19,7 @@
class FormulaTemplate;
class AddressWalkerWriter;
class ScAnalysisOfVarianceDialog : public ScStatisticsInputOutputDialog
class ScAnalysisOfVarianceDialog : public ScStatisticsInputOutputDialogController
{
private:
enum AnovaFactor
......@@ -28,16 +28,16 @@ private:
TWO_FACTOR
};
VclPtr<NumericField> mpAlphaField;
VclPtr<RadioButton> mpSingleFactorRadio;
VclPtr<RadioButton> mpTwoFactorRadio;
VclPtr<NumericField> mpRowsPerSampleField;
DECL_LINK(FactorChanged, RadioButton&, void);
DECL_LINK(FactorChanged, weld::ToggleButton&, void);
void FactorChanged();
AnovaFactor meFactor;
std::unique_ptr<weld::SpinButton> mxAlphaField;
std::unique_ptr<weld::RadioButton> mxSingleFactorRadio;
std::unique_ptr<weld::RadioButton> mxTwoFactorRadio;
std::unique_ptr<weld::SpinButton> mxRowsPerSampleField;
static void RowColumn(ScRangeList& rRangeList, AddressWalkerWriter& aOutput,
FormulaTemplate& aTemplate, const OUString& sFormula,
GroupedBy aGroupedBy, ScRange* pResultRange);
......@@ -48,12 +48,11 @@ private:
public:
ScAnalysisOfVarianceDialog(
SfxBindings* pB, SfxChildWindow* pCW,
vcl::Window* pParent, ScViewData* pViewData );
weld::Window* pParent, ScViewData* pViewData );
virtual ~ScAnalysisOfVarianceDialog() override;
virtual void dispose() override;
virtual bool Close() override;
virtual void Close() override;
protected:
virtual const char* GetUndoNameId() override;
......
......@@ -72,7 +72,7 @@ private:
};
class ScAnalysisOfVarianceDialogWrapper :
public ChildWindowWrapper<SID_ANALYSIS_OF_VARIANCE_DIALOG>
public ChildControllerWrapper<SID_ANALYSIS_OF_VARIANCE_DIALOG>
{
private:
ScAnalysisOfVarianceDialogWrapper() = delete;
......
......@@ -330,12 +330,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
}
break;
case SID_ANALYSIS_OF_VARIANCE_DIALOG:
{
pResult = VclPtr<ScAnalysisOfVarianceDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_COVARIANCE_DIALOG:
{
pResult = VclPtr<ScCovarianceDialog>::Create( pB, pCW, pParent, &GetViewData() );
......@@ -536,6 +530,11 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
xResult.reset(new ScDescriptiveStatisticsDialog(pB, pCW, pParent, &GetViewData()));
}
break;
case SID_ANALYSIS_OF_VARIANCE_DIALOG:
{
xResult.reset(new ScAnalysisOfVarianceDialog(pB, pCW, pParent, &GetViewData()));
}
break;
}
if (xResult)
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkAdjustment" id="alpha-adjustment">
<property name="lower">0.01</property>
<property name="upper">0.98999999999999999</property>
......@@ -15,7 +14,12 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="analysisofvariancedialog|AnalysisOfVarianceDialog">Analysis of Variance (ANOVA)</property>
<property name="resizable">False</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
......@@ -104,10 +108,10 @@
<object class="GtkLabel" id="input-range-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="analysisofvariancedialog|input-range-label">Input range:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">input-range-edit</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -118,10 +122,10 @@
<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" context="analysisofvariancedialog|output-range-label">Results to:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">output-range-edit</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -129,11 +133,12 @@
</packing>
</child>
<child>
<object class="foruilo-RefEdit" id="input-range-edit">
<object class="GtkEntry" id="input-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="activates_default">True</property>
<property name="width_chars">30</property>
</object>
<packing>
......@@ -142,11 +147,12 @@
</packing>
</child>
<child>
<object class="foruilo-RefEdit" id="output-range-edit">
<object class="GtkEntry" 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="activates_default">True</property>
<property name="width_chars">30</property>
</object>
<packing>
......@@ -155,7 +161,7 @@
</packing>
</child>
<child>
<object class="foruilo-RefButton" id="input-range-button">
<object class="GtkButton" id="input-range-button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
......@@ -166,7 +172,7 @@
</packing>
</child>
<child>
<object class="foruilo-RefButton" id="output-range-button">
<object class="GtkButton" id="output-range-button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
......@@ -225,8 +231,8 @@
<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>
<property name="group">radio-two-factor</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -300,7 +306,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">groupedby-rows-radio</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -369,10 +374,10 @@
<object class="GtkLabel" id="alpha-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="analysisofvariancedialog|alpha-label">Alpha:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">alpha-spin</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -383,6 +388,7 @@
<object class="GtkSpinButton" id="alpha-spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="text" translatable="yes" context="analysisofvariancedialog|alpha-spin">0,05</property>
<property name="adjustment">alpha-adjustment</property>
<property name="digits">2</property>
......@@ -397,10 +403,10 @@
<object class="GtkLabel" id="rows-per-sample-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="analysisofvariancedialog|rows-per-sample-label">Rows per sample:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">rows-per-sample-spin</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -411,6 +417,7 @@
<object class="GtkSpinButton" id="rows-per-sample-spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="text">1</property>
<property name="value">1</property>
</object>
......@@ -444,6 +451,7 @@
</child>
<action-widgets>
<action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
</object>
......
......@@ -7,6 +7,8 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="correlationdialog|CorrelationDialog">Correlation</property>
<property name="resizable">False</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
......@@ -128,6 +130,7 @@
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="width_chars">30</property>
</object>
<packing>
......@@ -141,6 +144,7 @@
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="width_chars">30</property>
</object>
<packing>
......
......@@ -117,6 +117,7 @@
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="width_chars">30</property>
</object>
<packing>
......@@ -155,6 +156,7 @@
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="width_chars">30</property>
</object>
<packing>
......
......@@ -129,6 +129,7 @@
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="width_chars">30</property>
</object>
<packing>
......@@ -167,6 +168,7 @@
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="width_chars">30</property>
</object>
<packing>
......@@ -231,6 +233,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="text">1</property>
<property name="adjustment">sample-size-adjustment</property>
<property name="update_policy">if-valid</property>
......@@ -298,6 +301,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="text">1</property>
<property name="adjustment">period-adjustment</property>
<property name="update_policy">if-valid</property>
......
sc/uiconfig/scalc/ui/advancedfilterdialog.ui://foruilo-RefEdit[@id='edfilterarea'] no-labelled-by
sc/uiconfig/scalc/ui/advancedfilterdialog.ui://GtkLabel[@id='dbarealabel'] orphan-label
sc/uiconfig/scalc/ui/advancedfilterdialog.ui://GtkLabel[@id='dbarea'] orphan-label
sc/uiconfig/scalc/ui/analysisofvariancedialog.ui://GtkButton[@id='input-range-button'] button-no-label
sc/uiconfig/scalc/ui/analysisofvariancedialog.ui://GtkButton[@id='output-range-button'] button-no-label
sc/uiconfig/scalc/ui/cellprotectionpage.ui://GtkLabel[@id='label1'] orphan-label
sc/uiconfig/scalc/ui/cellprotectionpage.ui://GtkLabel[@id='label4'] orphan-label
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkLabel[@id='number'] orphan-label
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment