summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-26 11:22:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-26 15:18:39 +0200
commitbda370031e669d4a9b19d0a8247da0db230ebf00 (patch)
tree6863c066dfe5ad10400d5e9dbba237c653e984bd /vcl/unx
parente772025f369c810fe73c2de7f45b91ffcc345152 (diff)
extend FormattedSpinButton to allow custom input/output
Change-Id: Ie84c1d46bc6fa3e29ed97147de486911dc6ecc0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97217 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 7270e3e21be5..804fa0ec7df3 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -12128,6 +12128,12 @@ private:
bool signal_output()
{
+ // allow an explicit handler
+ if (m_aOutputHdl.IsSet())
+ {
+ m_aOutputHdl.Call(*this);
+ return true;
+ }
if (!m_pFormatter)
return false;
double dVal = get_value();
@@ -12157,6 +12163,10 @@ private:
gint signal_input(double* value)
{
+ // allow an explicit handler
+ if (m_aInputHdl.IsSet())
+ return m_aInputHdl.Call(value) ? 1 : GTK_INPUT_ERROR;
+
if (!m_pFormatter)
return 0;
@@ -12244,6 +12254,13 @@ public:
gtk_spin_button_get_range(m_pButton, &min, &max);
}
+ virtual void set_increments(double step, double page) override
+ {
+ disable_notify_events();
+ gtk_spin_button_set_increments(m_pButton, step, page);
+ enable_notify_events();
+ }
+
virtual void set_formatter(SvNumberFormatter* pFormatter) override
{
m_pFormatter = pFormatter;