23#include <svx/svxids.hrc>
30 rField.
get_range(nMin, nMax, FieldUnit::TWIP);
47 bUseGridsnap ( false ),
48 bSynchronize ( true ),
49 bGridVisible ( false ),
61 assert(SfxPoolItem::operator==(rAttr));
85 rText =
"SvxGridItem";
91 :
SfxTabPage(pPage, pController,
"svx/ui/optgridpage.ui",
"OptGridPage", &rCoreSet)
92 , bAttrModified(false)
93 , m_xCbxUseGridsnap(m_xBuilder->weld_check_button(
"usegridsnap"))
94 , m_xCbxGridVisible(m_xBuilder->weld_check_button(
"gridvisible"))
95 , m_xMtrFldDrawX(m_xBuilder->weld_metric_spin_button(
"mtrflddrawx",
FieldUnit::
CM))
96 , m_xMtrFldDrawY(m_xBuilder->weld_metric_spin_button(
"mtrflddrawy",
FieldUnit::
CM))
97 , m_xNumFldDivisionX(m_xBuilder->weld_spin_button(
"numflddivisionx"))
98 , m_xNumFldDivisionY(m_xBuilder->weld_spin_button(
"numflddivisiony"))
99 , m_xCbxSynchronize(m_xBuilder->weld_check_button(
"synchronize"))
100 , m_xSnapFrames(m_xBuilder->weld_widget(
"snapframes"))
101 , m_xCbxSnapHelplines(m_xBuilder->weld_check_button(
"snaphelplines"))
102 , m_xCbxSnapBorder(m_xBuilder->weld_check_button(
"snapborder"))
103 , m_xCbxSnapFrame(m_xBuilder->weld_check_button(
"snapframe"))
104 , m_xCbxSnapPoints(m_xBuilder->weld_check_button(
"snappoints"))
105 , m_xMtrFldSnapArea(m_xBuilder->weld_metric_spin_button(
"mtrfldsnaparea",
FieldUnit::
PIXEL))
106 , m_xCbxOrtho(m_xBuilder->weld_check_button(
"ortho"))
107 , m_xCbxBigOrtho(m_xBuilder->weld_check_button(
"bigortho"))
108 , m_xCbxRotate(m_xBuilder->weld_check_button(
"rotate"))
109 , m_xMtrFldAngle(m_xBuilder->weld_metric_spin_button(
"mtrfldangle",
FieldUnit::
DEGREE))
110 , m_xMtrFldBezAngle(m_xBuilder->weld_metric_spin_button(
"mtrfldbezangle",
FieldUnit::
DEGREE))
117 sal_Int64 nMin, nMax;
149 return std::make_unique<SvxGridTabPage>(pPage, pController, rAttrSet);
166 aGridItem.
nFldDrawX =
static_cast<sal_uInt32
>(nX);
167 aGridItem.
nFldDrawY =
static_cast<sal_uInt32
>(nY);
171 rCoreSet->
Put( aGridItem );
221 sal_Int64 nMin, nMax;
241 return DeactivateRC::LeavePage;
246 bAttrModified =
true;
247 if (m_xCbxSynchronize->get_active())
249 if (&rField == m_xMtrFldDrawX.get())
250 m_xMtrFldDrawY->set_value(m_xMtrFldDrawX->get_value(FieldUnit::NONE), FieldUnit::NONE);
252 m_xMtrFldDrawX->set_value(m_xMtrFldDrawY->get_value(FieldUnit::NONE), FieldUnit::NONE);
258 if (m_xCbxRotate->get_active())
259 m_xMtrFldAngle->set_sensitive(
true);
261 m_xMtrFldAngle->set_sensitive(
false);
266 bAttrModified =
true;
267 if (m_xCbxSynchronize->get_active())
269 if (m_xNumFldDivisionX.get() == &rField)
270 m_xNumFldDivisionY->set_value(m_xNumFldDivisionX->get_value());
272 m_xNumFldDivisionX->set_value(m_xNumFldDivisionY->get_value());
278 bAttrModified =
true;
sal_uInt16 GetValue() const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetExchangeSupport()
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
virtual SvxGridItem * Clone(SfxItemPool *pPool=nullptr) const override
SvxGridItem(TypedWhichId< SvxGridItem > _nWhich)
virtual bool operator==(const SfxPoolItem &) const override
virtual void ActivatePage(const SfxItemSet &rSet) override
std::unique_ptr< weld::CheckButton > m_xCbxSynchronize
std::unique_ptr< weld::SpinButton > m_xNumFldDivisionX
std::unique_ptr< weld::CheckButton > m_xCbxUseGridsnap
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldDrawY
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldDrawX
std::unique_ptr< weld::CheckButton > m_xCbxRotate
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::SpinButton > m_xNumFldDivisionY
virtual ~SvxGridTabPage() override
virtual bool FillItemSet(SfxItemSet *rSet) override
virtual void Reset(const SfxItemSet *rSet) override
SvxGridTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::CheckButton > m_xCbxGridVisible
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
#define LINK(Instance, Class, Member)
IMPL_LINK_NOARG(SvxGridTabPage, ClickRotateHdl_Impl, weld::Toggleable &, void)
IMPL_LINK(SvxGridTabPage, ChangeDrawHdl_Impl, weld::MetricSpinButton &, rField, void)
static void lcl_GetMinMax(weld::MetricSpinButton const &rField, sal_Int64 &nMin, sal_Int64 &nMax)
static void lcl_SetMinMax(weld::MetricSpinButton &rField, sal_Int64 nMin, sal_Int64 nMax)
SVT_DLLPUBLIC sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)