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
......
......@@ -31,7 +31,7 @@
// class ScFillSeriesDlg
ScFillSeriesDlg::ScFillSeriesDlg( vcl::Window* pParent,
ScFillSeriesDlg::ScFillSeriesDlg( weld::Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
......@@ -40,118 +40,91 @@ ScFillSeriesDlg::ScFillSeriesDlg( vcl::Window* pParent,
double fStep,
double fMax,
sal_uInt16 nPossDir )
: ModalDialog(pParent, "FillSeriesDialog", "modules/scalc/ui/filldlg.ui"),
aStartStrVal ( aStartStr),
aErrMsgInvalidVal( ScResId(SCSTR_VALERR) ),
rDoc ( rDocument ),
theFillDir ( eFillDir ),
theFillCmd ( eFillCmd ),
theFillDateCmd ( eFillDateCmd ),
fIncrement ( fStep ),
fEndVal ( fMax )
: GenericDialogController(pParent, "modules/scalc/ui/filldlg.ui", "FillSeriesDialog")
, aStartStrVal(aStartStr)
, aErrMsgInvalidVal(ScResId(SCSTR_VALERR))
, rDoc(rDocument)
, theFillDir(eFillDir)
, theFillCmd(eFillCmd)
, theFillDateCmd(eFillDateCmd)
, fIncrement(fStep)
, fEndVal(fMax)
, m_xFtStartVal(m_xBuilder->weld_label("startL"))
, m_xEdStartVal(m_xBuilder->weld_entry("startValue"))
, m_xFtEndVal(m_xBuilder->weld_label("endL"))
, m_xEdEndVal(m_xBuilder->weld_entry("endValue"))
, m_xFtIncrement(m_xBuilder->weld_label("incrementL"))
, m_xEdIncrement(m_xBuilder->weld_entry("increment"))
, m_xBtnDown(m_xBuilder->weld_radio_button("down"))
, m_xBtnRight(m_xBuilder->weld_radio_button("right"))
, m_xBtnUp(m_xBuilder->weld_radio_button("up"))
, m_xBtnLeft(m_xBuilder->weld_radio_button("left"))
, m_xBtnArithmetic(m_xBuilder->weld_radio_button("linear"))
, m_xBtnGeometric(m_xBuilder->weld_radio_button("growth"))
, m_xBtnDate(m_xBuilder->weld_radio_button("date"))
, m_xBtnAutoFill(m_xBuilder->weld_radio_button("autofill"))
, m_xFtTimeUnit(m_xBuilder->weld_label("tuL"))
, m_xBtnDay(m_xBuilder->weld_radio_button("day"))
, m_xBtnDayOfWeek(m_xBuilder->weld_radio_button("week"))
, m_xBtnMonth(m_xBuilder->weld_radio_button("month"))
, m_xBtnYear(m_xBuilder->weld_radio_button("year"))
, m_xBtnOk(m_xBuilder->weld_button("ok"))
{
get(m_pFtStartVal, "startL");
get(m_pEdStartVal, "startValue");
get(m_pFtEndVal, "endL");
get(m_pEdEndVal, "endValue");
get(m_pFtIncrement, "incrementL");
get(m_pEdIncrement, "increment");
get(m_pBtnDown, "down");
get(m_pBtnRight, "right");
get(m_pBtnUp, "up");
get(m_pBtnLeft, "left");
get(m_pBtnArithmetic, "linear");
get(m_pBtnGeometric, "growth");
get(m_pBtnDate, "date");
get(m_pBtnAutoFill, "autofill");
get(m_pFtTimeUnit, "tuL");
get(m_pBtnDay, "day");
get(m_pBtnDayOfWeek, "week");
get(m_pBtnMonth, "month");
get(m_pBtnYear, "year");
get(m_pBtnOk, "ok");
Init( nPossDir );
Init(nPossDir);
}
ScFillSeriesDlg::~ScFillSeriesDlg()
{
disposeOnce();
}
void ScFillSeriesDlg::dispose()
{
m_pFtStartVal.clear();
m_pEdStartVal.clear();
m_pFtEndVal.clear();
m_pEdEndVal.clear();
m_pFtIncrement.clear();
m_pEdIncrement.clear();
m_pBtnDown.clear();
m_pBtnRight.clear();
m_pBtnUp.clear();
m_pBtnLeft.clear();
m_pBtnArithmetic.clear();
m_pBtnGeometric.clear();
m_pBtnDate.clear();
m_pBtnAutoFill.clear();
m_pFtTimeUnit.clear();
m_pBtnDay.clear();
m_pBtnDayOfWeek.clear();
m_pBtnMonth.clear();
m_pBtnYear.clear();
m_pBtnOk.clear();
ModalDialog::dispose();
}
void ScFillSeriesDlg::SetEdStartValEnabled(bool bFlag)
{
if(bFlag)
{
m_pFtStartVal->Enable();
m_pEdStartVal->Enable();
m_xFtStartVal->set_sensitive(true);
m_xEdStartVal->set_sensitive(true);
}
else
{
m_pFtStartVal->Disable();
m_pEdStartVal->Disable();
m_xFtStartVal->set_sensitive(false);
m_xEdStartVal->set_sensitive(false);
}
}
void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
{
m_pBtnOk->SetClickHdl ( LINK( this, ScFillSeriesDlg, OKHdl ) );
m_pBtnArithmetic->SetClickHdl ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
m_pBtnGeometric->SetClickHdl ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
m_pBtnDate->SetClickHdl ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
m_pBtnAutoFill->SetClickHdl ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
m_xBtnOk->connect_clicked ( LINK( this, ScFillSeriesDlg, OKHdl ) );
m_xBtnArithmetic->connect_toggled ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
m_xBtnGeometric->connect_toggled ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
m_xBtnDate->connect_toggled ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
m_xBtnAutoFill->connect_toggled ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
if( nPossDir == FDS_OPT_NONE )
{
m_pBtnLeft->Disable();
m_pBtnRight->Disable();
m_pBtnDown->Disable();
m_pBtnUp->Disable();
m_xBtnLeft->set_sensitive(false);
m_xBtnRight->set_sensitive(false);
m_xBtnDown->set_sensitive(false);
m_xBtnUp->set_sensitive(false);
}
if( nPossDir == FDS_OPT_HORZ )
{
m_pBtnDown->Disable();
m_pBtnUp->Disable();
m_xBtnDown->set_sensitive(false);
m_xBtnUp->set_sensitive(false);
}
if( nPossDir == FDS_OPT_VERT )
{
m_pBtnLeft->Disable();
m_pBtnRight->Disable();
m_xBtnLeft->set_sensitive(false);
m_xBtnRight->set_sensitive(false);
}
switch ( theFillDir )
{
case FILL_TO_LEFT: m_pBtnLeft->Check(); break;
case FILL_TO_RIGHT: m_pBtnRight->Check(); break;
case FILL_TO_BOTTOM: m_pBtnDown->Check(); break;
case FILL_TO_TOP: m_pBtnUp->Check(); break;
case FILL_TO_LEFT: m_xBtnLeft->set_active(true); break;
case FILL_TO_RIGHT: m_xBtnRight->set_active(true); break;
case FILL_TO_BOTTOM: m_xBtnDown->set_active(true); break;
case FILL_TO_TOP: m_xBtnUp->set_active(true); break;
default:
break;
}
......@@ -159,20 +132,20 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
switch ( theFillCmd )
{
case FILL_LINEAR:
m_pBtnArithmetic->Check();
DisableHdl( m_pBtnArithmetic );
m_xBtnArithmetic->set_active(true);
DisableHdl(*m_xBtnArithmetic);
break;
case FILL_GROWTH:
m_pBtnGeometric->Check();
DisableHdl( m_pBtnGeometric );
m_xBtnGeometric->set_active(true);
DisableHdl(*m_xBtnGeometric );
break;
case FILL_DATE:
m_pBtnDate->Check();
DisableHdl( m_pBtnDate );
m_xBtnDate->set_active(true);
DisableHdl(*m_xBtnDate);
break;
case FILL_AUTO:
m_pBtnAutoFill->Check();
DisableHdl( m_pBtnAutoFill );
m_xBtnAutoFill->set_active(true);
DisableHdl(*m_xBtnAutoFill);
break;
default:
break;
......@@ -180,34 +153,34 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
switch ( theFillDateCmd )
{
case FILL_DAY: m_pBtnDay->Check(); break;
case FILL_WEEKDAY: m_pBtnDayOfWeek->Check(); break;
case FILL_MONTH: m_pBtnMonth->Check(); break;
case FILL_YEAR: m_pBtnYear->Check(); break;
case FILL_DAY: m_xBtnDay->set_active(true); break;
case FILL_WEEKDAY: m_xBtnDayOfWeek->set_active(true); break;
case FILL_MONTH: m_xBtnMonth->set_active(true); break;
case FILL_YEAR: m_xBtnYear->set_active(true); break;
default:
break;
}
fStartVal = MAXDOUBLE;
m_pEdStartVal->SetText( aStartStrVal);
m_xEdStartVal->set_text( aStartStrVal);
OUString aIncrTxt;
rDoc.GetFormatTable()->GetInputLineString( fIncrement, 0, aIncrTxt );
m_pEdIncrement->SetText( aIncrTxt );
m_xEdIncrement->set_text( aIncrTxt );
OUString aEndTxt;
if ( fEndVal != MAXDOUBLE )
rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt );
m_pEdEndVal->SetText( aEndTxt );
m_xEdEndVal->set_text( aEndTxt );
}
bool ScFillSeriesDlg::CheckStartVal()
{
bool bValOk = false;
OUString aStr = m_pEdStartVal->GetText();
OUString aStr = m_xEdStartVal->get_text();
if ( aStr.isEmpty() || m_pBtnAutoFill->IsChecked())
if ( aStr.isEmpty() || m_xBtnAutoFill->get_active())
{
fStartVal = MAXDOUBLE;
bValOk = true;
......@@ -223,7 +196,7 @@ bool ScFillSeriesDlg::CheckStartVal()
bool ScFillSeriesDlg::CheckIncrementVal()
{
sal_uInt32 nKey = 0;
OUString aStr = m_pEdIncrement->GetText();
OUString aStr = m_xEdIncrement->get_text();
return rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fIncrement );
}
......@@ -231,7 +204,7 @@ bool ScFillSeriesDlg::CheckIncrementVal()
bool ScFillSeriesDlg::CheckEndVal()
{
bool bValOk = false;
OUString aStr = m_pEdEndVal->GetText();
OUString aStr = m_xEdEndVal->get_text();
if (aStr.isEmpty())
{
......@@ -247,84 +220,83 @@ bool ScFillSeriesDlg::CheckEndVal()
}
// Handler:
IMPL_LINK( ScFillSeriesDlg, DisableHdl, Button *, pBtn, void )
IMPL_LINK(ScFillSeriesDlg, DisableHdl, weld::ToggleButton&, rBtn, void)
{
if ( pBtn == m_pBtnDate )
if (&rBtn == m_xBtnDate.get())
{
m_pBtnDay->Enable();
m_pBtnDayOfWeek->Enable();
m_pBtnMonth->Enable();
m_pBtnYear->Enable();
m_pFtTimeUnit->Enable();
m_xBtnDay->set_sensitive(true);
m_xBtnDayOfWeek->set_sensitive(true);
m_xBtnMonth->set_sensitive(true);
m_xBtnYear->set_sensitive(true);
m_xFtTimeUnit->set_sensitive(true);
}
else
{
m_pBtnDay->Disable();
m_pBtnDayOfWeek->Disable();
m_pBtnMonth->Disable();
m_pBtnYear->Disable();
m_pFtTimeUnit->Disable();
m_xBtnDay->set_sensitive(false);
m_xBtnDayOfWeek->set_sensitive(false);
m_xBtnMonth->set_sensitive(false);
m_xBtnYear->set_sensitive(false);
m_xFtTimeUnit->set_sensitive(false);
}
if ( pBtn != m_pBtnAutoFill )
if (&rBtn != m_xBtnAutoFill.get())
{
m_pFtIncrement->Enable();
m_pEdIncrement->Enable();
m_pFtEndVal->Enable();
m_pEdEndVal->Enable();
m_xFtIncrement->set_sensitive(true);
m_xEdIncrement->set_sensitive(true);
m_xFtEndVal->set_sensitive(true);
m_xEdEndVal->set_sensitive(true);
}
else
{
m_pFtIncrement->Disable();
m_pEdIncrement->Disable();
m_pFtEndVal->Disable();
m_pEdEndVal->Disable();
m_xFtIncrement->set_sensitive(false);
m_xEdIncrement->set_sensitive(false);
m_xFtEndVal->set_sensitive(false);
m_xEdEndVal->set_sensitive(false);
}
}
IMPL_LINK_NOARG(ScFillSeriesDlg, OKHdl, Button*, void)
IMPL_LINK_NOARG(ScFillSeriesDlg, OKHdl, weld::Button&, void)
{
if ( m_pBtnLeft->IsChecked() ) theFillDir = FILL_TO_LEFT;
else if ( m_pBtnRight->IsChecked() ) theFillDir = FILL_TO_RIGHT;
else if ( m_pBtnDown->IsChecked() ) theFillDir = FILL_TO_BOTTOM;
else if ( m_pBtnUp->IsChecked() ) theFillDir = FILL_TO_TOP;
if ( m_xBtnLeft->get_active() ) theFillDir = FILL_TO_LEFT;
else if ( m_xBtnRight->get_active() ) theFillDir = FILL_TO_RIGHT;
else if ( m_xBtnDown->get_active() ) theFillDir = FILL_TO_BOTTOM;
else if ( m_xBtnUp->get_active() ) theFillDir = FILL_TO_TOP;
if ( m_pBtnArithmetic->IsChecked() ) theFillCmd = FILL_LINEAR;
else if ( m_pBtnGeometric->IsChecked() ) theFillCmd = FILL_GROWTH;
else if ( m_pBtnDate->IsChecked() ) theFillCmd = FILL_DATE;
else if ( m_pBtnAutoFill->IsChecked() ) theFillCmd = FILL_AUTO;
if ( m_xBtnArithmetic->get_active() ) theFillCmd = FILL_LINEAR;
else if ( m_xBtnGeometric->get_active() ) theFillCmd = FILL_GROWTH;
else if ( m_xBtnDate->get_active() ) theFillCmd = FILL_DATE;
else if ( m_xBtnAutoFill->get_active() ) theFillCmd = FILL_AUTO;
if ( m_pBtnDay->IsChecked() ) theFillDateCmd = FILL_DAY;
else if ( m_pBtnDayOfWeek->IsChecked() ) theFillDateCmd = FILL_WEEKDAY;
else if ( m_pBtnMonth->IsChecked() ) theFillDateCmd = FILL_MONTH;
else if ( m_pBtnYear->IsChecked() ) theFillDateCmd = FILL_YEAR;
if ( m_xBtnDay->get_active() ) theFillDateCmd = FILL_DAY;
else if ( m_xBtnDayOfWeek->get_active() ) theFillDateCmd = FILL_WEEKDAY;
else if ( m_xBtnMonth->get_active() ) theFillDateCmd = FILL_MONTH;
else if ( m_xBtnYear->get_active() ) theFillDateCmd = FILL_YEAR;
bool bAllOk = true;
Edit* pEdWrong = nullptr;
weld::Entry* pEdWrong = nullptr;
if ( !CheckStartVal() )
{
bAllOk = false;
pEdWrong = m_pEdStartVal;
pEdWrong = m_xEdStartVal.get();
}
else if ( !CheckIncrementVal() )
{
bAllOk = false;
pEdWrong = m_pEdIncrement;
pEdWrong = m_xEdIncrement.get();
}
else if ( !CheckEndVal() )
{
bAllOk = false;
pEdWrong = m_pEdEndVal;
pEdWrong = m_xEdEndVal.get();
}
if ( bAllOk )
EndDialog( RET_OK );
m_xDialog->response(RET_OK);
else
{
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Warning,
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning,
VclButtonsType::Ok, aErrMsgInvalidVal));
xBox->run();
pEdWrong->GrabFocus();
pEdWrong->grab_focus();
}
}
......
......@@ -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