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))
149 return std::make_unique<SvxGridTabPage>(pPage, pController, rAttrSet);
167 aGridItem.
nFldDrawX =
static_cast<sal_uInt32
>(nX);
168 aGridItem.
nFldDrawY =
static_cast<sal_uInt32
>(nY);
172 rCoreSet->
Put( aGridItem );
181 if( SfxItemState::SET == rSet->
GetItemState( SID_ATTR_GRID_OPTIONS ,
false,
205 if( SfxItemState::SET == rSet.
GetItemState( SID_ATTR_GRID_OPTIONS ,
false,
216 if( SfxItemState::SET != rSet.
GetItemState( SID_ATTR_METRIC ,
false,
248 return DeactivateRC::LeavePage;
253 bAttrModified =
true;
254 if (m_xCbxSynchronize->get_active())
256 if (&rField == m_xMtrFldDrawX.get())
257 m_xMtrFldDrawY->set_value(m_xMtrFldDrawX->get_value(FieldUnit::NONE), FieldUnit::NONE);
259 m_xMtrFldDrawX->set_value(m_xMtrFldDrawY->get_value(FieldUnit::NONE), FieldUnit::NONE);
265 if (m_xCbxRotate->get_active())
266 m_xMtrFldAngle->set_sensitive(
true);
268 m_xMtrFldAngle->set_sensitive(
false);
273 bAttrModified =
true;
274 if (m_xCbxSynchronize->get_active())
276 if (m_xNumFldDivisionX.get() == &rField)
277 m_xNumFldDivisionY->set_value(m_xNumFldDivisionX->get_value());
279 m_xNumFldDivisionX->set_value(m_xNumFldDivisionY->get_value());
285 bAttrModified =
true;
#define LINK(Instance, Class, Member)
virtual ~SvxGridTabPage() override
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
SvxGridTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::SpinButton > m_xNumFldDivisionY
std::unique_ptr< weld::CheckButton > m_xCbxRotate
sal_uInt16 GetValue() const
virtual bool operator==(const SfxPoolItem &) const override
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
IMPL_LINK_NOARG(SvxGridTabPage, ClickRotateHdl_Impl, weld::ToggleButton &, void)
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldDrawY
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
std::unique_ptr< weld::CheckButton > m_xCbxGridVisible
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void SetExchangeSupport()
virtual SvxGridItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual void Reset(const SfxItemSet *rSet) override
SvxGridItem(sal_uInt16 _nWhich)
std::unique_ptr< weld::SpinButton > m_xNumFldDivisionX
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
SfxItemPool * GetPool() const
IMPL_LINK(SvxGridTabPage, ChangeDrawHdl_Impl, weld::MetricSpinButton &, rField, void)
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldDrawX
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual void ActivatePage(const SfxItemSet &rSet) override
static void lcl_SetMinMax(weld::MetricSpinButton &rField, int nMin, int nMax)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
static void lcl_GetMinMax(weld::MetricSpinButton const &rField, int &nMin, int &nMax)
std::unique_ptr< weld::CheckButton > m_xCbxSynchronize
std::unique_ptr< weld::CheckButton > m_xCbxUseGridsnap
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const