From 5481ca586df8eed2c832e00bc5f7e910fa2cd174 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 26 Sep 2018 14:17:16 +0100 Subject: weld SpecialSettingsPage and GeneratedValuesPage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3b4c2a4d553032128efe25c008df30d6f1f77628 Reviewed-on: https://gerrit.libreoffice.org/61018 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/source/app/salvtables.cxx | 20 ++++++++++++++++++++ vcl/unx/gtk3/gtk3gtkinst.cxx | 6 ++++++ 2 files changed, 26 insertions(+) (limited to 'vcl') diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 00f31f36f702..972e23dacaf9 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1901,6 +1901,7 @@ public: : SalInstanceEntry(pButton, bTakeOwnership) , m_xButton(pButton) { + m_xButton->SetUseThousandSep(false); //off by default, MetricSpinButton enables it m_xButton->SetUpHdl(LINK(this, SalInstanceSpinButton, UpDownHdl)); m_xButton->SetDownHdl(LINK(this, SalInstanceSpinButton, UpDownHdl)); m_xButton->SetLoseFocusHdl(LINK(this, SalInstanceSpinButton, LoseFocusHdl)); @@ -1948,11 +1949,18 @@ public: m_xButton->SetDecimalDigits(digits); } + //so with hh::mm::ss, incrementing mm will not reset ss void DisableRemainderFactor() { m_xButton->DisableRemainderFactor(); } + //off by default for direct SpinButtons, MetricSpinButton enables it + void SetUseThousandSep() + { + m_xButton->SetUseThousandSep(true); + } + virtual unsigned int get_digits() const override { return m_xButton->GetDecimalDigits(); @@ -2831,6 +2839,18 @@ public: return pSpinButton ? o3tl::make_unique(pSpinButton, bTakeOwnership) : nullptr; } + virtual std::unique_ptr weld_metric_spin_button(const OString& id, FieldUnit eUnit, + bool bTakeOwnership) override + { + std::unique_ptr xButton(weld_spin_button(id, bTakeOwnership)); + if (xButton) + { + SalInstanceSpinButton& rButton = dynamic_cast(*xButton); + rButton.SetUseThousandSep(); + } + return o3tl::make_unique(std::move(xButton), eUnit); + } + virtual std::unique_ptr weld_time_spin_button(const OString& id, TimeFieldFormat eFormat, bool bTakeOwnership) override { diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 13c1f3b49c96..90f104511547 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -6073,6 +6073,12 @@ public: return o3tl::make_unique(pSpinButton, bTakeOwnership); } + virtual std::unique_ptr weld_metric_spin_button(const OString& id, FieldUnit eUnit, + bool bTakeOwnership) override + { + return o3tl::make_unique(weld_spin_button(id, bTakeOwnership), eUnit); + } + virtual std::unique_ptr weld_time_spin_button(const OString& id, TimeFieldFormat eFormat, bool bTakeOwnership) override { -- cgit