summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-12 18:27:27 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-12 18:28:12 -0300
commitda477b76a98ee7ca4ac16773d3baf1299e053da7 (patch)
tree8cd8611b43081d51df4a293ae0b27f0b8ce50fa2 /scene/gui
parenta971186c266de2df818a7f3dc063a49b0ad51bd8 (diff)
some class renames
TextureFrame -> TextureRect Patch9Frame -> NinePatchRect ColorFrame -> ColorRect
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/color_picker.cpp4
-rw-r--r--scene/gui/color_picker.h4
-rw-r--r--scene/gui/color_rect.cpp14
-rw-r--r--scene/gui/color_rect.h6
-rw-r--r--scene/gui/patch_9_frame.cpp42
-rw-r--r--scene/gui/patch_9_frame.h8
-rw-r--r--scene/gui/texture_frame.cpp34
-rw-r--r--scene/gui/texture_frame.h10
8 files changed, 61 insertions, 61 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index ac8ce68564..a0a7442849 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -487,7 +487,7 @@ ColorPicker::ColorPicker() :
btn_pick = memnew( ToolButton );
btn_pick->connect("pressed",this,"_screen_pick_pressed");
- sample = memnew( TextureFrame );
+ sample = memnew( TextureRect );
sample->set_h_size_flags(SIZE_EXPAND_FILL);
sample->connect("draw",this,"_sample_draw");
@@ -590,7 +590,7 @@ ColorPicker::ColorPicker() :
HBoxContainer *bbc = memnew( HBoxContainer );
add_child(bbc);
- preset = memnew( TextureFrame );
+ preset = memnew( TextureRect );
bbc->add_child(preset);
//preset->set_ignore_mouse(false);
preset->connect("gui_input", this, "_preset_input");
diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h
index c6a8ef7725..bb8a4a8dbd 100644
--- a/scene/gui/color_picker.h
+++ b/scene/gui/color_picker.h
@@ -50,8 +50,8 @@ private:
Image last_capture;
Control *uv_edit;
Control *w_edit;
- TextureFrame *sample;
- TextureFrame *preset;
+ TextureRect *sample;
+ TextureRect *preset;
Button *bt_add_preset;
List<Color> presets;
ToolButton *btn_pick;
diff --git a/scene/gui/color_rect.cpp b/scene/gui/color_rect.cpp
index fee96d1ca9..ce12a27460 100644
--- a/scene/gui/color_rect.cpp
+++ b/scene/gui/color_rect.cpp
@@ -3,33 +3,33 @@
-void ColorFrame::set_frame_color(const Color& p_color) {
+void ColorRect::set_frame_color(const Color& p_color) {
color=p_color;
update();
}
-Color ColorFrame::get_frame_color() const{
+Color ColorRect::get_frame_color() const{
return color;
}
-void ColorFrame::_notification(int p_what) {
+void ColorRect::_notification(int p_what) {
if (p_what==NOTIFICATION_DRAW) {
draw_rect(Rect2(Point2(),get_size()),color);
}
}
-void ColorFrame::_bind_methods() {
+void ColorRect::_bind_methods() {
- ClassDB::bind_method(_MD("set_frame_color","color"),&ColorFrame::set_frame_color);
- ClassDB::bind_method(_MD("get_frame_color"),&ColorFrame::get_frame_color);
+ ClassDB::bind_method(_MD("set_frame_color","color"),&ColorRect::set_frame_color);
+ ClassDB::bind_method(_MD("get_frame_color"),&ColorRect::get_frame_color);
ADD_PROPERTY(PropertyInfo(Variant::COLOR,"color"),_SCS("set_frame_color"),_SCS("get_frame_color") );
}
-ColorFrame::ColorFrame() {
+ColorRect::ColorRect() {
color=Color(1,1,1);
}
diff --git a/scene/gui/color_rect.h b/scene/gui/color_rect.h
index f313bbc4f9..9d8b958130 100644
--- a/scene/gui/color_rect.h
+++ b/scene/gui/color_rect.h
@@ -3,8 +3,8 @@
#include "scene/gui/control.h"
-class ColorFrame : public Control {
- GDCLASS(ColorFrame,Control)
+class ColorRect : public Control {
+ GDCLASS(ColorRect,Control)
Color color;
protected:
@@ -16,7 +16,7 @@ public:
void set_frame_color(const Color& p_color);
Color get_frame_color() const;
- ColorFrame();
+ ColorRect();
};
#endif // COLORRECT_H
diff --git a/scene/gui/patch_9_frame.cpp b/scene/gui/patch_9_frame.cpp
index e32f60a222..1f6145d5db 100644
--- a/scene/gui/patch_9_frame.cpp
+++ b/scene/gui/patch_9_frame.cpp
@@ -30,7 +30,7 @@
#include "servers/visual_server.h"
-void Patch9Frame::_notification(int p_what) {
+void NinePatchRect::_notification(int p_what) {
if (p_what==NOTIFICATION_DRAW) {
@@ -61,21 +61,21 @@ void Patch9Frame::_notification(int p_what) {
}
}
-Size2 Patch9Frame::get_minimum_size() const {
+Size2 NinePatchRect::get_minimum_size() const {
return Size2(margin[MARGIN_LEFT]+margin[MARGIN_RIGHT],margin[MARGIN_TOP]+margin[MARGIN_BOTTOM]);
}
-void Patch9Frame::_bind_methods() {
+void NinePatchRect::_bind_methods() {
- ClassDB::bind_method(_MD("set_texture","texture"), & Patch9Frame::set_texture );
- ClassDB::bind_method(_MD("get_texture"), & Patch9Frame::get_texture );
- ClassDB::bind_method(_MD("set_patch_margin","margin","value"), & Patch9Frame::set_patch_margin );
- ClassDB::bind_method(_MD("get_patch_margin","margin"), & Patch9Frame::get_patch_margin );
- ClassDB::bind_method(_MD("set_region_rect","rect"),&Patch9Frame::set_region_rect);
- ClassDB::bind_method(_MD("get_region_rect"),&Patch9Frame::get_region_rect);
- ClassDB::bind_method(_MD("set_draw_center","draw_center"), & Patch9Frame::set_draw_center );
- ClassDB::bind_method(_MD("get_draw_center"), & Patch9Frame::get_draw_center );
+ ClassDB::bind_method(_MD("set_texture","texture"), & NinePatchRect::set_texture );
+ ClassDB::bind_method(_MD("get_texture"), & NinePatchRect::get_texture );
+ ClassDB::bind_method(_MD("set_patch_margin","margin","value"), & NinePatchRect::set_patch_margin );
+ ClassDB::bind_method(_MD("get_patch_margin","margin"), & NinePatchRect::get_patch_margin );
+ ClassDB::bind_method(_MD("set_region_rect","rect"),&NinePatchRect::set_region_rect);
+ ClassDB::bind_method(_MD("get_region_rect"),&NinePatchRect::get_region_rect);
+ ClassDB::bind_method(_MD("set_draw_center","draw_center"), & NinePatchRect::set_draw_center );
+ ClassDB::bind_method(_MD("get_draw_center"), & NinePatchRect::get_draw_center );
ADD_SIGNAL(MethodInfo("texture_changed"));
@@ -92,7 +92,7 @@ void Patch9Frame::_bind_methods() {
}
-void Patch9Frame::set_texture(const Ref<Texture>& p_tex) {
+void NinePatchRect::set_texture(const Ref<Texture>& p_tex) {
if (texture==p_tex)
return;
@@ -104,14 +104,14 @@ void Patch9Frame::set_texture(const Ref<Texture>& p_tex) {
emit_signal("texture_changed");
}
-Ref<Texture> Patch9Frame::get_texture() const {
+Ref<Texture> NinePatchRect::get_texture() const {
return texture;
}
-void Patch9Frame::set_patch_margin(Margin p_margin,int p_size) {
+void NinePatchRect::set_patch_margin(Margin p_margin,int p_size) {
ERR_FAIL_INDEX(p_margin,4);
margin[p_margin]=p_size;
@@ -133,13 +133,13 @@ void Patch9Frame::set_patch_margin(Margin p_margin,int p_size) {
}
}
-int Patch9Frame::get_patch_margin(Margin p_margin) const{
+int NinePatchRect::get_patch_margin(Margin p_margin) const{
ERR_FAIL_INDEX_V(p_margin,4,0);
return margin[p_margin];
}
-void Patch9Frame::set_region_rect(const Rect2& p_region_rect) {
+void NinePatchRect::set_region_rect(const Rect2& p_region_rect) {
if (region_rect==p_region_rect)
return;
@@ -150,23 +150,23 @@ void Patch9Frame::set_region_rect(const Rect2& p_region_rect) {
_change_notify("region_rect");
}
-Rect2 Patch9Frame::get_region_rect() const {
+Rect2 NinePatchRect::get_region_rect() const {
return region_rect;
}
-void Patch9Frame::set_draw_center(bool p_draw) {
+void NinePatchRect::set_draw_center(bool p_draw) {
draw_center=p_draw;
update();
}
-bool Patch9Frame::get_draw_center() const{
+bool NinePatchRect::get_draw_center() const{
return draw_center;
}
-Patch9Frame::Patch9Frame() {
+NinePatchRect::NinePatchRect() {
margin[MARGIN_LEFT]=0;
@@ -179,6 +179,6 @@ Patch9Frame::Patch9Frame() {
}
-Patch9Frame::~Patch9Frame()
+NinePatchRect::~NinePatchRect()
{
}
diff --git a/scene/gui/patch_9_frame.h b/scene/gui/patch_9_frame.h
index afbeca5ae8..d55f4e4f69 100644
--- a/scene/gui/patch_9_frame.h
+++ b/scene/gui/patch_9_frame.h
@@ -33,9 +33,9 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-class Patch9Frame : public Control {
+class NinePatchRect : public Control {
- GDCLASS(Patch9Frame,Control);
+ GDCLASS(NinePatchRect,Control);
bool draw_center;
int margin[4];
@@ -61,8 +61,8 @@ public:
void set_draw_center(bool p_enable);
bool get_draw_center() const;
- Patch9Frame();
- ~Patch9Frame();
+ NinePatchRect();
+ ~NinePatchRect();
};
#endif // PATCH_9_FRAME_H
diff --git a/scene/gui/texture_frame.cpp b/scene/gui/texture_frame.cpp
index bfa72ef067..6556e487f1 100644
--- a/scene/gui/texture_frame.cpp
+++ b/scene/gui/texture_frame.cpp
@@ -29,7 +29,7 @@
#include "texture_frame.h"
#include "servers/visual_server.h"
-void TextureFrame::_notification(int p_what) {
+void TextureRect::_notification(int p_what) {
if (p_what==NOTIFICATION_DRAW) {
@@ -85,22 +85,22 @@ void TextureFrame::_notification(int p_what) {
}
}
-Size2 TextureFrame::get_minimum_size() const {
+Size2 TextureRect::get_minimum_size() const {
if (!expand && !texture.is_null())
return texture->get_size();
else
return Size2();
}
-void TextureFrame::_bind_methods() {
+void TextureRect::_bind_methods() {
- ClassDB::bind_method(_MD("set_texture","texture"), & TextureFrame::set_texture );
- ClassDB::bind_method(_MD("get_texture"), & TextureFrame::get_texture );
- ClassDB::bind_method(_MD("set_expand","enable"), & TextureFrame::set_expand );
- ClassDB::bind_method(_MD("has_expand"), & TextureFrame::has_expand );
- ClassDB::bind_method(_MD("set_stretch_mode","stretch_mode"), & TextureFrame::set_stretch_mode );
- ClassDB::bind_method(_MD("get_stretch_mode"), & TextureFrame::get_stretch_mode );
+ ClassDB::bind_method(_MD("set_texture","texture"), & TextureRect::set_texture );
+ ClassDB::bind_method(_MD("get_texture"), & TextureRect::get_texture );
+ ClassDB::bind_method(_MD("set_expand","enable"), & TextureRect::set_expand );
+ ClassDB::bind_method(_MD("has_expand"), & TextureRect::has_expand );
+ ClassDB::bind_method(_MD("set_stretch_mode","stretch_mode"), & TextureRect::set_stretch_mode );
+ ClassDB::bind_method(_MD("get_stretch_mode"), & TextureRect::get_stretch_mode );
ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), _SCS("set_texture"),_SCS("get_texture") );
ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "expand" ), _SCS("set_expand"),_SCS("has_expand") );
@@ -117,7 +117,7 @@ void TextureFrame::_bind_methods() {
}
-void TextureFrame::set_texture(const Ref<Texture>& p_tex) {
+void TextureRect::set_texture(const Ref<Texture>& p_tex) {
texture=p_tex;
update();
@@ -126,35 +126,35 @@ void TextureFrame::set_texture(const Ref<Texture>& p_tex) {
minimum_size_changed();
}
-Ref<Texture> TextureFrame::get_texture() const {
+Ref<Texture> TextureRect::get_texture() const {
return texture;
}
-void TextureFrame::set_expand(bool p_expand) {
+void TextureRect::set_expand(bool p_expand) {
expand=p_expand;
update();
minimum_size_changed();
}
-bool TextureFrame::has_expand() const {
+bool TextureRect::has_expand() const {
return expand;
}
-void TextureFrame::set_stretch_mode(StretchMode p_mode) {
+void TextureRect::set_stretch_mode(StretchMode p_mode) {
stretch_mode=p_mode;
update();
}
-TextureFrame::StretchMode TextureFrame::get_stretch_mode() const {
+TextureRect::StretchMode TextureRect::get_stretch_mode() const {
return stretch_mode;
}
-TextureFrame::TextureFrame() {
+TextureRect::TextureRect() {
expand=false;
@@ -163,7 +163,7 @@ TextureFrame::TextureFrame() {
}
-TextureFrame::~TextureFrame()
+TextureRect::~TextureRect()
{
}
diff --git a/scene/gui/texture_frame.h b/scene/gui/texture_frame.h
index c311748708..dea5b3b0ac 100644
--- a/scene/gui/texture_frame.h
+++ b/scene/gui/texture_frame.h
@@ -33,9 +33,9 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-class TextureFrame : public Control {
+class TextureRect : public Control {
- GDCLASS(TextureFrame,Control);
+ GDCLASS(TextureRect,Control);
public:
enum StretchMode {
STRETCH_SCALE_ON_EXPAND, //default, for backwards compatibility
@@ -69,10 +69,10 @@ public:
void set_stretch_mode(StretchMode p_mode);
StretchMode get_stretch_mode() const;
- TextureFrame();
- ~TextureFrame();
+ TextureRect();
+ ~TextureRect();
};
-VARIANT_ENUM_CAST( TextureFrame::StretchMode );
+VARIANT_ENUM_CAST( TextureRect::StretchMode );
#endif // TEXTURE_FRAME_H