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

weld ScFillSeriesDlg

Change-Id: I1b4c6777d3334813c6bfe47efbb67f065efa555c
Reviewed-on: https://gerrit.libreoffice.org/54338Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 0e4f93e8
......@@ -429,7 +429,7 @@ public:
ScTabViewShell* pTabViewShell) = 0;
virtual VclPtr<AbstractScDeleteContentsDlg> CreateScDeleteContentsDlg(weld::Window* pParent) = 0;
virtual VclPtr<AbstractScFillSeriesDlg> CreateScFillSeriesDlg( vcl::Window* pParent,
virtual VclPtr<AbstractScFillSeriesDlg> CreateScFillSeriesDlg(weld::Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
......
......@@ -96,7 +96,10 @@ short AbstractScDeleteContentsDlg_Impl::Execute()
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl);
short AbstractScFillSeriesDlg_Impl::Execute()
{
return m_xDlg->run();
}
short AbstractScGroupDlg_Impl::Execute()
{
......@@ -289,42 +292,42 @@ InsertDeleteFlags AbstractScDeleteContentsDlg_Impl::GetDelContentsCmdBits() cons
FillDir AbstractScFillSeriesDlg_Impl::GetFillDir() const
{
return pDlg->GetFillDir();
return m_xDlg->GetFillDir();
}
FillCmd AbstractScFillSeriesDlg_Impl::GetFillCmd() const
{
return pDlg->GetFillCmd();
return m_xDlg->GetFillCmd();
}
FillDateCmd AbstractScFillSeriesDlg_Impl::GetFillDateCmd() const
{
return pDlg->GetFillDateCmd();
return m_xDlg->GetFillDateCmd();
}
double AbstractScFillSeriesDlg_Impl::GetStart() const
{
return pDlg->GetStart();
return m_xDlg->GetStart();
}
double AbstractScFillSeriesDlg_Impl::GetStep() const
{
return pDlg->GetStep();
return m_xDlg->GetStep();
}
double AbstractScFillSeriesDlg_Impl::GetMax() const
{
return pDlg->GetMax();
return m_xDlg->GetMax();
}
OUString AbstractScFillSeriesDlg_Impl::GetStartStr() const
{
return pDlg->GetStartStr();
return m_xDlg->GetStartStr();
}
void AbstractScFillSeriesDlg_Impl::SetEdStartValEnabled(bool bFlag)
{
pDlg->SetEdStartValEnabled(bFlag);
m_xDlg->SetEdStartValEnabled(bFlag);
}
bool AbstractScGroupDlg_Impl::GetColsChecked() const
......@@ -724,7 +727,7 @@ VclPtr<AbstractScDeleteContentsDlg> ScAbstractDialogFactory_Impl::CreateScDelete
return VclPtr<AbstractScDeleteContentsDlg_Impl>::Create(new ScDeleteContentsDlg(pParent));
}
VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( vcl::Window* pParent,
VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg(weld::Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
......@@ -734,8 +737,7 @@ VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeries
double fMax,
sal_uInt16 nPossDir)
{
VclPtr<ScFillSeriesDlg> pDlg = VclPtr<ScFillSeriesDlg>::Create( pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nPossDir);
return VclPtr<AbstractScFillSeriesDlg_Impl>::Create( pDlg );
return VclPtr<AbstractScFillSeriesDlg_Impl>::Create(new ScFillSeriesDlg(pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nPossDir));
}
VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup)
......
......@@ -193,7 +193,13 @@ public:
class AbstractScFillSeriesDlg_Impl:public AbstractScFillSeriesDlg
{
DECL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl, ScFillSeriesDlg)
std::unique_ptr<ScFillSeriesDlg> m_xDlg;
public:
explicit AbstractScFillSeriesDlg_Impl(ScFillSeriesDlg* p)
: m_xDlg(p)
{
}
virtual short Execute() override;
virtual FillDir GetFillDir() const override;
virtual FillCmd GetFillCmd() const override;
virtual FillDateCmd GetFillDateCmd() const override;
......@@ -485,7 +491,7 @@ public:
virtual VclPtr<AbstractScDeleteContentsDlg> CreateScDeleteContentsDlg(weld::Window* pParent) override;
virtual VclPtr<AbstractScFillSeriesDlg> CreateScFillSeriesDlg( vcl::Window* pParent,
virtual VclPtr<AbstractScFillSeriesDlg> CreateScFillSeriesDlg(weld::Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
......
......@@ -20,30 +20,26 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_FILLDLG_HXX
#define INCLUDED_SC_SOURCE_UI_INC_FILLDLG_HXX
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
#include <vcl/weld.hxx>
#include <global.hxx>
class ScDocument;
#include "scui_def.hxx"
class ScFillSeriesDlg : public ModalDialog
class ScFillSeriesDlg : public weld::GenericDialogController
{
public:
ScFillSeriesDlg( vcl::Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
FillDateCmd eFillDateCmd,
const OUString& aStartStr,
double fStep,
double fMax,
sal_uInt16 nPossDir );
virtual ~ScFillSeriesDlg() override;
virtual void dispose() override;
ScFillSeriesDlg( weld::Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
FillDateCmd eFillDateCmd,
const OUString& aStartStr,
double fStep,
double fMax,
sal_uInt16 nPossDir );
virtual ~ScFillSeriesDlg() override;
FillDir GetFillDir() const { return theFillDir; }
FillCmd GetFillCmd() const { return theFillCmd; }
......@@ -52,38 +48,12 @@ public:
double GetStep() const { return fIncrement; }
double GetMax() const { return fEndVal; }
OUString GetStartStr() const { return m_pEdStartVal->GetText(); }
OUString GetStartStr() const { return m_xEdStartVal->get_text(); }
void SetEdStartValEnabled(bool bFlag);
private:
VclPtr<FixedText> m_pFtStartVal;
VclPtr<Edit> m_pEdStartVal;
const OUString aStartStrVal;
VclPtr<FixedText> m_pFtEndVal;
VclPtr<Edit> m_pEdEndVal;
VclPtr<FixedText> m_pFtIncrement;
VclPtr<Edit> m_pEdIncrement;
VclPtr<RadioButton> m_pBtnDown;
VclPtr<RadioButton> m_pBtnRight;
VclPtr<RadioButton> m_pBtnUp;
VclPtr<RadioButton> m_pBtnLeft;
VclPtr<RadioButton> m_pBtnArithmetic;
VclPtr<RadioButton> m_pBtnGeometric;
VclPtr<RadioButton> m_pBtnDate;
VclPtr<RadioButton> m_pBtnAutoFill;
VclPtr<FixedText> m_pFtTimeUnit;
VclPtr<RadioButton> m_pBtnDay;
VclPtr<RadioButton> m_pBtnDayOfWeek;
VclPtr<RadioButton> m_pBtnMonth;
VclPtr<RadioButton> m_pBtnYear;
VclPtr<OKButton> m_pBtnOk;
const OUString aErrMsgInvalidVal;
ScDocument& rDoc;
......@@ -94,13 +64,39 @@ private:
double fIncrement;
double fEndVal;
std::unique_ptr<weld::Label> m_xFtStartVal;
std::unique_ptr<weld::Entry> m_xEdStartVal;
std::unique_ptr<weld::Label> m_xFtEndVal;
std::unique_ptr<weld::Entry> m_xEdEndVal;
std::unique_ptr<weld::Label> m_xFtIncrement;
std::unique_ptr<weld::Entry> m_xEdIncrement;
std::unique_ptr<weld::RadioButton> m_xBtnDown;
std::unique_ptr<weld::RadioButton> m_xBtnRight;
std::unique_ptr<weld::RadioButton> m_xBtnUp;
std::unique_ptr<weld::RadioButton> m_xBtnLeft;
std::unique_ptr<weld::RadioButton> m_xBtnArithmetic;
std::unique_ptr<weld::RadioButton> m_xBtnGeometric;
std::unique_ptr<weld::RadioButton> m_xBtnDate;
std::unique_ptr<weld::RadioButton> m_xBtnAutoFill;
std::unique_ptr<weld::Label> m_xFtTimeUnit;
std::unique_ptr<weld::RadioButton> m_xBtnDay;
std::unique_ptr<weld::RadioButton> m_xBtnDayOfWeek;
std::unique_ptr<weld::RadioButton> m_xBtnMonth;
std::unique_ptr<weld::RadioButton> m_xBtnYear;
std::unique_ptr<weld::Button> m_xBtnOk;
void Init( sal_uInt16 nPossDir );
bool CheckStartVal();
bool CheckIncrementVal();
bool CheckEndVal();
DECL_LINK( OKHdl, Button*, void );
DECL_LINK( DisableHdl, Button*, void );
DECL_LINK(OKHdl, weld::Button&, void);
DECL_LINK(DisableHdl, weld::ToggleButton&, void);
};
#endif // INCLUDED_SC_SOURCE_UI_INC_FILLDLG_HXX
......
......@@ -721,7 +721,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
ScopedVclPtr<AbstractScFillSeriesDlg> pDlg(pFact->CreateScFillSeriesDlg( pTabViewShell->GetDialogParent(),
ScopedVclPtr<AbstractScFillSeriesDlg> pDlg(pFact->CreateScFillSeriesDlg( pTabViewShell->GetFrameWeld(),
*pDoc,
eFillDir, eFillCmd, eFillDateCmd,
aStartStr, fIncVal, fMaxVal,
......
<?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"/>
<object class="GtkDialog" id="FillSeriesDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="filldlg|FillSeriesDialog">Fill Series</property>
<property name="modal">True</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>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="layout_style">start</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
......@@ -58,6 +64,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
......@@ -105,7 +112,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">right</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -122,7 +128,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">up</property>
<property name="group">down</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -139,7 +145,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">left</property>
<property name="group">down</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -216,7 +222,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">growth</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -233,7 +238,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">date</property>
<property name="group">linear</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -250,7 +255,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">autofill</property>
<property name="group">linear</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -327,7 +332,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">week</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -345,7 +349,7 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">month</property>
<property name="group">day</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -362,7 +366,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">year</property>
<property name="group">day</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -418,10 +422,10 @@
<object class="GtkLabel" id="startL">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="filldlg|startL">_Start value:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">startValue</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -432,10 +436,10 @@
<object class="GtkLabel" id="endL">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="filldlg|endL">End _value:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">endValue</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -446,10 +450,10 @@
<object class="GtkLabel" id="incrementL">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="filldlg|incrementL">In_crement:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">increment</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -460,6 +464,7 @@
<object class="GtkEntry" id="startValue">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -470,6 +475,7 @@
<object class="GtkEntry" id="endValue">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -480,6 +486,7 @@
<object class="GtkEntry" id="increment">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
......
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