20#ifdef SC_DLLIMPLEMENTATION
21#undef SC_DLLIMPLEMENTATION
29#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
35const sal_Int32 spnDateParts[] =
37 css::sheet::DataPilotFieldGroupBy::SECONDS,
38 css::sheet::DataPilotFieldGroupBy::MINUTES,
39 css::sheet::DataPilotFieldGroupBy::HOURS,
40 css::sheet::DataPilotFieldGroupBy::DAYS,
41 css::sheet::DataPilotFieldGroupBy::MONTHS,
42 css::sheet::DataPilotFieldGroupBy::QUARTERS,
43 css::sheet::DataPilotFieldGroupBy::YEARS
48 STR_DPFIELD_GROUP_BY_SECONDS,
49 STR_DPFIELD_GROUP_BY_MINUTES,
50 STR_DPFIELD_GROUP_BY_HOURS,
51 STR_DPFIELD_GROUP_BY_DAYS,
52 STR_DPFIELD_GROUP_BY_MONTHS,
53 STR_DPFIELD_GROUP_BY_QUARTERS,
54 STR_DPFIELD_GROUP_BY_YEARS
98 if (!rButton.get_active())
101 if (mrRbAuto.get_active())
104 mrEdValue.set_sensitive(
false);
106 else if (mrRbMan.get_active())
109 mrEdValue.set_sensitive(
true);
110 mrEdValue.grab_focus();
117 , mrEdValue(rEdValue)
134 , mrEdValue(rEdValue)
135 , maNullDate(rNullDate)
153 : GenericDialogController(pParent,
"modules/scalc/ui/groupbynumber.ui",
"PivotTableGroupByNumber")
154 , mxRbAutoStart(m_xBuilder->weld_radio_button(
"auto_start"))
155 , mxRbManStart(m_xBuilder->weld_radio_button(
"manual_start"))
156 , mxEdStart(new
ScDoubleField(m_xBuilder->weld_entry(
"edit_start")))
157 , mxRbAutoEnd(m_xBuilder->weld_radio_button(
"auto_end"))
158 , mxRbManEnd(m_xBuilder->weld_radio_button(
"manual_end"))
159 , mxEdEnd(new
ScDoubleField(m_xBuilder->weld_entry(
"edit_end")))
160 , mxEdBy(new
ScDoubleField(m_xBuilder->weld_entry(
"edit_by")))
161 , maStartHelper(*mxRbAutoStart, *mxRbManStart, *mxEdStart)
162 , maEndHelper(*mxRbAutoEnd, *mxRbManEnd, *mxEdEnd)
172 else if (
mxEdEnd->get_sensitive())
204 : GenericDialogController(pParent,
"modules/scalc/ui/groupbydate.ui",
"PivotTableGroupByDate")
205 , mxRbAutoStart(m_xBuilder->weld_radio_button(
"auto_start"))
206 , mxRbManStart(m_xBuilder->weld_radio_button(
"manual_start"))
207 , mxEdStart(new
SvtCalendarBox(m_xBuilder->weld_menu_button(
"start_date")))
208 , mxRbAutoEnd(m_xBuilder->weld_radio_button(
"auto_end"))
209 , mxRbManEnd(m_xBuilder->weld_radio_button(
"manual_end"))
210 , mxEdEnd(new
SvtCalendarBox(m_xBuilder->weld_menu_button(
"end_date")))
211 , mxRbNumDays(m_xBuilder->weld_radio_button(
"days"))
212 , mxRbUnits(m_xBuilder->weld_radio_button(
"intervals"))
213 , mxEdNumDays(m_xBuilder->weld_spin_button(
"days_value"))
214 , mxLbUnits(m_xBuilder->weld_tree_view(
"interval_list"))
215 , mxBtnOk(m_xBuilder->weld_button(
"ok"))
216 , maStartHelper(*mxRbAutoStart, *mxRbManStart, *mxEdStart, rNullDate)
217 , maEndHelper(*mxRbAutoEnd, *mxRbManEnd, *mxEdEnd, rNullDate)
225 nDatePart = css::sheet::DataPilotFieldGroupBy::MONTHS;
226 for (
size_t nIdx = 0; nIdx <
SAL_N_ELEMENTS(aDatePartResIds); ++nIdx)
238 double fNumDays = rInfo.
mfStep;
241 else if( fNumDays > 32767.0 )
255 else if(
mxEdEnd->get_sensitive() )
295 return css::sheet::DataPilotFieldGroupBy::DAYS;
298 sal_Int32 nDatePart = 0;
301 nDatePart |= spnDateParts[ nIdx ];
307 if (!rButton.get_active())
309 if (mxRbNumDays->get_active())
311 mxLbUnits->set_sensitive(
false);
313 mxEdNumDays->set_sensitive(
true);
314 mxEdNumDays->grab_focus();
315 mxBtnOk->set_sensitive(
true);
317 else if (mxRbUnits->get_active())
319 mxEdNumDays->set_sensitive(
false);
321 mxLbUnits->set_sensitive(
true);
322 mxLbUnits->grab_focus();
void AddDays(sal_Int32 nAddDays)
ScDPDateGroupEditHelper maStartHelper
ScDPDateGroupDlg(weld::Window *pParent, const ScDPNumGroupInfo &rInfo, sal_Int32 nDatePart, const Date &rNullDate)
std::unique_ptr< weld::RadioButton > mxRbNumDays
sal_Int32 GetDatePart() const
std::unique_ptr< weld::RadioButton > mxRbUnits
ScDPNumGroupInfo GetGroupInfo() const
std::unique_ptr< weld::Button > mxBtnOk
std::unique_ptr< weld::SpinButton > mxEdNumDays
ScDPDateGroupEditHelper maEndHelper
virtual ~ScDPDateGroupDlg() override
std::unique_ptr< weld::TreeView > mxLbUnits
std::unique_ptr< SvtCalendarBox > mxEdStart
std::unique_ptr< SvtCalendarBox > mxEdEnd
SvtCalendarBox & mrEdValue
virtual bool ImplGetValue(double &rfValue) const override
ScDPDateGroupEditHelper(weld::RadioButton &rRbAuto, weld::RadioButton &rRbMan, SvtCalendarBox &rEdValue, const Date &rNullDate)
virtual void ImplSetValue(double fValue) override
virtual bool ImplGetValue(double &rfValue) const =0
ScDPGroupEditHelper(weld::RadioButton &rRbAuto, weld::RadioButton &rRbMan, weld::Widget &rEdValue)
weld::RadioButton & mrRbMan
void SetValue(bool bAuto, double fValue)
virtual void ImplSetValue(double fValue)=0
weld::RadioButton & mrRbAuto
virtual ~ScDPNumGroupDlg() override
ScDPNumGroupInfo GetGroupInfo() const
std::unique_ptr< ScDoubleField > mxEdStart
ScDPNumGroupEditHelper maEndHelper
std::unique_ptr< ScDoubleField > mxEdEnd
std::unique_ptr< ScDoubleField > mxEdBy
ScDPNumGroupEditHelper maStartHelper
ScDPNumGroupDlg(weld::Window *pParent, const ScDPNumGroupInfo &rInfo)
virtual void ImplSetValue(double fValue) override
ScDPNumGroupEditHelper(weld::RadioButton &rRbAuto, weld::RadioButton &rRbMan, ScDoubleField &rEdValue)
virtual bool ImplGetValue(double &rfValue) const override
ScDoubleField & mrEdValue
An edit control that contains a double precision floating-point value.
void SetValue(double fValue, sal_Int32 nDecPlaces=12)
bool GetValue(double &rfValue) const
void set_date(const Date &rDate)
virtual void connect_toggled(const Link< Toggleable &, void > &rLink)
virtual bool get_active() const=0
virtual void set_active(bool active)=0
virtual int n_children() const=0
std::pair< const TreeIter &, int > iter_col
virtual TriState get_toggle(int row, int col=-1) const=0
IMPL_LINK_NOARG(ScDPDateGroupDlg, CheckHdl, const weld::TreeView::iter_col &, void)
IMPL_LINK(ScDPGroupEditHelper, ToggleHdl, weld::Toggleable &, rButton, void)
#define LINK(Instance, Class, Member)
#define SAL_N_ELEMENTS(arr)
OUString ScResId(TranslateId aId)