summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/camera_2d.cpp50
-rw-r--r--scene/2d/camera_2d.h4
-rw-r--r--scene/2d/canvas_item.cpp11
-rw-r--r--scene/2d/canvas_item.h4
-rw-r--r--scene/2d/node_2d.cpp53
-rw-r--r--scene/2d/node_2d.h6
-rw-r--r--scene/2d/physics_body_2d.cpp77
-rw-r--r--scene/2d/physics_body_2d.h13
-rw-r--r--scene/gui/base_button.cpp11
-rw-r--r--scene/gui/control.cpp49
-rw-r--r--scene/gui/control.h5
-rw-r--r--scene/gui/graph_edit.cpp161
-rw-r--r--scene/gui/graph_edit.h3
-rw-r--r--scene/gui/slider.cpp9
-rw-r--r--scene/gui/tree.cpp91
-rw-r--r--scene/gui/tree.h10
16 files changed, 460 insertions, 97 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index f98a50e3e0..e576aa10e0 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -29,6 +29,8 @@
#include "camera_2d.h"
#include "scene/scene_string_names.h"
#include "servers/visual_server.h"
+#include "core/math/math_funcs.h"
+#include <editor/editor_node.h>
void Camera2D::_update_scroll() {
@@ -114,7 +116,25 @@ Matrix32 Camera2D::get_camera_transform() {
camera_pos=new_camera_pos;
}
-
+ Point2 screen_offset = (anchor_mode==ANCHOR_MODE_DRAG_CENTER ? (screen_size * 0.5 * zoom) : Point2());
+ Rect2 screen_rect(-screen_offset+camera_pos,screen_size*zoom);
+
+ if (offset!=Vector2())
+ screen_rect.pos+=offset;
+
+ if (limit_smoothing_enabled) {
+ if (screen_rect.pos.x < limit[MARGIN_LEFT])
+ camera_pos.x -= screen_rect.pos.x - limit[MARGIN_LEFT];
+
+ if (screen_rect.pos.x + screen_rect.size.x > limit[MARGIN_RIGHT])
+ camera_pos.x -= screen_rect.pos.x + screen_rect.size.x - limit[MARGIN_RIGHT];
+
+ if (screen_rect.pos.y + screen_rect.size.y > limit[MARGIN_BOTTOM])
+ camera_pos.y -= screen_rect.pos.y + screen_rect.size.y - limit[MARGIN_BOTTOM];
+
+ if (screen_rect.pos.y < limit[MARGIN_TOP])
+ camera_pos.y -= screen_rect.pos.y - limit[MARGIN_TOP];
+ }
if (smoothing_enabled && !get_tree()->is_editor_hint()) {
@@ -144,19 +164,19 @@ Matrix32 Camera2D::get_camera_transform() {
}
Rect2 screen_rect(-screen_offset+ret_camera_pos,screen_size*zoom);
+ if (screen_rect.pos.x < limit[MARGIN_LEFT])
+ screen_rect.pos.x = limit[MARGIN_LEFT];
+
if (screen_rect.pos.x + screen_rect.size.x > limit[MARGIN_RIGHT])
screen_rect.pos.x = limit[MARGIN_RIGHT] - screen_rect.size.x;
if (screen_rect.pos.y + screen_rect.size.y > limit[MARGIN_BOTTOM])
screen_rect.pos.y = limit[MARGIN_BOTTOM] - screen_rect.size.y;
-
- if (screen_rect.pos.x < limit[MARGIN_LEFT])
- screen_rect.pos.x=limit[MARGIN_LEFT];
-
if (screen_rect.pos.y < limit[MARGIN_TOP])
screen_rect.pos.y =limit[MARGIN_TOP];
-
+
+
if (offset!=Vector2()) {
screen_rect.pos+=offset;
@@ -382,6 +402,17 @@ int Camera2D::get_limit(Margin p_margin) const{
}
+void Camera2D::set_limit_smoothing_enabled(bool enable) {
+
+ limit_smoothing_enabled = enable;
+ _update_scroll();
+}
+
+bool Camera2D::is_limit_smoothing_enabled() const{
+
+ return limit_smoothing_enabled;
+}
+
void Camera2D::set_drag_margin(Margin p_margin,float p_drag_margin) {
ERR_FAIL_INDEX(p_margin,4);
@@ -536,13 +567,15 @@ void Camera2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_update_scroll"),&Camera2D::_update_scroll);
-
ObjectTypeDB::bind_method(_MD("_set_current","current"),&Camera2D::_set_current);
ObjectTypeDB::bind_method(_MD("is_current"),&Camera2D::is_current);
ObjectTypeDB::bind_method(_MD("set_limit","margin","limit"),&Camera2D::set_limit);
ObjectTypeDB::bind_method(_MD("get_limit","margin"),&Camera2D::get_limit);
+ ObjectTypeDB::bind_method(_MD("set_limit_smoothing_enabled","limit_smoothing_enabled"),&Camera2D::set_limit_smoothing_enabled);
+ ObjectTypeDB::bind_method(_MD("is_limit_smoothing_enabled"),&Camera2D::is_limit_smoothing_enabled);
+
ObjectTypeDB::bind_method(_MD("set_v_drag_enabled","enabled"),&Camera2D::set_v_drag_enabled);
ObjectTypeDB::bind_method(_MD("is_v_drag_enabled"),&Camera2D::is_v_drag_enabled);
@@ -587,6 +620,7 @@ void Camera2D::_bind_methods() {
ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit/top"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_TOP);
ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit/right"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_RIGHT);
ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit/bottom"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_BOTTOM);
+ ADD_PROPERTY( PropertyInfo(Variant::BOOL,"limit/smoothed"),_SCS("set_limit_smoothing_enabled"),_SCS("is_limit_smoothing_enabled") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin/h_enabled"),_SCS("set_h_drag_enabled"),_SCS("is_h_drag_enabled") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin/v_enabled"),_SCS("set_v_drag_enabled"),_SCS("is_v_drag_enabled") );
@@ -619,6 +653,7 @@ Camera2D::Camera2D() {
limit[MARGIN_TOP]=-10000000;
limit[MARGIN_RIGHT]=10000000;
limit[MARGIN_BOTTOM]=10000000;
+
drag_margin[MARGIN_LEFT]=0.2;
drag_margin[MARGIN_TOP]=0.2;
drag_margin[MARGIN_RIGHT]=0.2;
@@ -626,6 +661,7 @@ Camera2D::Camera2D() {
camera_pos=Vector2();
first=true;
smoothing_enabled=false;
+ limit_smoothing_enabled=false;
smoothing=5.0;
zoom = Vector2(1, 1);
diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h
index b3f55d798d..9f3e4254bb 100644
--- a/scene/2d/camera_2d.h
+++ b/scene/2d/camera_2d.h
@@ -61,6 +61,7 @@ protected:
float smoothing;
bool smoothing_enabled;
int limit[4];
+ bool limit_smoothing_enabled;
float drag_margin[4];
bool h_drag_enabled;
@@ -68,7 +69,6 @@ protected:
float h_ofs;
float v_ofs;
-
Point2 camera_screen_center;
void _update_scroll();
@@ -95,6 +95,8 @@ public:
void set_limit(Margin p_margin,int p_limit);
int get_limit(Margin p_margin) const;
+ void set_limit_smoothing_enabled(bool enable);
+ bool is_limit_smoothing_enabled() const;
void set_h_drag_enabled(bool p_enabled);
bool is_h_drag_enabled() const;
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index eb4f457975..2555b0fc98 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -650,21 +650,22 @@ int CanvasItem::get_light_mask() const{
}
-void CanvasItem::item_rect_changed() {
+void CanvasItem::item_rect_changed(bool p_size_changed) {
- update();
+ if (p_size_changed)
+ update();
emit_signal(SceneStringNames::get_singleton()->item_rect_changed);
}
-void CanvasItem::draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width) {
+void CanvasItem::draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width,bool p_antialiased) {
if (!drawing) {
ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
ERR_FAIL();
}
- VisualServer::get_singleton()->canvas_item_add_line(canvas_item,p_from,p_to,p_color,p_width);
+ VisualServer::get_singleton()->canvas_item_add_line(canvas_item,p_from,p_to,p_color,p_width,p_antialiased);
}
void CanvasItem::draw_rect(const Rect2& p_rect, const Color& p_color) {
@@ -1028,7 +1029,7 @@ void CanvasItem::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_is_on_top"),&CanvasItem::_is_on_top);
//ObjectTypeDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform);
- ObjectTypeDB::bind_method(_MD("draw_line","from","to","color","width"),&CanvasItem::draw_line,DEFVAL(1.0));
+ ObjectTypeDB::bind_method(_MD("draw_line","from","to","color","width"),&CanvasItem::draw_line,DEFVAL(1.0),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("draw_rect","rect","color"),&CanvasItem::draw_rect);
ObjectTypeDB::bind_method(_MD("draw_circle","pos","radius","color"),&CanvasItem::draw_circle);
ObjectTypeDB::bind_method(_MD("draw_texture","texture:Texture","pos","modulate"),&CanvasItem::draw_texture,DEFVAL(Color(1,1,1,1)));
diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h
index b894310ce2..7849a66185 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -157,7 +157,7 @@ protected:
_FORCE_INLINE_ void _notify_transform() { if (!is_inside_tree()) return; _notify_transform(this); if (!block_transform_notify && notify_local_transform) notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED); }
- void item_rect_changed();
+ void item_rect_changed(bool p_size_changed=true);
void _notification(int p_what);
static void _bind_methods();
@@ -207,7 +207,7 @@ public:
/* DRAWING API */
- void draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width=1.0);
+ void draw_line(const Point2& p_from, const Point2& p_to, const Color& p_color, float p_width=1.0, bool p_antialiased=false);
void draw_rect(const Rect2& p_rect, const Color& p_color);
void draw_circle(const Point2& p_pos, float p_radius, const Color& p_color);
void draw_texture(const Ref<Texture>& p_texture, const Point2& p_pos, const Color &p_modulate=Color(1,1,1,1));
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp
index 134e0153b3..df43e8e373 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.cpp
@@ -295,6 +295,53 @@ void Node2D::set_global_pos(const Point2& p_pos) {
}
}
+
+float Node2D::get_global_rot() const {
+
+ return get_global_transform().get_rotation();
+}
+
+void Node2D::set_global_rot(float p_radians) {
+
+ CanvasItem *pi = get_parent_item();
+ if (pi) {
+ const float parent_global_rot = pi->get_global_transform().get_rotation();
+ set_rot(p_radians - parent_global_rot);
+ } else {
+ set_rot(p_radians);
+ }
+}
+
+
+float Node2D::get_global_rotd() const {
+
+ return Math::rad2deg(get_global_rot());
+}
+
+void Node2D::set_global_rotd(float p_degrees) {
+
+ set_global_rot(Math::deg2rad(p_degrees));
+}
+
+
+Size2 Node2D::get_global_scale() const {
+
+ return get_global_transform().get_scale();
+}
+
+void Node2D::set_global_scale(const Size2& p_scale) {
+
+ CanvasItem *pi = get_parent_item();
+ if (pi) {
+ const Size2 parent_global_scale = pi->get_global_transform().get_scale();
+ set_scale(p_scale - parent_global_scale);
+ } else {
+ set_scale(p_scale);
+ }
+
+}
+
+
void Node2D::set_transform(const Matrix32& p_transform) {
_mat=p_transform;
@@ -398,6 +445,12 @@ void Node2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_global_pos","pos"),&Node2D::set_global_pos);
ObjectTypeDB::bind_method(_MD("get_global_pos"),&Node2D::get_global_pos);
+ ObjectTypeDB::bind_method(_MD("set_global_rot","radians"),&Node2D::set_global_rot);
+ ObjectTypeDB::bind_method(_MD("get_global_rot"),&Node2D::get_global_rot);
+ ObjectTypeDB::bind_method(_MD("set_global_rotd","degrees"),&Node2D::set_global_rotd);
+ ObjectTypeDB::bind_method(_MD("get_global_rotd"),&Node2D::get_global_rotd);
+ ObjectTypeDB::bind_method(_MD("set_global_scale","scale"),&Node2D::set_global_scale);
+ ObjectTypeDB::bind_method(_MD("get_global_scale"),&Node2D::get_global_scale);
ObjectTypeDB::bind_method(_MD("set_transform","xform"),&Node2D::set_transform);
ObjectTypeDB::bind_method(_MD("set_global_transform","xform"),&Node2D::set_global_transform);
diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h
index b0c628fd94..aa8d0ef33c 100644
--- a/scene/2d/node_2d.h
+++ b/scene/2d/node_2d.h
@@ -87,11 +87,17 @@ public:
Size2 get_scale() const;
Point2 get_global_pos() const;
+ float get_global_rot() const;
+ float get_global_rotd() const;
+ Size2 get_global_scale() const;
virtual Rect2 get_item_rect() const;
void set_transform(const Matrix32& p_transform);
void set_global_transform(const Matrix32& p_transform);
void set_global_pos(const Point2& p_pos);
+ void set_global_rot(float p_radians);
+ void set_global_rotd(float p_degrees);
+ void set_global_scale(const Size2& p_scale);
void set_z(int p_z);
int get_z() const;
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 26c4ea385f..75fa6054ad 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -1226,6 +1226,73 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) {
#endif
}
+
+
+Vector2 KinematicBody2D::move_and_slide(const Vector2& p_linear_velocity,const Vector2& p_floor_direction,int p_max_bounces) {
+
+ Vector2 motion = p_linear_velocity*get_fixed_process_delta_time();
+ Vector2 lv = p_linear_velocity;
+
+ move_and_slide_on_floor=false;
+ move_and_slide_on_ceiling=false;
+ move_and_slide_on_wall=false;
+ move_and_slide_colliders.clear();
+
+ while(motion!=Vector2() && p_max_bounces) {
+
+ motion=move(motion);
+
+ if (is_colliding()) {
+
+ if (p_floor_direction==Vector2()) {
+ //all is a wall
+ move_and_slide_on_wall=true;
+ } else {
+ if ( get_collision_normal().dot(p_floor_direction) > Math::cos(Math::deg2rad(45))) { //floor
+ move_and_slide_on_floor=true;
+ move_and_slide_floor_velocity=get_collider_velocity();
+ } else if ( get_collision_normal().dot(p_floor_direction) < Math::cos(Math::deg2rad(45))) { //ceiling
+ move_and_slide_on_ceiling=true;
+ } else {
+ move_and_slide_on_wall=true;
+ }
+
+ }
+
+ motion=get_collision_normal().slide(motion);
+ lv=get_collision_normal().slide(lv);
+ Variant collider = _get_collider();
+ if (collider.get_type()!=Variant::NIL) {
+ move_and_slide_colliders.push_back(collider);
+ }
+
+ } else {
+ break;
+ }
+
+ p_max_bounces--;
+ }
+
+ return lv;
+}
+
+bool KinematicBody2D::is_move_and_slide_on_floor() const {
+
+ return move_and_slide_on_floor;
+}
+bool KinematicBody2D::is_move_and_slide_on_wall() const{
+
+ return move_and_slide_on_wall;
+}
+bool KinematicBody2D::is_move_and_slide_on_ceiling() const{
+
+ return move_and_slide_on_ceiling;
+}
+Array KinematicBody2D::get_move_and_slide_colliders() const{
+
+ return move_and_slide_colliders;
+}
+
Vector2 KinematicBody2D::move_to(const Vector2& p_position) {
return move(p_position-get_global_pos());
@@ -1300,6 +1367,7 @@ void KinematicBody2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("move","rel_vec"),&KinematicBody2D::move);
ObjectTypeDB::bind_method(_MD("move_to","position"),&KinematicBody2D::move_to);
+ ObjectTypeDB::bind_method(_MD("move_and_slide","linear_velocity","floor_normal","max_bounces"),&KinematicBody2D::move_and_slide,DEFVAL(Vector2(0,0)),DEFVAL(4));
ObjectTypeDB::bind_method(_MD("test_move","rel_vec"),&KinematicBody2D::test_move);
ObjectTypeDB::bind_method(_MD("get_travel"),&KinematicBody2D::get_travel);
@@ -1313,6 +1381,10 @@ void KinematicBody2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_collider:Object"),&KinematicBody2D::_get_collider);
ObjectTypeDB::bind_method(_MD("get_collider_shape"),&KinematicBody2D::get_collider_shape);
ObjectTypeDB::bind_method(_MD("get_collider_metadata:Variant"),&KinematicBody2D::get_collider_metadata);
+ ObjectTypeDB::bind_method(_MD("get_move_and_slide_colliders"),&KinematicBody2D::get_move_and_slide_colliders);
+ ObjectTypeDB::bind_method(_MD("is_move_and_slide_on_floor"),&KinematicBody2D::is_move_and_slide_on_floor);
+ ObjectTypeDB::bind_method(_MD("is_move_and_slide_on_ceiling"),&KinematicBody2D::is_move_and_slide_on_ceiling);
+ ObjectTypeDB::bind_method(_MD("is_move_and_slide_on_wall"),&KinematicBody2D::is_move_and_slide_on_wall);
ObjectTypeDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody2D::set_collision_margin);
ObjectTypeDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody2D::get_collision_margin);
@@ -1330,6 +1402,11 @@ KinematicBody2D::KinematicBody2D() : PhysicsBody2D(Physics2DServer::BODY_MODE_KI
collider_shape=0;
margin=0.08;
+
+ move_and_slide_on_floor=false;
+ move_and_slide_on_ceiling=false;
+ move_and_slide_on_wall=false;
+
}
KinematicBody2D::~KinematicBody2D() {
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h
index 5af65bff33..387267cd09 100644
--- a/scene/2d/physics_body_2d.h
+++ b/scene/2d/physics_body_2d.h
@@ -302,6 +302,12 @@ class KinematicBody2D : public PhysicsBody2D {
Variant collider_metadata;
Vector2 travel;
+ Vector2 move_and_slide_floor_velocity;
+ bool move_and_slide_on_floor;
+ bool move_and_slide_on_ceiling;
+ bool move_and_slide_on_wall;
+ Array move_and_slide_colliders;
+
Variant _get_collider() const;
_FORCE_INLINE_ bool _ignores_mode(Physics2DServer::BodyMode) const;
@@ -329,6 +335,13 @@ public:
void set_collision_margin(float p_margin);
float get_collision_margin() const;
+ Vector2 move_and_slide(const Vector2& p_linear_velocity,const Vector2& p_floor_direction=Vector2(0,0),int p_max_bounces=4);
+ bool is_move_and_slide_on_floor() const;
+ bool is_move_and_slide_on_wall() const;
+ bool is_move_and_slide_on_ceiling() const;
+ Array get_move_and_slide_colliders() const;
+
+
KinematicBody2D();
~KinematicBody2D();
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 41d766c1b7..6479dd2d02 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -55,6 +55,8 @@ void BaseButton::_input_event(InputEvent p_event) {
if (b.pressed) {
+ emit_signal("button_down");
+
if (!toggle_mode) { //mouse press attempt
status.press_attempt=true;
@@ -86,6 +88,8 @@ void BaseButton::_input_event(InputEvent p_event) {
} else {
+ emit_signal("button_up");
+
if (status.press_attempt && status.pressing_inside) {
// released();
emit_signal("released");
@@ -100,9 +104,11 @@ void BaseButton::_input_event(InputEvent p_event) {
status.press_attempt=true;
status.pressing_inside=true;
+ emit_signal("button_down");
} else {
+ emit_signal("button_up");
if (status.press_attempt &&status.pressing_inside) {
@@ -173,6 +179,7 @@ void BaseButton::_input_event(InputEvent p_event) {
status.pressing_button++;
status.press_attempt=true;
status.pressing_inside=true;
+ emit_signal("button_down");
} else if (status.press_attempt) {
@@ -185,6 +192,8 @@ void BaseButton::_input_event(InputEvent p_event) {
status.press_attempt=false;
status.pressing_inside=false;
+ emit_signal("button_up");
+
if (!toggle_mode) { //mouse press attempt
pressed();
@@ -467,6 +476,8 @@ void BaseButton::_bind_methods() {
ADD_SIGNAL( MethodInfo("pressed" ) );
ADD_SIGNAL( MethodInfo("released" ) );
+ ADD_SIGNAL( MethodInfo("button_up") );
+ ADD_SIGNAL( MethodInfo("button_down") );
ADD_SIGNAL( MethodInfo("toggled", PropertyInfo( Variant::BOOL,"pressed") ) );
ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "disabled"), _SCS("set_disabled"), _SCS("is_disabled"));
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "toggle_mode"), _SCS("set_toggle_mode"), _SCS("is_toggle_mode"));
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 97133a2a3b..bf35fd25bd 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -449,6 +449,13 @@ void Control::remove_child_notify(Node *p_child) {
}
+void Control::_update_canvas_item_transform() {
+
+ Matrix32 xform=Matrix32(data.rotation,get_pos());
+ xform.scale_basis(data.scale);
+ VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(),xform);
+
+}
void Control::_notification(int p_notification) {
@@ -600,10 +607,9 @@ void Control::_notification(int p_notification) {
} break;
case NOTIFICATION_DRAW: {
- Matrix32 xform=Matrix32(data.rotation,get_pos());
- xform.scale_basis(data.scale);
- VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(),xform);
- VisualServer::get_singleton()->canvas_item_set_custom_rect( get_canvas_item(),true, Rect2(Point2(),get_size()));
+ _update_canvas_item_transform();
+ VisualServer::get_singleton()->canvas_item_set_custom_rect( get_canvas_item(),!data.disable_visibility_clip, Rect2(Point2(),get_size()));
+
//emit_signal(SceneStringNames::get_singleton()->draw);
} break;
@@ -1272,17 +1278,24 @@ void Control::_size_changed() {
new_size_cache.x = MAX( minimum_size.x, new_size_cache.x );
new_size_cache.y = MAX( minimum_size.y, new_size_cache.y );
-
- if (new_pos_cache == data.pos_cache && new_size_cache == data.size_cache)
- return; // did not change, don't emit signal
+ bool pos_changed = new_pos_cache != data.pos_cache;
+ bool size_changed = new_size_cache != data.size_cache;
data.pos_cache=new_pos_cache;
data.size_cache=new_size_cache;
- notification(NOTIFICATION_RESIZED);
- item_rect_changed();
- _change_notify_margins();
- _notify_transform();
+ if (size_changed) {
+ notification(NOTIFICATION_RESIZED);
+ }
+ if (pos_changed || size_changed) {
+ item_rect_changed(size_changed);
+ _change_notify_margins();
+ _notify_transform();
+ }
+
+ if (pos_changed && !size_changed) {
+ _update_canvas_item_transform(); //move because it won't be updated
+ }
}
float Control::_get_parent_range(int p_idx) const {
@@ -2382,6 +2395,19 @@ bool Control::is_minimum_size_adjust_blocked() const {
return data.block_minimum_size_adjust;
}
+
+
+void Control::set_disable_visibility_clip(bool p_ignore) {
+
+ data.disable_visibility_clip=p_ignore;
+ update();
+}
+
+bool Control::is_visibility_clip_disabled() const {
+
+ return data.disable_visibility_clip;
+}
+
void Control::_bind_methods() {
@@ -2610,6 +2636,7 @@ Control::Control() {
data.drag_owner=0;
data.modal_frame=0;
data.block_minimum_size_adjust=false;
+ data.disable_visibility_clip=false;
for (int i=0;i<4;i++) {
diff --git a/scene/gui/control.h b/scene/gui/control.h
index e6b0844869..558439efbf 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -129,6 +129,7 @@ private:
bool stop_mouse;
bool block_minimum_size_adjust;
+ bool disable_visibility_clip;
Control *parent;
ObjectID drag_owner;
@@ -195,6 +196,7 @@ private:
void _unref_font( Ref<Font> p_sc);
void _font_changed();
+ void _update_canvas_item_transform();
friend class Viewport;
@@ -402,6 +404,9 @@ public:
void set_block_minimum_size_adjust(bool p_block);
bool is_minimum_size_adjust_blocked() const;
+ void set_disable_visibility_clip(bool p_ignore);
+ bool is_visibility_clip_disabled() const;
+
Control();
~Control();
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index a7a813d335..2307b33345 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -62,6 +62,7 @@ Error GraphEdit::connect_node(const StringName& p_from, int p_from_port,const St
connections.push_back(c);
top_layer->update();
update();
+ connections_layer->update();
return OK;
}
@@ -87,6 +88,7 @@ void GraphEdit::disconnect_node(const StringName& p_from, int p_from_port,const
connections.erase(E);
top_layer->update();
update();
+ connections_layer->update();
return;
}
}
@@ -118,7 +120,11 @@ Vector2 GraphEdit::get_scroll_ofs() const{
void GraphEdit::_scroll_moved(double) {
- _update_scroll_offset();
+
+ if (!awaiting_scroll_offset_update) {
+ call_deferred("_update_scroll_offset");
+ awaiting_scroll_offset_update=true;
+ }
top_layer->update();
update();
@@ -129,6 +135,8 @@ void GraphEdit::_scroll_moved(double) {
void GraphEdit::_update_scroll_offset() {
+ set_block_minimum_size_adjust(true);
+
for(int i=0;i<get_child_count();i++) {
GraphNode *gn=get_child(i)->cast_to<GraphNode>();
@@ -138,9 +146,15 @@ void GraphEdit::_update_scroll_offset() {
Point2 pos=gn->get_offset()*zoom;
pos-=Point2(h_scroll->get_val(),v_scroll->get_val());
gn->set_pos(pos);
- gn->set_scale(Vector2(zoom,zoom));
+ if (gn->get_scale()!=Vector2(zoom,zoom)) {
+ gn->set_scale(Vector2(zoom,zoom));
+ }
}
+ connections_layer->set_pos(-Point2(h_scroll->get_val(),v_scroll->get_val())*zoom);
+ set_block_minimum_size_adjust(false);
+ awaiting_scroll_offset_update=false;
+
}
void GraphEdit::_update_scroll() {
@@ -149,6 +163,9 @@ void GraphEdit::_update_scroll() {
return;
updating=true;
+
+ set_block_minimum_size_adjust(true);
+
Rect2 screen;
for(int i=0;i<get_child_count();i++) {
@@ -183,7 +200,13 @@ void GraphEdit::_update_scroll() {
else
v_scroll->show();
- _update_scroll_offset();
+ set_block_minimum_size_adjust(false);
+
+ if (!awaiting_scroll_offset_update) {
+ call_deferred("_update_scroll_offset");
+ awaiting_scroll_offset_update=true;
+ }
+
updating=false;
}
@@ -196,6 +219,16 @@ void GraphEdit::_graph_node_raised(Node* p_gn) {
if (gn->is_comment()) {
move_child(gn,0);
}
+ int first_not_comment=0;
+ for(int i=0;i<get_child_count();i++) {
+ GraphNode *gn=get_child(i)->cast_to<GraphNode>();
+ if (gn && !gn->is_comment()) {
+ first_not_comment=i;
+ break;
+ }
+ }
+
+ move_child(connections_layer,first_not_comment);
top_layer->raise();
emit_signal("node_selected",p_gn);
@@ -208,6 +241,7 @@ void GraphEdit::_graph_node_moved(Node *p_gn) {
ERR_FAIL_COND(!gn);
top_layer->update();
update();
+ connections_layer->update();
}
void GraphEdit::add_child_notify(Node *p_child) {
@@ -265,6 +299,7 @@ void GraphEdit::_notification(int p_what) {
}
if (p_what==NOTIFICATION_DRAW) {
+
draw_style_box( get_stylebox("bg"),Rect2(Point2(),get_size()) );
VS::get_singleton()->canvas_item_set_clip(get_canvas_item(),true);
@@ -310,53 +345,7 @@ void GraphEdit::_notification(int p_what) {
}
- {
- //draw connections
- List<List<Connection>::Element* > to_erase;
- for(List<Connection>::Element *E=connections.front();E;E=E->next()) {
-
- NodePath fromnp(E->get().from);
-
- Node * from = get_node(fromnp);
- if (!from) {
- to_erase.push_back(E);
- continue;
- }
-
- GraphNode *gfrom = from->cast_to<GraphNode>();
-
- if (!gfrom) {
- to_erase.push_back(E);
- continue;
- }
-
- NodePath tonp(E->get().to);
- Node * to = get_node(tonp);
- if (!to) {
- to_erase.push_back(E);
- continue;
- }
-
- GraphNode *gto = to->cast_to<GraphNode>();
-
- if (!gto) {
- to_erase.push_back(E);
- continue;
- }
- Vector2 frompos=gfrom->get_connection_output_pos(E->get().from_port)+gfrom->get_pos();
- Color color = gfrom->get_connection_output_color(E->get().from_port);
- Vector2 topos=gto->get_connection_input_pos(E->get().to_port)+gto->get_pos();
- Color tocolor = gto->get_connection_input_color(E->get().to_port);
- _draw_cos_line(this,frompos,topos,color,tocolor);
-
- }
-
- while(to_erase.size()) {
- connections.erase(to_erase.front()->get());
- to_erase.pop_front();
- }
- }
}
@@ -588,6 +577,7 @@ void GraphEdit::_top_layer_input(const InputEvent& p_ev) {
connecting=false;
top_layer->update();
update();
+ connections_layer->update();
}
@@ -625,7 +615,7 @@ void GraphEdit::_bake_segment2d(CanvasItem* p_where,float p_begin, float p_end,c
- p_where->draw_line(beg,end,p_color.linear_interpolate(p_to_color,mp),2);
+ p_where->draw_line(beg,end,p_color.linear_interpolate(p_to_color,mp),2,true);
lines++;
} else {
_bake_segment2d(p_where,p_begin,mp,p_a,p_out,p_b,p_in,p_depth+1,p_min_depth,p_max_depth,p_tol,p_color,p_to_color,lines);
@@ -636,6 +626,7 @@ void GraphEdit::_bake_segment2d(CanvasItem* p_where,float p_begin, float p_end,c
void GraphEdit::_draw_cos_line(CanvasItem* p_where,const Vector2& p_from, const Vector2& p_to,const Color& p_color,const Color& p_to_color) {
+
#if 1
//cubic bezier code
@@ -654,8 +645,7 @@ void GraphEdit::_draw_cos_line(CanvasItem* p_where,const Vector2& p_from, const
Vector2 c2 = Vector2(-cp_offset,0);
int lines=0;
- _bake_segment2d(p_where,0,1,p_from,c1,p_to,c2,0,5,12,8,p_color,p_to_color,lines);
- //print_line("used lines: "+itos(lines));
+ _bake_segment2d(p_where,0,1,p_from,c1,p_to,c2,0,3,9,8,p_color,p_to_color,lines);
#else
@@ -689,6 +679,59 @@ void GraphEdit::_draw_cos_line(CanvasItem* p_where,const Vector2& p_from, const
#endif
}
+
+void GraphEdit::_connections_layer_draw() {
+
+
+ {
+ //draw connections
+ List<List<Connection>::Element* > to_erase;
+ for(List<Connection>::Element *E=connections.front();E;E=E->next()) {
+
+ NodePath fromnp(E->get().from);
+
+ Node * from = get_node(fromnp);
+ if (!from) {
+ to_erase.push_back(E);
+ continue;
+ }
+
+ GraphNode *gfrom = from->cast_to<GraphNode>();
+
+ if (!gfrom) {
+ to_erase.push_back(E);
+ continue;
+ }
+
+ NodePath tonp(E->get().to);
+ Node * to = get_node(tonp);
+ if (!to) {
+ to_erase.push_back(E);
+ continue;
+ }
+
+ GraphNode *gto = to->cast_to<GraphNode>();
+
+ if (!gto) {
+ to_erase.push_back(E);
+ continue;
+ }
+
+ Vector2 frompos=gfrom->get_connection_output_pos(E->get().from_port)+gfrom->get_offset();
+ Color color = gfrom->get_connection_output_color(E->get().from_port);
+ Vector2 topos=gto->get_connection_input_pos(E->get().to_port)+gto->get_offset();
+ Color tocolor = gto->get_connection_input_color(E->get().to_port);
+ _draw_cos_line(connections_layer,frompos,topos,color,tocolor);
+
+ }
+
+ while(to_erase.size()) {
+ connections.erase(to_erase.front()->get());
+ to_erase.pop_front();
+ }
+ }
+}
+
void GraphEdit::_top_layer_draw() {
_update_scroll();
@@ -854,6 +897,7 @@ void GraphEdit::_input_event(const InputEvent& p_ev) {
top_layer->update();
update();
+ connections_layer->update();
}
if (b.button_index==BUTTON_LEFT && b.pressed) {
@@ -979,6 +1023,7 @@ void GraphEdit::clear_connections() {
connections.clear();
update();
+ connections_layer->update();
}
void GraphEdit::set_zoom(float p_zoom) {
@@ -1112,6 +1157,7 @@ void GraphEdit::set_use_snap(bool p_enable) {
snap_button->set_pressed(p_enable);
update();
+
}
bool GraphEdit::is_using_snap() const{
@@ -1175,6 +1221,10 @@ void GraphEdit::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_snap_value_changed"),&GraphEdit::_snap_value_changed);
ObjectTypeDB::bind_method(_MD("_input_event"),&GraphEdit::_input_event);
+ ObjectTypeDB::bind_method(_MD("_update_scroll_offset"),&GraphEdit::_update_scroll_offset);
+ ObjectTypeDB::bind_method(_MD("_connections_layer_draw"),&GraphEdit::_connections_layer_draw);
+
+
ObjectTypeDB::bind_method(_MD("set_selected","node"),&GraphEdit::set_selected);
@@ -1195,6 +1245,7 @@ void GraphEdit::_bind_methods() {
GraphEdit::GraphEdit() {
set_focus_mode(FOCUS_ALL);
+ awaiting_scroll_offset_update=false;
top_layer=NULL;
top_layer=memnew(GraphEditFilter(this));
add_child(top_layer);
@@ -1204,6 +1255,12 @@ GraphEdit::GraphEdit() {
top_layer->set_stop_mouse(false);
top_layer->connect("input_event",this,"_top_layer_input");
+ connections_layer = memnew( Control );
+ add_child(connections_layer);
+ connections_layer->connect("draw",this,"_connections_layer_draw");
+ connections_layer->set_name("CLAYER");
+ connections_layer->set_disable_visibility_clip(true); // so it can draw freely and be offseted
+
h_scroll = memnew(HScrollBar);
h_scroll->set_name("_h_scroll");
top_layer->add_child(h_scroll);
diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h
index c3276ceacc..ed6e4ef6ac 100644
--- a/scene/gui/graph_edit.h
+++ b/scene/gui/graph_edit.h
@@ -110,6 +110,7 @@ private:
bool setting_scroll_ofs;
bool right_disconnects;
bool updating;
+ bool awaiting_scroll_offset_update;
List<Connection> connections;
void _bake_segment2d(CanvasItem* p_where,float p_begin, float p_end, const Vector2& p_a, const Vector2& p_out, const Vector2& p_b, const Vector2& p_in, int p_depth, int p_min_depth, int p_max_depth, float p_tol, const Color& p_color, const Color& p_to_color, int &lines) const;
@@ -123,9 +124,11 @@ private:
void _scroll_moved(double);
void _input_event(const InputEvent& p_ev);
+ Control *connections_layer;
GraphEditFilter *top_layer;
void _top_layer_input(const InputEvent& p_ev);
void _top_layer_draw();
+ void _connections_layer_draw();
void _update_scroll_offset();
Array _get_connection_list() const;
diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp
index d5d14ad649..3b9ca40bd8 100644
--- a/scene/gui/slider.cpp
+++ b/scene/gui/slider.cpp
@@ -47,12 +47,15 @@ void Slider::_input_event(InputEvent p_event) {
if (mb.button_index==BUTTON_LEFT) {
if (mb.pressed) {
+ Ref<Texture> grabber = get_icon(mouse_inside||has_focus()?"grabber_hilite":"grabber");
grab.pos=orientation==VERTICAL?mb.y:mb.x;
- double max = orientation==VERTICAL ? get_size().height : get_size().width ;
+ double grab_width = (double)grabber->get_size().width;
+ double grab_height = (double)grabber->get_size().height;
+ double max = orientation==VERTICAL ? get_size().height - grab_height : get_size().width - grab_width;
if (orientation==VERTICAL)
- set_unit_value( 1 - ((double)grab.pos / max) );
+ set_unit_value( 1 - (((double)grab.pos - (grab_height / 2.0)) / max) );
else
- set_unit_value((double)grab.pos / max);
+ set_unit_value(((double)grab.pos - (grab_width/2.0)) / max);
grab.active=true;
grab.uvalue=get_unit_value();
} else {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index e10922f057..20794b2faa 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -171,6 +171,21 @@ String TreeItem::get_text(int p_column) const {
}
+void TreeItem::set_suffix(int p_column,String p_suffix) {
+
+ ERR_FAIL_INDEX( p_column, cells.size() );
+ cells[p_column].suffix=p_suffix;
+
+ _changed_notify(p_column);
+
+}
+
+String TreeItem::get_suffix(int p_column) const {
+
+ ERR_FAIL_INDEX_V( p_column, cells.size(), "" );
+ return cells[p_column].suffix;
+
+}
void TreeItem::set_icon(int p_column,const Ref<Texture>& p_icon) {
@@ -927,8 +942,12 @@ void Tree::draw_item_rect(const TreeItem::Cell& p_cell,const Rect2i& p_rect,cons
Ref<Font> font = cache.font;
+ String text = p_cell.text;
+ if (p_cell.suffix!=String())
+ text+=" "+p_cell.suffix;
+
rect.pos.y+=Math::floor((rect.size.y-font->get_height())/2.0) +font->get_ascent();
- font->draw(ci,rect.pos,p_cell.text,p_color,rect.size.x);
+ font->draw(ci,rect.pos,text,p_color,rect.size.x);
}
@@ -1072,11 +1091,21 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
if (p_item->cells[i].selected && select_mode!=SELECT_ROW) {
Rect2i r(item_rect.pos,item_rect.size);
+ if (p_item->cells[i].text.size() > 0){
+ float icon_width = p_item->cells[i].get_icon_size().width;
+ r.pos.x += icon_width;
+ r.size.x -= icon_width;
+ }
//r.grow(cache.selected->get_margin(MARGIN_LEFT));
- if (has_focus())
+ if (has_focus()){
cache.selected_focus->draw(ci,r );
- else
+ p_item->set_meta("__focus_rect", Rect2(r.pos,r.size));
+ } else {
cache.selected->draw(ci,r );
+ }
+ if (text_editor->is_visible()){
+ text_editor->set_pos(get_global_pos() + r.pos);
+ }
}
if (p_item->cells[i].custom_bg_color) {
@@ -1165,6 +1194,9 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
String s = p_item->cells[i].text;
s=s.get_slicec(',',option);
+ if (p_item->cells[i].suffix!=String())
+ s+=" "+p_item->cells[i].suffix;
+
Ref<Texture> downarrow = cache.select_arrow;
font->draw(ci, text_pos, s, col,item_rect.size.x-downarrow->get_width() );
@@ -1181,6 +1213,10 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
String valtext = String::num( p_item->cells[i].val, Math::step_decimals( p_item->cells[i].step ) );
//String valtext = rtos( p_item->cells[i].val );
+
+ if (p_item->cells[i].suffix!=String())
+ valtext+=" "+p_item->cells[i].suffix;
+
font->draw( ci, text_pos, valtext, col, item_rect.size.x-updown->get_width());
if (!p_item->cells[i].editable)
@@ -2328,9 +2364,22 @@ void Tree::_input_event(InputEvent p_event) {
range_drag_enabled=false;
Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE);
warp_mouse(range_drag_capture_pos);
- } else
- edit_selected();
+ } else {
+ if (delayed_text_editor) {
+ uint64_t diff = OS::get_singleton()->get_ticks_msec() - first_selection_time;
+ if (diff >= 400 && diff <= 800)
+ edit_selected();
+ // fast double click
+ else if (diff < 400) {
+ emit_signal("item_double_clicked");
+ }
+
+ first_selection_time = OS::get_singleton()->get_ticks_msec();
+ } else {
+ edit_selected();
+ }
+ }
pressing_for_editor=false;
}
@@ -2468,16 +2517,7 @@ bool Tree::edit_selected() {
if (!s->cells[col].editable)
return false;
- Rect2 rect;
- rect.pos.y = get_item_offset(s) - get_scroll().y;
-
- for(int i=0;i<col;i++) {
-
- rect.pos.x+=get_column_width(i);
- }
-
- rect.size.width=get_column_width(col);
- rect.size.height=compute_item_height(s)+cache.vseparation;
+ Rect2 rect = s->get_meta("__focus_rect");
popup_edited_item=s;
popup_edited_item_col=col;
@@ -2848,7 +2888,6 @@ void Tree::item_changed(int p_column,TreeItem *p_item) {
void Tree::item_selected(int p_column,TreeItem *p_item) {
-
if (select_mode==SELECT_MULTI) {
if (!p_item->cells[p_column].selectable)
@@ -2856,8 +2895,11 @@ void Tree::item_selected(int p_column,TreeItem *p_item) {
p_item->cells[p_column].selected=true;
//emit_signal("multi_selected",p_item,p_column,true); - NO this is for TreeItem::select
+ if (delayed_text_editor)
+ first_selection_time = OS::get_singleton()->get_ticks_msec();
} else {
+
select_single_item(p_item,root,p_column);
}
update();
@@ -3503,6 +3545,16 @@ bool Tree::get_allow_rmb_select() const{
return allow_rmb_select;
}
+
+void Tree::set_delayed_text_editor(bool enabled) {
+ delayed_text_editor = enabled;
+}
+
+bool Tree::is_delayed_text_editor_enabled() const {
+ return delayed_text_editor;
+}
+
+
void Tree::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_range_click_timeout"),&Tree::_range_click_timeout);
@@ -3556,6 +3608,9 @@ void Tree::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_allow_rmb_select","allow"),&Tree::set_allow_rmb_select);
ObjectTypeDB::bind_method(_MD("get_allow_rmb_select"),&Tree::get_allow_rmb_select);
+ ObjectTypeDB::bind_method(_MD("set_delayed_text_editor","enable"),&Tree::set_delayed_text_editor);
+ ObjectTypeDB::bind_method(_MD("is_delayed_text_editor_enabled"),&Tree::is_delayed_text_editor_enabled);
+
ObjectTypeDB::bind_method(_MD("set_single_select_cell_editing_only_when_already_selected","enable"),&Tree::set_single_select_cell_editing_only_when_already_selected);
ObjectTypeDB::bind_method(_MD("get_single_select_cell_editing_only_when_already_selected"),&Tree::get_single_select_cell_editing_only_when_already_selected);
@@ -3566,6 +3621,7 @@ void Tree::_bind_methods() {
ADD_SIGNAL( MethodInfo("item_rmb_selected",PropertyInfo(Variant::VECTOR2,"pos")));
ADD_SIGNAL( MethodInfo("empty_tree_rmb_selected",PropertyInfo(Variant::VECTOR2,"pos")));
ADD_SIGNAL( MethodInfo("item_edited"));
+ ADD_SIGNAL( MethodInfo("item_double_clicked"));
ADD_SIGNAL( MethodInfo("item_collapsed",PropertyInfo(Variant::OBJECT,"item")));
//ADD_SIGNAL( MethodInfo("item_doubleclicked" ) );
ADD_SIGNAL( MethodInfo("button_pressed",PropertyInfo(Variant::OBJECT,"item"),PropertyInfo(Variant::INT,"column"),PropertyInfo(Variant::INT,"id")));
@@ -3669,6 +3725,9 @@ Tree::Tree() {
force_select_on_already_selected=false;
allow_rmb_select=false;
+
+ first_selection_time = 0;
+ delayed_text_editor = false;
}
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index f5100ab5b6..2124dce749 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -69,6 +69,7 @@ friend class Tree;
Ref<Texture> icon;
Rect2i icon_region;
String text;
+ String suffix;
double min,max,step,val;
int icon_max_w;
bool expr;
@@ -168,6 +169,9 @@ public:
void set_text(int p_column,String p_text);
String get_text(int p_column) const;
+ void set_suffix(int p_column,String p_suffix);
+ String get_suffix(int p_column) const;
+
void set_icon(int p_column,const Ref<Texture>& p_icon);
Ref<Texture> get_icon(int p_column) const;
@@ -433,6 +437,9 @@ friend class TreeItem;
float last_drag_time;
float time_since_motion;*/
+ bool delayed_text_editor;
+ uint64_t first_selection_time;
+
float drag_speed;
float drag_from;
float drag_accum;
@@ -527,6 +534,9 @@ public:
void set_value_evaluator(ValueEvaluator *p_evaluator);
+ void set_delayed_text_editor(bool enabled);
+ bool is_delayed_text_editor_enabled() const;
+
Tree();
~Tree();