20#include <com/sun/star/drawing/FillStyle.hpp>
21#include <com/sun/star/frame/XDispatchProvider.hpp>
22#include <com/sun/star/frame/XFrame.hpp>
35#include <svx/strings.hrc>
50 vcl::Window* pParent,
const Reference< XFrame >& rFrame )
60 m_xWidget->set_range(0, 5000, FieldUnit::NONE);
142 nCurValue =
m_xWidget->get_value(FieldUnit::NONE);
147 bool bHandled =
false;
149 sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
153 m_xWidget->set_value(nCurValue, FieldUnit::NONE);
159 return bHandled || ChildKeyInput(rKEvt);
164 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
165 (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);
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
const Size & GetSizePixel() const
sal_Int32 GetValue() const
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
const Graphic & GetGraphic() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
virtual void dispose() override
void InitControlBase(weld::Widget *pWidget)
static FieldUnit GetModuleFieldUnit(css::uno::Reference< css::frame::XFrame > const &i_frame)
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
vcl::Window * GetWindow() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
bool GetPreviewUsesCheckeredBackground() const
const Color & GetFieldColor() const
const Size & GetListBoxPreviewDefaultPixelSize() const
std::unique_ptr< weld::MetricSpinButton > m_xWidget
virtual ~SvxMetricField() override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
static void ReleaseFocus_Impl()
void SetDestCoreUnit(MapUnit eUnit)
void set_sensitive(bool bSensitive)
css::uno::Reference< css::frame::XFrame > mxFrame
void Update(const XLineWidthItem *pItem)
SvxMetricField(vcl::Window *pParent, const css::uno::Reference< css::frame::XFrame > &rFrame)
virtual void dispose() override
const GraphicObject & GetGraphicObject() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
const OUString & GetName() const
virtual void SetSizePixel(const Size &rNewSize)
void Enable(bool bEnable=true, bool bChild=true)
virtual void DataChanged(const DataChangedEvent &rDCEvt)
void append(const weld::ComboBoxEntry &rItem)
virtual void set_active(int pos)=0
void append_text(const OUString &rStr)
OUString SvxResId(TranslateId aId)
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
IMPL_LINK(SvxMetricField, KeyInputHdl, const KeyEvent &, rKEvt, bool)
IMPL_LINK_NOARG(SvxMetricField, ModifyHdl, weld::MetricSpinButton &, void)
constexpr sal_uInt16 KEY_ESCAPE
#define LINK(Instance, Class, Member)
SVX_DLLPUBLIC void Fill(weld::ComboBox &, const XHatchListRef &pList)
SVX_DLLPUBLIC void Fill(weld::ComboBox &rListBox)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
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)