20#include <svx/svxids.hrc>
37 : GenericDialogController(pWindow,
"modules/sdraw/ui/dlgsnap.ui",
"SnapObjectDialog")
38 , aUIScale(pView->GetDoc().GetUIScale())
39 , m_xFtX(m_xBuilder->weld_label(
"xlabel"))
40 , m_xMtrFldX(m_xBuilder->weld_metric_spin_button(
"x",
FieldUnit::
CM))
41 , m_xFtY(m_xBuilder->weld_label(
"ylabel"))
42 , m_xMtrFldY(m_xBuilder->weld_metric_spin_button(
"y",
FieldUnit::
CM))
43 , m_xRadioGroup(m_xBuilder->weld_widget(
"radiogroup"))
44 , m_xRbPoint(m_xBuilder->weld_radio_button(
"point"))
45 , m_xRbVert(m_xBuilder->weld_radio_button(
"vert"))
46 , m_xRbHorz(m_xBuilder->weld_radio_button(
"horz"))
47 , m_xBtnDelete(m_xBuilder->weld_button(
"delete"))
76 auto const map = [ePoolUnit](std::unique_ptr<weld::MetricSpinButton>
const & msb,
tools::Long value) {
78 auto const n2 = msb->normalize(
n1);
79 auto const n3 = msb->convert_value_from(
n2, FieldUnit::MM_100TH);
80 auto const n4 = msb->convert_value_to(
n3, FieldUnit::NONE);
91 nXValue = rInAttrs.
Get(ATTR_SNAPLINE_X).GetValue();
92 nYValue = rInAttrs.
Get(ATTR_SNAPLINE_Y).GetValue();
110 if (!rBtn.get_active())
112 if (m_xRbPoint->get_active())
113 SetInputFields(
true,
true);
114 else if (m_xRbHorz->get_active())
115 SetInputFields(
false,
true);
116 else if (m_xRbVert->get_active())
117 SetInputFields(
true,
false);
122 if (&rBtn == m_xBtnDelete.get())
140 rOutAttrs.
Put(
SfxUInt16Item(ATTR_SNAPLINE_KIND,
static_cast<sal_uInt16
>(eKind)));
160 m_xFtX->set_sensitive(
true);
167 m_xFtX->set_sensitive(
false);
174 m_xFtY->set_sensitive(
true);
181 m_xFtY->set_sensitive(
false);
Reference< XExecutableDialog > m_xDialog
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
constexpr tools::Long Y() const
constexpr tools::Long X() const
dialog to adjust snap- lines and points
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldY
std::unique_ptr< weld::RadioButton > m_xRbVert
std::unique_ptr< weld::Button > m_xBtnDelete
virtual ~SdSnapLineDlg() override
std::unique_ptr< weld::Label > m_xFtX
std::unique_ptr< weld::RadioButton > m_xRbHorz
SdSnapLineDlg(weld::Window *pWindow, const SfxItemSet &rInAttrs, ::sd::View const *pView)
dialog to adjust grid (scarcely ESO!)
void SetInputFields(bool bEnableX, bool bEnableY)
disable X or Y input fields
std::unique_ptr< weld::Label > m_xFtY
std::unique_ptr< weld::RadioButton > m_xRbPoint
void GetAttr(SfxItemSet &rOutAttrs)
fills provided item sets with dialog box attributes
std::unique_ptr< weld::Widget > m_xRadioGroup
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldX
const tools::Rectangle & GetWorkArea() const
FieldUnit GetUIUnit() const
void LogicToPagePos(Point &rPnt) const
SdrPageView * GetSdrPageView() const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SdDrawDocument & GetDoc() const
#define DBG_ASSERT(sCon, aError)
IMPL_LINK(SdSnapLineDlg, ToggleHdl, weld::Toggleable &, rBtn, void)
fills provided item sets with dialog box attributes
#define LINK(Instance, Class, Member)
std::map< OUString, rtl::Reference< Entity > > map
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)