diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-02-06 10:59:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-02-06 18:17:02 +0100 |
commit | 97a5da96159f28de0b846de7dd94d2880251e8b3 (patch) | |
tree | 091f4334ff184047376240a4deb5bfb9b0da5b1e /include/svx/itemwin.hxx | |
parent | bf2f1adfd2e4725518147657c6b57eb5697a29d5 (diff) |
weld SvxMetricField
split off SdPagesField as its not really a MetricSpinButton and can
be a SpinButton with a custom output function.
while I'm at it use ngettext to provide better plurals for the output.
Change-Id: Idc9ce0513c9fce60c8713c7361fd40f0dbd01f64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88100
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svx/itemwin.hxx')
-rw-r--r-- | include/svx/itemwin.hxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/include/svx/itemwin.hxx b/include/svx/itemwin.hxx index a304405523ce..ee2e82ecbdc6 100644 --- a/include/svx/itemwin.hxx +++ b/include/svx/itemwin.hxx @@ -23,6 +23,7 @@ #include <vcl/lstbox.hxx> #include <svtools/toolbarmenu.hxx> #include <svx/dlgctrl.hxx> +#include <svx/InterimItemWindow.hxx> #include <svx/svxdllapi.h> class XLineWidthItem; @@ -48,32 +49,34 @@ public: virtual ~SvxLineBox() override; }; -class SVX_DLLPUBLIC SvxMetricField : public MetricField +class SVX_DLLPUBLIC SvxMetricField final : public InterimItemWindow { - using Window::Update; - - OUString aCurTxt; +private: + std::unique_ptr<weld::MetricSpinButton> m_xWidget; + int nCurValue; MapUnit ePoolUnit; FieldUnit eDlgUnit; - Size aLogicalSize; css::uno::Reference< css::frame::XFrame > mxFrame; - static void ReleaseFocus_Impl(); + DECL_LINK(ModifyHdl, weld::MetricSpinButton&, void); + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + DECL_LINK(FocusInHdl, weld::Widget&, void); -protected: - virtual void Modify() override; + static void ReleaseFocus_Impl(); - virtual bool PreNotify( NotifyEvent& rNEvt ) override; - virtual bool EventNotify( NotifyEvent& rNEvt ) override; virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; public: SvxMetricField( vcl::Window* pParent, const css::uno::Reference< css::frame::XFrame >& rFrame ); + virtual void dispose() override; + virtual ~SvxMetricField() override; void Update( const XLineWidthItem* pItem ); void SetCoreUnit( MapUnit eUnit ); void RefreshDlgUnit(); + + void set_sensitive(bool bSensitive); }; class SVX_DLLPUBLIC SvxFillTypeBox final : public ListBox |