aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoinamountfield.h
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2018-10-30 14:02:08 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2018-10-30 14:58:25 +0200
commit8711cc0c78fb15e49c6ab477a5d922fc51627873 (patch)
treef2485d717386c9fa70b8d1574b2b0848c0d04d2c /src/qt/bitcoinamountfield.h
parent29f429dc7d4c7e6cd012e749cadf89e3138bcab3 (diff)
downloadbitcoin-8711cc0c78fb15e49c6ab477a5d922fc51627873.tar.xz
qt: Improve BitcoinAmountField class
This adds functions for specifing a min/max value for a BitcoinAmountField. These options only affect user input, so it's still possible to use setValue to set values outside of the min/max range. The existing value will not be changed when calling these functions even if it's out of range. The min/max range will be reinforced when the field loses focus. This also adds `SetAllowEmpty` function which specifies if the field is allowed to be left empty by the user. If set to false the field will be set to the minimum allowed value if it's empty when focus is lost.
Diffstat (limited to 'src/qt/bitcoinamountfield.h')
-rw-r--r--src/qt/bitcoinamountfield.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h
index f93579c492..650481e30d 100644
--- a/src/qt/bitcoinamountfield.h
+++ b/src/qt/bitcoinamountfield.h
@@ -31,6 +31,15 @@ public:
CAmount value(bool *value=0) const;
void setValue(const CAmount& value);
+ /** If allow empty is set to false the field will be set to the minimum allowed value if left empty. **/
+ void SetAllowEmpty(bool allow);
+
+ /** Set the minimum value in satoshis **/
+ void SetMinValue(const CAmount& value);
+
+ /** Set the maximum value in satoshis **/
+ void SetMaxValue(const CAmount& value);
+
/** Set single step in satoshis **/
void setSingleStep(const CAmount& step);