summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-06-17 11:58:35 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-06-17 11:58:35 -0300
commitddc0e7fd3bc00afa33432ed594038dbb80c7fea3 (patch)
tree5fa809fa7b32808837e28aeb90cb53aef1222d7e /scene/gui
parent155028612bfe26c7c8460f6acc28de6d385a3625 (diff)
FineTune HDR and Other Stuff
-=-=-=-=-=-=-=-=-=-=-=-=-=- -More parameters to ESM shadows -LightMap Octree now can bake to "hdr" (use HDR8 for now) -New resource PolygonPathFinder, polygon based pathfinder using A-star algorithm. (will add nodes to use it more easily soon)
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/scroll_bar.cpp43
-rw-r--r--scene/gui/scroll_bar.h10
2 files changed, 52 insertions, 1 deletions
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp
index fdd30c5f60..b13fdabea9 100644
--- a/scene/gui/scroll_bar.cpp
+++ b/scene/gui/scroll_bar.cpp
@@ -432,6 +432,46 @@ float ScrollBar::get_custom_step() const {
}
+void ScrollBar::_drag_slave_exit() {
+
+
+}
+
+
+void ScrollBar::_drag_slave_input(const InputEvent& p_input) {
+
+
+}
+
+void ScrollBar::set_drag_slave(const NodePath& p_path) {
+
+ if (drag_slave) {
+ drag_slave->disconnect("input_event",this,"_drag_slave_input");
+ drag_slave->disconnect("exit_scene",this,"_drag_slave_exit");
+ }
+
+ drag_slave=NULL;
+ drag_slave_path=p_path;
+ if (has_node(p_path)) {
+ Node *n = get_node(p_path);
+ drag_slave=n->cast_to<Control>();
+ }
+
+ if (drag_slave) {
+ drag_slave->connect("input_event",this,"_drag_slave_input");
+ drag_slave->connect("exit_scene",this,"_drag_slave_exit",varray(),CONNECT_ONESHOT);
+ }
+
+}
+
+NodePath ScrollBar::get_drag_slave() const{
+
+
+ return drag_slave_path;
+}
+
+
+
#if 0
void ScrollBar::mouse_button(const Point2& p_pos, int b.button_index,bool b.pressed,int p_modifier_mask) {
@@ -571,6 +611,8 @@ void ScrollBar::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_input_event"),&ScrollBar::_input_event);
ObjectTypeDB::bind_method(_MD("set_custom_step","step"),&ScrollBar::set_custom_step);
ObjectTypeDB::bind_method(_MD("get_custom_step"),&ScrollBar::get_custom_step);
+ ObjectTypeDB::bind_method(_MD("_drag_slave_input"),&ScrollBar::_drag_slave_input);
+ ObjectTypeDB::bind_method(_MD("_drag_slave_exit"),&ScrollBar::_drag_slave_exit);
ADD_PROPERTY( PropertyInfo(Variant::REAL,"custom_step",PROPERTY_HINT_RANGE,"-1,4096"), _SCS("set_custom_step"),_SCS("get_custom_step"));
@@ -584,6 +626,7 @@ ScrollBar::ScrollBar(Orientation p_orientation)
orientation=p_orientation;
hilite=HILITE_NONE;
custom_step=-1;
+ drag_slave=NULL;
drag.active=false;
diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h
index 663d3ecd85..0c20982083 100644
--- a/scene/gui/scroll_bar.h
+++ b/scene/gui/scroll_bar.h
@@ -70,7 +70,12 @@ class ScrollBar : public Range {
double get_grabber_offset() const;
static void set_can_focus_by_default(bool p_can_focus);
-
+
+ Node* drag_slave;
+ NodePath drag_slave_path;
+
+ void _drag_slave_exit();
+ void _drag_slave_input(const InputEvent& p_input);
void _input_event(InputEvent p_event);
protected:
@@ -83,6 +88,9 @@ public:
void set_custom_step(float p_custom_step);
float get_custom_step() const;
+ void set_drag_slave(const NodePath& p_path);
+ NodePath get_drag_slave() const;
+
virtual Size2 get_minimum_size() const;
ScrollBar(Orientation p_orientation=VERTICAL);
~ScrollBar();