Browse Source

renamed to Selectable to UISelectable

Enhex 7 years ago
parent
commit
8ecbfad065

+ 5 - 5
Source/Urho3D/UI/Selectable.cpp

@@ -8,16 +8,16 @@ namespace Urho3D
 
 extern const char* UI_CATEGORY;
 
-void Selectable::RegisterObject(Context* context)
+void UISelectable::RegisterObject(Context* context)
 {
-    context->RegisterFactory<Selectable>(UI_CATEGORY);
+    context->RegisterFactory<UISelectable>(UI_CATEGORY);
 
     URHO3D_COPY_BASE_ATTRIBUTES(UIElement);
     URHO3D_ATTRIBUTE("Selection Color", Color, selectionColor_, Color::TRANSPARENT, AM_FILE);
     URHO3D_ATTRIBUTE("Hover Color", Color, hoverColor_, Color::TRANSPARENT, AM_FILE);
 }
 
-void Selectable::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect & currentScissor)
+void UISelectable::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect & currentScissor)
 {
     // Hovering and/or whole selection batch
     if ((hovering_ && hoverColor_.a_ > 0.0) || (selected_ && selectionColor_.a_ > 0.0f))
@@ -34,12 +34,12 @@ void Selectable::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& verte
     hovering_ = false;
 }
 
-void Selectable::SetSelectionColor(const Color& color)
+void UISelectable::SetSelectionColor(const Color& color)
 {
     selectionColor_ = color;
 }
 
-void Selectable::SetHoverColor(const Color& color)
+void UISelectable::SetHoverColor(const Color& color)
 {
     hoverColor_ = color;
 }

+ 3 - 3
Source/Urho3D/UI/Selectable.h

@@ -27,13 +27,13 @@
 namespace Urho3D
 {
 
-class URHO3D_API Selectable : public UIElement
+class URHO3D_API UISelectable : public UIElement
 {
 public:
-    URHO3D_OBJECT(Selectable, UIElement);
+    URHO3D_OBJECT(UISelectable, UIElement);
 
     using UIElement::UIElement;
-    ~Selectable() override = default;
+    ~UISelectable() override = default;
 
     /// Register object factory.
     static void RegisterObject(Context* context);

+ 5 - 5
Source/Urho3D/UI/Text.cpp

@@ -52,7 +52,7 @@ extern const char* horizontalAlignments[];
 extern const char* UI_CATEGORY;
 
 Text::Text(Context* context) :
-    Selectable(context),
+    UISelectable(context),
     fontSize_(DEFAULT_FONT_SIZE),
     textAlignment_(HA_LEFT),
     rowSpacing_(1.0f),
@@ -79,7 +79,7 @@ void Text::RegisterObject(Context* context)
 {
     context->RegisterFactory<Text>(UI_CATEGORY);
 
-    URHO3D_COPY_BASE_ATTRIBUTES(Selectable);
+    URHO3D_COPY_BASE_ATTRIBUTES(UISelectable);
     URHO3D_UPDATE_ATTRIBUTE_DEFAULT_VALUE("Use Derived Opacity", false);
     URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Font", GetFontAttr, SetFontAttr, ResourceRef, ResourceRef(Font::GetTypeStatic()), AM_FILE);
     URHO3D_ATTRIBUTE("Font Size", float, fontSize_, DEFAULT_FONT_SIZE, AM_FILE);
@@ -100,7 +100,7 @@ void Text::RegisterObject(Context* context)
 
 void Text::ApplyAttributes()
 {
-    Selectable::ApplyAttributes();
+    UISelectable::ApplyAttributes();
 
     // Localize now if attributes were loaded out-of-order
     if (autoLocalizable_ && stringId_.Length())
@@ -137,7 +137,7 @@ void Text::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData,
     }
 
     // Hovering and/or whole selection batch
-    Selectable::GetBatches(batches, vertexData, currentScissor);
+    UISelectable::GetBatches(batches, vertexData, currentScissor);
 
     // Partial selection batch
     if (!selected_ && selectionLength_ && charLocations_.Size() >= selectionStart_ + selectionLength_ && selectionColor_.a_ > 0.0f)
@@ -468,7 +468,7 @@ String Text::GetTextAttr() const
 
 bool Text::FilterImplicitAttributes(XMLElement& dest) const
 {
-    if (!Selectable::FilterImplicitAttributes(dest))
+    if (!UISelectable::FilterImplicitAttributes(dest))
         return false;
 
     if (!IsFixedWidth())

+ 2 - 2
Source/Urho3D/UI/Text.h

@@ -70,9 +70,9 @@ struct GlyphLocation
 };
 
 /// %Text %UI element.
-class URHO3D_API Text : public Selectable
+class URHO3D_API Text : public UISelectable
 {
-    URHO3D_OBJECT(Text, Selectable);
+    URHO3D_OBJECT(Text, UISelectable);
 
     friend class Text3D;
 

+ 1 - 1
Source/Urho3D/UI/UI.cpp

@@ -2140,7 +2140,7 @@ void RegisterUILibrary(Context* context)
     Font::RegisterObject(context);
 
     UIElement::RegisterObject(context);
-    Selectable::RegisterObject(context);
+    UISelectable::RegisterObject(context);
     BorderImage::RegisterObject(context);
     Sprite::RegisterObject(context);
     Button::RegisterObject(context);

+ 1 - 1
bin/Data/UI/EditorIcons.xml

@@ -251,7 +251,7 @@
         <attribute name="Texture" value="Texture2D;Textures/Editor/EditorIcons.png" />
         <attribute name="Image Rect" value="16 32 30 46" />
     </element>
-    <element type="Selectable">
+    <element type="UISelectable">
         <attribute name="Texture" value="Texture2D;Textures/Editor/EditorIcons.png" />
         <attribute name="Image Rect" value="16 32 30 46" />
     </element>