summaryrefslogtreecommitdiffstats
path: root/scene/gui/range.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-13 14:08:30 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-13 14:08:30 -0300
commitde8cc309d66641d52a6832ad65f26ce73378fb88 (patch)
tree0ae019462739e97ba4ae562ba527696fe8c2f253 /scene/gui/range.cpp
parente53c247cb16b25b828461f32533da64f4fab0e0b (diff)
downloadredot-engine-de8cc309d66641d52a6832ad65f26ce73378fb88.tar.gz
Renamed button functions to be more verboes, same with Range unit value -> ratio
Diffstat (limited to 'scene/gui/range.cpp')
-rw-r--r--scene/gui/range.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp
index 2f37ed0341..d5c1034c9c 100644
--- a/scene/gui/range.cpp
+++ b/scene/gui/range.cpp
@@ -135,11 +135,11 @@ double Range::get_page() const {
return shared->page;
}
-void Range::set_unit_value(double p_value) {
+void Range::set_as_ratio(double p_value) {
double v;
- if (shared->exp_unit_value && get_min()>0) {
+ if (shared->exp_ratio && get_min()>0) {
double exp_min = Math::log(get_min())/Math::log(2);
double exp_max = Math::log(get_max())/Math::log(2);
@@ -156,9 +156,9 @@ void Range::set_unit_value(double p_value) {
}
set_value( v );
}
-double Range::get_unit_value() const {
+double Range::get_as_ratio() const {
- if (shared->exp_unit_value && get_min()>0) {
+ if (shared->exp_ratio && get_min()>0) {
double exp_min = Math::log(get_min())/Math::log(2);
double exp_max = Math::log(get_max())/Math::log(2);
@@ -227,17 +227,17 @@ void Range::_bind_methods() {
ClassDB::bind_method(_MD("get_max"),&Range::get_max);
ClassDB::bind_method(_MD("get_step"),&Range::get_step);
ClassDB::bind_method(_MD("get_page"),&Range::get_page);
- ClassDB::bind_method(_MD("get_unit_value"),&Range::get_unit_value);
+ ClassDB::bind_method(_MD("get_as_ratio"),&Range::get_as_ratio);
ClassDB::bind_method(_MD("set_value","value"),&Range::set_value);
ClassDB::bind_method(_MD("set_min","minimum"),&Range::set_min);
ClassDB::bind_method(_MD("set_max","maximum"),&Range::set_max);
ClassDB::bind_method(_MD("set_step","step"),&Range::set_step);
ClassDB::bind_method(_MD("set_page","pagesize"),&Range::set_page);
- ClassDB::bind_method(_MD("set_unit_value","value"),&Range::set_unit_value);
- ClassDB::bind_method(_MD("set_rounded_values","enabled"),&Range::set_rounded_values);
- ClassDB::bind_method(_MD("is_rounded_values"),&Range::is_rounded_values);
- ClassDB::bind_method(_MD("set_exp_unit_value","enabled"),&Range::set_exp_unit_value);
- ClassDB::bind_method(_MD("is_unit_value_exp"),&Range::is_unit_value_exp);
+ ClassDB::bind_method(_MD("set_as_ratio","value"),&Range::set_as_ratio);
+ ClassDB::bind_method(_MD("set_use_rounded_values","enabled"),&Range::set_use_rounded_values);
+ ClassDB::bind_method(_MD("is_using_rounded_values"),&Range::is_using_rounded_values);
+ ClassDB::bind_method(_MD("set_exp_ratio","enabled"),&Range::set_exp_ratio);
+ ClassDB::bind_method(_MD("is_ratio_exp"),&Range::is_ratio_exp);
ClassDB::bind_method(_MD("share","with"),&Range::_share);
ClassDB::bind_method(_MD("unshare"),&Range::unshare);
@@ -250,29 +250,29 @@ void Range::_bind_methods() {
ADD_PROPERTY( PropertyInfo( Variant::REAL, "step" ), _SCS("set_step"), _SCS("get_step") );
ADD_PROPERTY( PropertyInfo( Variant::REAL, "page" ), _SCS("set_page"), _SCS("get_page") );
ADD_PROPERTY( PropertyInfo( Variant::REAL, "value" ), _SCS("set_value"), _SCS("get_value") );
- ADD_PROPERTY( PropertyInfo( Variant::BOOL, "exp_edit" ), _SCS("set_exp_unit_value"), _SCS("is_unit_value_exp") );
- ADD_PROPERTY( PropertyInfo( Variant::BOOL, "rounded" ), _SCS("set_rounded_values"), _SCS("is_rounded_values") );
+ ADD_PROPERTY( PropertyInfo( Variant::BOOL, "exp_edit" ), _SCS("set_exp_ratio"), _SCS("is_ratio_exp") );
+ ADD_PROPERTY( PropertyInfo( Variant::BOOL, "rounded" ), _SCS("set_use_rounded_values"), _SCS("is_using_rounded_values") );
}
-void Range::set_rounded_values(bool p_enable) {
+void Range::set_use_rounded_values(bool p_enable) {
_rounded_values = p_enable;
}
-bool Range::is_rounded_values() const {
+bool Range::is_using_rounded_values() const {
return _rounded_values;
}
-void Range::set_exp_unit_value(bool p_enable) {
+void Range::set_exp_ratio(bool p_enable) {
- shared->exp_unit_value=p_enable;
+ shared->exp_ratio=p_enable;
}
-bool Range::is_unit_value_exp() const {
+bool Range::is_ratio_exp() const {
- return shared->exp_unit_value;
+ return shared->exp_ratio;
}
@@ -285,7 +285,7 @@ Range::Range()
shared->step=1;
shared->page=0;
shared->owners.insert(this);
- shared->exp_unit_value=false;
+ shared->exp_ratio=false;
_rounded_values = false;
}