|
@@ -88,15 +88,15 @@ class BindTextMixin:
|
|
|
"""
|
|
|
text = BindableProperty(on_change=lambda sender, text: sender.on_text_change(text))
|
|
|
|
|
|
- def bind_text_to(self, target_object: Any, target_name: str, forward: Callable = lambda x: x):
|
|
|
+ def bind_text_to(self, target_object: Any, target_name: str = 'text', forward: Callable = lambda x: x):
|
|
|
bind_to(self, 'text', target_object, target_name, forward)
|
|
|
return self
|
|
|
|
|
|
- def bind_text_from(self, target_object: Any, target_name: str, backward: Callable = lambda x: x):
|
|
|
+ def bind_text_from(self, target_object: Any, target_name: str = 'text', backward: Callable = lambda x: x):
|
|
|
bind_from(self, 'text', target_object, target_name, backward)
|
|
|
return self
|
|
|
|
|
|
- def bind_text(self, target_object: Any, target_name: str, *,
|
|
|
+ def bind_text(self, target_object: Any, target_name: str = 'text', *,
|
|
|
forward: Callable = lambda x: x, backward: Callable = lambda x: x):
|
|
|
bind(self, 'text', target_object, target_name, forward=forward, backward=backward)
|
|
|
return self
|
|
@@ -114,15 +114,15 @@ class BindValueMixin:
|
|
|
"""
|
|
|
value = BindableProperty(on_change=lambda sender, value: sender.on_value_change(value))
|
|
|
|
|
|
- def bind_value_to(self, target_object: Any, target_name: str, forward: Callable = lambda x: x):
|
|
|
+ def bind_value_to(self, target_object: Any, target_name: str = 'value', forward: Callable = lambda x: x):
|
|
|
bind_to(self, 'value', target_object, target_name, forward)
|
|
|
return self
|
|
|
|
|
|
- def bind_value_from(self, target_object: Any, target_name: str, backward: Callable = lambda x: x):
|
|
|
+ def bind_value_from(self, target_object: Any, target_name: str = 'value', backward: Callable = lambda x: x):
|
|
|
bind_from(self, 'value', target_object, target_name, backward)
|
|
|
return self
|
|
|
|
|
|
- def bind_value(self, target_object: Any, target_name: str, *,
|
|
|
+ def bind_value(self, target_object: Any, target_name: str = 'value', *,
|
|
|
forward: Callable = lambda x: x, backward: Callable = lambda x: x):
|
|
|
bind(self, 'value', target_object, target_name, forward=forward, backward=backward)
|
|
|
return self
|
|
@@ -140,15 +140,15 @@ class BindContentMixin:
|
|
|
"""
|
|
|
content = BindableProperty(on_change=lambda sender, content: sender.on_content_change(content))
|
|
|
|
|
|
- def bind_content_to(self, target_object: Any, target_name: str, forward: Callable = lambda x: x):
|
|
|
+ def bind_content_to(self, target_object: Any, target_name: str = 'content', forward: Callable = lambda x: x):
|
|
|
bind_to(self, 'content', target_object, target_name, forward)
|
|
|
return self
|
|
|
|
|
|
- def bind_content_from(self, target_object: Any, target_name: str, backward: Callable = lambda x: x):
|
|
|
+ def bind_content_from(self, target_object: Any, target_name: str = 'content', backward: Callable = lambda x: x):
|
|
|
bind_from(self, 'content', target_object, target_name, backward)
|
|
|
return self
|
|
|
|
|
|
- def bind_content(self, target_object: Any, target_name: str, *,
|
|
|
+ def bind_content(self, target_object: Any, target_name: str = 'content', *,
|
|
|
forward: Callable = lambda x: x, backward: Callable = lambda x: x):
|
|
|
bind(self, 'content', target_object, target_name, forward=forward, backward=backward)
|
|
|
return self
|
|
@@ -166,18 +166,18 @@ class BindVisibilityMixin:
|
|
|
"""
|
|
|
visibility = BindableProperty(on_change=lambda sender, visibility: sender.on_visibility_change(visibility))
|
|
|
|
|
|
- def bind_visibility_to(self, target_object: Any, target_name: str, forward: Callable = lambda x: x):
|
|
|
+ def bind_visibility_to(self, target_object: Any, target_name: str = 'visibility', forward: Callable = lambda x: x):
|
|
|
bind_to(self, 'visible', target_object, target_name, forward)
|
|
|
return self
|
|
|
|
|
|
- def bind_visibility_from(self, target_object: Any, target_name: str, backward: Callable = lambda x: x, *,
|
|
|
- value: Any = None):
|
|
|
+ def bind_visibility_from(self, target_object: Any, target_name: str = 'visibility',
|
|
|
+ backward: Callable = lambda x: x, *, value: Any = None):
|
|
|
if value is not None:
|
|
|
def backward(x): return x == value
|
|
|
bind_from(self, 'visible', target_object, target_name, backward)
|
|
|
return self
|
|
|
|
|
|
- def bind_visibility(self, target_object: Any, target_name: str, *,
|
|
|
+ def bind_visibility(self, target_object: Any, target_name: str = 'visibility', *,
|
|
|
forward: Callable = lambda x: x, backward: Callable = lambda x: x, value: Any = None):
|
|
|
if value is not None:
|
|
|
def backward(x): return x == value
|
|
@@ -197,15 +197,15 @@ class BindSourceMixin:
|
|
|
"""
|
|
|
source = BindableProperty(on_change=lambda sender, source: sender.on_source_change(source))
|
|
|
|
|
|
- def bind_source_to(self, target_object: Any, target_name: str, forward: Callable = lambda x: x):
|
|
|
+ def bind_source_to(self, target_object: Any, target_name: str = 'source', forward: Callable = lambda x: x):
|
|
|
bind_to(self, 'source', target_object, target_name, forward)
|
|
|
return self
|
|
|
|
|
|
- def bind_source_from(self, target_object: Any, target_name: str, backward: Callable = lambda x: x):
|
|
|
+ def bind_source_from(self, target_object: Any, target_name: str = 'source', backward: Callable = lambda x: x):
|
|
|
bind_from(self, 'source', target_object, target_name, backward)
|
|
|
return self
|
|
|
|
|
|
- def bind_source(self, target_object: Any, target_name: str, *,
|
|
|
+ def bind_source(self, target_object: Any, target_name: str = 'source', *,
|
|
|
forward: Callable = lambda x: x, backward: Callable = lambda x: x):
|
|
|
bind(self, 'source', target_object, target_name, forward=forward, backward=backward)
|
|
|
return self
|