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

weld ScSamplingDialog

Change-Id: Ifbae09b2d2b6ebf0c56332ef4f87f3045f97f1ad
Reviewed-on: https://gerrit.libreoffice.org/70503
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e0fde234
......@@ -17,41 +17,21 @@
#include <vcl/fixed.hxx>
class ScSamplingDialog : public ScAnyRefDlg
class ScSamplingDialog : public ScAnyRefDlgController
{
public:
ScSamplingDialog(
SfxBindings* pB, SfxChildWindow* pCW,
vcl::Window* pParent, ScViewData* pViewData );
weld::Window* pParent, ScViewData* pViewData );
virtual ~ScSamplingDialog() override;
virtual void dispose() override;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
virtual void SetActive() override;
virtual bool Close() override;
virtual void Close() override;
private:
// Widgets
VclPtr<FixedText> mpInputRangeLabel;
VclPtr<formula::RefEdit> mpInputRangeEdit;
VclPtr<formula::RefButton> mpInputRangeButton;
VclPtr<FixedText> mpOutputRangeLabel;
VclPtr<formula::RefEdit> mpOutputRangeEdit;
VclPtr<formula::RefButton> mpOutputRangeButton;
VclPtr<NumericField> mpSampleSize;
VclPtr<NumericField> mpPeriod;
VclPtr<RadioButton> mpRandomMethodRadio;
VclPtr<CheckBox> mpWithReplacement;
VclPtr<CheckBox> mpKeepOrder;
VclPtr<RadioButton> mpPeriodicMethodRadio;
VclPtr<OKButton> mpButtonOk;
VclPtr<formula::RefEdit> mpActiveEdit;
formula::WeldRefEdit* mpActiveEdit;
// Data
ScViewData* const mViewData;
......@@ -68,6 +48,25 @@ private:
bool mDialogLostFocus;
// 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::SpinButton> mxSampleSize;
std::unique_ptr<weld::SpinButton> mxPeriod;
std::unique_ptr<weld::RadioButton> mxRandomMethodRadio;
std::unique_ptr<weld::CheckButton> mxWithReplacement;
std::unique_ptr<weld::CheckButton> mxKeepOrder;
std::unique_ptr<weld::RadioButton> mxPeriodicMethodRadio;
std::unique_ptr<weld::Button> mxButtonOk;
void Init();
void GetRangeFromSelection();
void PerformSampling();
......@@ -78,14 +77,16 @@ private:
ScRange PerformRandomSamplingKeepOrder(ScDocShell* pDocShell);
ScRange PerformPeriodicSampling(ScDocShell* pDocShell);
DECL_LINK( OkClicked, Button*, void );
DECL_LINK( GetFocusHandler, Control&, void );
DECL_LINK( LoseFocusHandler, Control&, void );
DECL_LINK( SamplingSizeValueModified, Edit&, void );
DECL_LINK( PeriodValueModified, Edit&, void );
DECL_LINK( ToggleSamplingMethod, RadioButton&, void );
DECL_LINK( RefInputModifyHandler, Edit&, void );
DECL_LINK( CheckHdl, Button*, 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( SamplingSizeValueModified, weld::SpinButton&, void );
DECL_LINK( PeriodValueModified, weld::SpinButton&, void );
DECL_LINK( ToggleSamplingMethod, weld::ToggleButton&, void );
DECL_LINK( RefInputModifyHandler, formula::WeldRefEdit&, void );
DECL_LINK( CheckHdl, weld::Button&, void );
void ToggleSamplingMethod();
};
......
......@@ -58,7 +58,7 @@ private:
};
class ScSamplingDialogWrapper :
public ChildWindowWrapper<SID_SAMPLING_DIALOG>
public ChildControllerWrapper<SID_SAMPLING_DIALOG>
{
private:
ScSamplingDialogWrapper() = delete;
......
......@@ -330,12 +330,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
}
break;
case SID_SAMPLING_DIALOG:
{
pResult = VclPtr<ScSamplingDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_DESCRIPTIVE_STATISTICS_DIALOG:
{
pResult = VclPtr<ScDescriptiveStatisticsDialog>::Create( pB, pCW, pParent, &GetViewData() );
......@@ -538,6 +532,11 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
xResult.reset(new ScCorrelationDialog(pB, pCW, pParent, &GetViewData()));
}
break;
case SID_SAMPLING_DIALOG:
{
xResult.reset(new ScSamplingDialog(pB, pCW, pParent, &GetViewData()));
}
break;
}
if (xResult)
......
......@@ -2,7 +2,6 @@
<!-- 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="period-adjustment">
<property name="lower">1</property>
<property name="upper">100</property>
......@@ -20,6 +19,8 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="samplingdialog|SamplingDialog">Sampling</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/>
......@@ -123,7 +124,7 @@
</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>
......@@ -136,7 +137,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>
......@@ -161,7 +162,7 @@
</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>
......@@ -174,7 +175,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>
......@@ -266,8 +267,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">periodic-method-radio</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -381,6 +382,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>
......
......@@ -164,6 +164,8 @@ sc/uiconfig/scalc/ui/protectsheetdlg.ui://GtkLabel[@id='delete-rows'] orphan-lab
sc/uiconfig/scalc/ui/regressiondialog.ui://GtkLabel[@id='error-message'] orphan-label
sc/uiconfig/scalc/ui/retypepassdialog.ui://GtkLabel[@id='descLabel'] orphan-label
sc/uiconfig/scalc/ui/retypepassdialog.ui://GtkLabel[@id='docStatusLabel'] orphan-label
sc/uiconfig/scalc/ui/samplingdialog.ui://GtkButton[@id='input-range-button'] button-no-label
sc/uiconfig/scalc/ui/samplingdialog.ui://GtkButton[@id='output-range-button'] button-no-label
sc/uiconfig/scalc/ui/standardfilterdialog.ui://GtkComboBoxText[@id='connect1'] missing-label-for
sc/uiconfig/scalc/ui/standardfilterdialog.ui://GtkComboBoxText[@id='connect2'] missing-label-for
sc/uiconfig/scalc/ui/standardfilterdialog.ui://GtkLabel[@id='label2'] 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