20 #include <com/sun/star/drawing/FillStyle.hpp>
21 #include <com/sun/star/frame/XDispatchProvider.hpp>
22 #include <com/sun/star/frame/XFrame.hpp>
34 #include <svx/strings.hrc>
51 , m_xWidget(m_xBuilder->weld_metric_spin_button(
"metricfield",
FieldUnit::
MM))
59 m_xWidget->set_range(0, 5000, FieldUnit::NONE);
107 Sequence< PropertyValue > aArgs( 1 );
108 aArgs[0].Name =
"LineWidth";
143 nCurValue = m_xWidget->get_value(FieldUnit::NONE);
148 bool bHandled =
false;
150 sal_uInt16
nCode = rKEvt.GetKeyCode().GetCode();
154 m_xWidget->set_value(nCurValue, FieldUnit::NONE);
155 ModifyHdl(*m_xWidget);
160 return bHandled || ChildKeyInput(rKEvt);
165 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
166 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE) )
192 void formatBitmapExToSize(
BitmapEx& rBitmapEx,
const Size& rSize)
198 pVirtualDevice->SetOutputSizePixel(rSize);
206 const Point aNull(0, 0);
207 static const sal_uInt32 nLen(8);
208 static const Color aW(COL_WHITE);
209 static const Color aG(0xef, 0xef, 0xef);
211 pVirtualDevice->DrawCheckered(aNull, rSize, nLen, aW, aG);
215 pVirtualDevice->SetBackground(rStyleSettings.
GetFieldColor());
216 pVirtualDevice->Erase();
222 rBitmapEx.
Scale(rSize);
223 pVirtualDevice->DrawBitmapEx(
Point(0, 0), rBitmapEx);
233 pVirtualDevice->DrawBitmapEx(
240 rBitmapEx = pVirtualDevice->GetBitmapEx(
Point(0, 0), rSize);
256 const BitmapEx aBitmapEx = pList->GetUiBitmap(
i );
260 pVD->SetOutputSizePixel(aBmpSize,
false);
261 pVD->DrawBitmapEx(
Point(), aBitmapEx);
283 const BitmapEx aBitmapEx = pList->GetUiBitmap(
i );
287 pVD->SetOutputSizePixel(aBmpSize,
false);
288 pVD->DrawBitmapEx(
Point(), aBitmapEx);
307 pVD->SetOutputSizePixel(aSize,
false);
314 formatBitmapExToSize(aBitmapEx, aSize);
315 pVD->DrawBitmapEx(
Point(), aBitmapEx);
331 pVD->SetOutputSizePixel(aSize,
false);
338 formatBitmapExToSize(aBitmapEx, aSize);
339 pVD->DrawBitmapEx(
Point(), aBitmapEx);
#define LINK(Instance, Class, Member)
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
sal_Int32 GetValue() const
std::unique_ptr< weld::MetricSpinButton > m_xWidget
SvxMetricField(vcl::Window *pParent, const css::uno::Reference< css::frame::XFrame > &rFrame)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual ~SvxMetricField() override
SVX_DLLPUBLIC void Fill(weld::ComboBox &, const XHatchListRef &pList)
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
virtual void dispose() override
virtual void SetSizePixel(const Size &rNewSize)
static void ReleaseFocus_Impl()
bool GetPreviewUsesCheckeredBackground() const
DataChangedEventType GetType() const
void append(const OUString &rId, const OUString &rStr)
const Size & GetListBoxPreviewDefaultPixelSize() const
void set_sensitive(bool bSensitive)
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
void Enable(bool bEnable=true, bool bChild=true)
OUString SvxResId(const char *pId)
AllSettingsFlags GetFlags() const
static SfxViewShell * Current()
const GraphicObject & GetGraphicObject() const
css::uno::Reference< css::frame::XFrame > mxFrame
const OUString & GetName() const
static FieldUnit GetModuleFieldUnit(css::uno::Reference< css::frame::XFrame > const &i_frame)
SVX_DLLPUBLIC void Fill(weld::ComboBox &rListBox)
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
tools::Long Width() const
const Color & GetFieldColor() const
void Update(const XLineWidthItem *pItem)
void SetDestCoreUnit(MapUnit eUnit)
virtual void set_active(int pos)=0
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
bool IsTransparent() const
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
const Graphic & GetGraphic() const
constexpr sal_uInt16 KEY_ESCAPE
virtual void dispose() override
tools::Long Height() const
vcl::Window * GetWindow() const
IMPL_LINK(SvxMetricField, KeyInputHdl, const KeyEvent &, rKEvt, bool)
IMPL_LINK_NOARG(SvxMetricField, ModifyHdl, weld::MetricSpinButton &, void)
void append_text(const OUString &rStr)
const Size & GetSizePixel() const
void InitControlBase(weld::Widget *pWidget)
virtual void DataChanged(const DataChangedEvent &rDCEvt)