summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-14 13:52:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-11-15 18:17:35 +0100
commit4ce5d39689fda418e8f2d7d9c1124190b2cbad7a (patch)
tree1e261f9e2b305fbdf56e3784c6589efbd683755b /include
parent9e0a099fb66c303bec0489198ba7cfe770b28684 (diff)
bind SalInstanceSpinButton to FormattedField
Change-Id: I71190343739fae51b1c17d74ea1c4a548bca0b01 Reviewed-on: https://gerrit.libreoffice.org/63371 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/builder.hxx4
-rw-r--r--include/vcl/field.hxx7
-rw-r--r--include/vcl/fmtfield.hxx11
3 files changed, 14 insertions, 8 deletions
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index d795b5cdc915..1883a128f48e 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -36,6 +36,7 @@
class Button;
class ComboBox;
+class FormattedField;
class ListBox;
class MessageDialog;
class NumericFormatter;
@@ -235,6 +236,7 @@ private:
const Adjustment* get_adjustment_by_name(const OString& sID) const;
static void mungeAdjustment(NumericFormatter &rTarget, const Adjustment &rAdjustment);
+ static void mungeAdjustment(FormattedField &rTarget, const Adjustment &rAdjustment);
static void mungeAdjustment(DateField &rTarget, const Adjustment &rAdjustment);
static void mungeAdjustment(TimeField &rTarget, const Adjustment &rAdjustment);
static void mungeAdjustment(ScrollBar &rTarget, const Adjustment &rAdjustment);
@@ -271,6 +273,7 @@ private:
std::map<OString, TextBuffer> m_aTextBuffers;
std::vector<WidgetAdjustmentMap> m_aNumericFormatterAdjustmentMaps;
+ std::vector<WidgetAdjustmentMap> m_aFormattedFormatterAdjustmentMaps;
std::vector<WidgetAdjustmentMap> m_aTimeFormatterAdjustmentMaps;
std::vector<WidgetAdjustmentMap> m_aDateFormatterAdjustmentMaps;
std::vector<WidgetAdjustmentMap> m_aScrollAdjustmentMaps;
@@ -342,6 +345,7 @@ private:
stringmap &rVec);
void connectNumericFormatterAdjustment(const OString &id, const OUString &rAdjustment);
+ void connectFormattedFormatterAdjustment(const OString &id, const OUString &rAdjustment);
void connectTimeFormatterAdjustment(const OString &id, const OUString &rAdjustment);
void connectDateFormatterAdjustment(const OString &id, const OUString &rAdjustment);
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index 0c0abcd9df55..aeb31c85664c 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -146,8 +146,6 @@ public:
void SetShowTrailingZeros( bool bShowTrailingZeros );
bool IsShowTrailingZeros() const { return mbShowTrailingZeros; }
- void DisableRemainderFactor();
-
void SetUserValue( sal_Int64 nNewValue );
virtual void SetValue( sal_Int64 nNewValue );
sal_Int64 GetValue() const;
@@ -157,8 +155,6 @@ public:
sal_Int64 Normalize( sal_Int64 nValue ) const;
sal_Int64 Denormalize( sal_Int64 nValue ) const;
- void SetInputHdl(const Link<sal_Int64*,TriState>& rLink) { m_aInputHdl = rLink; }
- void SetOutputHdl(const Link<Edit&, bool>& rLink) { m_aOutputHdl = rLink; }
protected:
sal_Int64 mnFieldValue;
sal_Int64 mnLastValue;
@@ -166,7 +162,6 @@ protected:
sal_Int64 mnMax;
bool mbWrapOnLimits;
bool mbFormatting;
- bool mbDisableRemainderFactor;
// the members below are used in all derivatives of NumericFormatter
// not in NumericFormatter itself.
@@ -191,8 +186,6 @@ protected:
private:
SAL_DLLPRIVATE void ImplInit();
- Link<sal_Int64*, TriState> m_aInputHdl;
- Link<Edit&, bool> m_aOutputHdl;
sal_uInt16 mnDecimalDigits;
bool mbThousandSep;
bool mbShowTrailingZeros;
diff --git a/include/vcl/fmtfield.hxx b/include/vcl/fmtfield.hxx
index 16b01dd3c1e5..de1a090036f7 100644
--- a/include/vcl/fmtfield.hxx
+++ b/include/vcl/fmtfield.hxx
@@ -70,6 +70,7 @@ protected:
bool m_bEnableEmptyField : 1;
bool m_bAutoColor : 1;
bool m_bEnableNaN : 1;
+ bool m_bDisableRemainderFactor : 1;
enum valueState { valueDirty, valueString, valueDouble };
valueState m_ValueState;
double m_dCurrentValue;
@@ -138,6 +139,8 @@ public:
void SetThousandsSep(bool _bUseSeparator);
// the is no check if the current format is numeric, so be cautious when calling these functions
+ void DisableRemainderFactor();
+
sal_uInt16 GetDecimalDigits() const;
void SetDecimalDigits(sal_uInt16 _nPrecision);
// There is no check if the current format is numeric, so be cautious when calling these functions
@@ -162,6 +165,8 @@ public:
virtual void Last() override;
// Default Implementation: Current double is set to the first or last value
+ virtual bool set_property(const OString &rKey, const OUString &rValue) override;
+
void SetSpinSize(double dStep) { m_dSpinSize = dStep; }
double GetSpinSize() const { return m_dSpinSize; }
@@ -174,6 +179,8 @@ public:
bool TreatingAsNumber() const { return m_bTreatAsNumber; }
void TreatAsNumber(bool bDoSo) { m_bTreatAsNumber = bDoSo; }
+ void SetOutputHdl(const Link<Edit&, bool>& rLink) { m_aOutputHdl = rLink; }
+ void SetInputHdl(const Link<sal_Int64*,TriState>& rLink) { m_aInputHdl = rLink; }
public:
virtual void SetText( const OUString& rStr ) override;
virtual void SetText( const OUString& rStr, const Selection& rNewSelection ) override;
@@ -250,9 +257,11 @@ protected:
bool PreNotify(NotifyEvent& rNEvt) override;
void ReFormat();
+private:
+ Link<Edit&, bool> m_aOutputHdl;
+ Link<sal_Int64*, TriState> m_aInputHdl;
};
-
class VCL_DLLPUBLIC DoubleNumericField final : public FormattedField
{
public: