25#include <rtl/math.hxx>
36 :
SfxTabPage(pPage, pController,
"modules/schart/ui/tp_AxisPositions.ui",
"tp_AxisPositions", &rInAttrs)
37 , m_pNumFormatter(nullptr)
38 , m_bCrossingAxisIsCategoryAxis(false)
39 , m_bSupportAxisPositioning(false)
40 , m_bSupportCategoryPositioning(false)
41 , m_xFL_AxisLine(m_xBuilder->weld_frame(
"FL_AXIS_LINE"))
42 , m_xLB_CrossesAt(m_xBuilder->weld_combo_box(
"LB_CROSSES_OTHER_AXIS_AT"))
43 , m_xED_CrossesAt(m_xBuilder->weld_formatted_spin_button(
"EDT_CROSSES_OTHER_AXIS_AT"))
44 , m_xED_CrossesAtCategory(m_xBuilder->weld_combo_box(
"EDT_CROSSES_OTHER_AXIS_AT_CATEGORY"))
45 , m_xFL_Position(m_xBuilder->weld_frame(
"FL_POSITION"))
46 , m_xRB_On(m_xBuilder->weld_radio_button(
"RB_ON"))
47 , m_xRB_Between(m_xBuilder->weld_radio_button(
"RB_BETWEEN"))
48 , m_xFL_Labels(m_xBuilder->weld_frame(
"FL_LABELS"))
49 , m_xLB_PlaceLabels(m_xBuilder->weld_combo_box(
"LB_PLACE_LABELS"))
50 , m_xCB_TicksInner(m_xBuilder->weld_check_button(
"CB_TICKS_INNER"))
51 , m_xCB_TicksOuter(m_xBuilder->weld_check_button(
"CB_TICKS_OUTER"))
52 , m_xCB_MinorInner(m_xBuilder->weld_check_button(
"CB_MINOR_INNER"))
53 , m_xCB_MinorOuter(m_xBuilder->weld_check_button(
"CB_MINOR_OUTER"))
54 , m_xBxPlaceTicks(m_xBuilder->weld_widget(
"boxPLACE_TICKS"))
55 , m_xLB_PlaceTicks(m_xBuilder->weld_combo_box(
"LB_PLACE_TICKS"))
74 return std::make_unique<AxisPositionsTabPage>(pPage, pController, *rOutAttrs);
85 double fCrossover = rCrossFormatter.
GetValue();
102 sal_Int32 nMinorTicks=0;
148 sal_Int32
nPos = pPositionItem->GetValue();
158 if( nPos < m_xLB_CrossesAt->get_count() )
165 double fCrossover = 0.0;
167 fCrossover = pPosValueItem->
GetValue();
173 rCrossFormatter.
SetValue(fCrossover);
203 sal_Int32
nPos = pLabelPosItem->GetValue();
204 if( nPos < m_xLB_PlaceLabels->get_count() )
214 nTicks = pTicksItem->GetValue();
216 nMinorTicks = pHelpTicksItem->GetValue();
226 sal_Int32
nPos = pMarkPosItem->GetValue();
227 if( nPos < m_xLB_PlaceTicks->get_count() )
253 return DeactivateRC::LeavePage;
265 sal_uInt32 nFmt = pNumFormatItem->GetValue();
292 sal_Int32
nPos = m_xLB_CrossesAt->get_active();
293 m_xED_CrossesAt->set_visible( (
nPos==2) && !m_bCrossingAxisIsCategoryAxis );
294 m_xED_CrossesAtCategory->set_visible( (
nPos==2) && m_bCrossingAxisIsCategoryAxis );
296 if (m_xED_CrossesAt->get_text().isEmpty())
297 m_xED_CrossesAt->GetFormatter().SetValue(0.0);
298 if (m_xED_CrossesAtCategory->get_active() == -1)
299 m_xED_CrossesAtCategory->set_active(0);
301 PlaceLabelsSelectHdl(*m_xLB_PlaceLabels);
306 sal_Int32 nLabelPos = m_xLB_PlaceLabels->get_active();
308 bool bEnableTickmarkPlacement = (nLabelPos>1);
309 if( bEnableTickmarkPlacement )
311 sal_Int32 nAxisPos = m_xLB_CrossesAt->get_active();
312 if( nLabelPos-2 == nAxisPos )
313 bEnableTickmarkPlacement=
false;
315 m_xBxPlaceTicks->set_sensitive(bEnableTickmarkPlacement);
constexpr TypedWhichId< SfxInt32Item > SCHATTR_AXIS_TICKS(SCHATTR_AXIS_POSITION_START)
constexpr TypedWhichId< SfxUInt32Item > SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT(SCHATTR_AXIS_POSITION_START+4)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION(SCHATTR_AXIS_POSITION_START+5)
constexpr TypedWhichId< SvxDoubleItem > SCHATTR_AXIS_POSITION_VALUE(SCHATTR_AXIS_POSITION_START+3)
#define CHAXIS_MARK_OUTER
constexpr TypedWhichId< SfxInt32Item > SCHATTR_AXIS_HELPTICKS(SCHATTR_AXIS_POSITION_START+1)
constexpr TypedWhichId< SfxInt32Item > SCHATTR_AXIS_POSITION(SCHATTR_AXIS_POSITION_START+2)
constexpr TypedWhichId< SfxInt32Item > SCHATTR_AXIS_LABEL_POSITION(SCHATTR_AXIS_POSITION_START+6)
#define CHAXIS_MARK_INNER
constexpr TypedWhichId< SfxInt32Item > SCHATTR_AXIS_MARK_POSITION(SCHATTR_AXIS_POSITION_START+7)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxItemSet & GetItemSet() const
static bool isAxisPositioningEnabled()
virtual void Reset(const SfxItemSet *rInAttrs) override
std::unique_ptr< weld::Frame > m_xFL_Labels
std::unique_ptr< weld::Frame > m_xFL_Position
bool m_bCrossingAxisIsCategoryAxis
std::unique_ptr< weld::Frame > m_xFL_AxisLine
std::unique_ptr< weld::CheckButton > m_xCB_MinorInner
void SetNumFormatter(SvNumberFormatter *pFormatter)
SvNumberFormatter * m_pNumFormatter
std::unique_ptr< weld::FormattedSpinButton > m_xED_CrossesAt
std::unique_ptr< weld::CheckButton > m_xCB_TicksInner
css::uno::Sequence< OUString > m_aCategories
std::unique_ptr< weld::RadioButton > m_xRB_Between
std::unique_ptr< weld::ComboBox > m_xLB_PlaceLabels
virtual DeactivateRC DeactivatePage(SfxItemSet *pItemSet) override
void SetCrossingAxisIsCategoryAxis(bool bCrossingAxisIsCategoryAxis)
void SupportCategoryPositioning(bool bSupportCategoryPositioning)
std::unique_ptr< weld::Widget > m_xBxPlaceTicks
virtual bool FillItemSet(SfxItemSet *rOutAttrs) override
std::unique_ptr< weld::CheckButton > m_xCB_MinorOuter
std::unique_ptr< weld::ComboBox > m_xLB_PlaceTicks
virtual ~AxisPositionsTabPage() override
AxisPositionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
std::unique_ptr< weld::ComboBox > m_xED_CrossesAtCategory
bool m_bSupportAxisPositioning
std::unique_ptr< weld::CheckButton > m_xCB_TicksOuter
void SupportAxisPositioning(bool bSupportAxisPositioning)
std::unique_ptr< weld::ComboBox > m_xLB_CrossesAt
void SetCategories(const css::uno::Sequence< OUString > &rCategories)
bool m_bSupportCategoryPositioning
std::unique_ptr< weld::RadioButton > m_xRB_On
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rInAttrs)
#define LINK(Instance, Class, Member)
IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox &, void)